Pages

Thursday, April 21, 2016

Nagios Plugin for Overland Storage

Icinga2 is a great Network & Systems monitoring tool forked from Nagios. It's very flexible and very easy to understand and use. I have worked with many different Network and Systems monitoring tools throughout my career, Solarwinds, SCOM, WhatsUP Gold, ManageEngine, SpiceWorks, Nagios, etc. just to name a few. But this one beats them all. 

If you can't find a plugin (or check as they call it in Nagios world), you can write your own and that's what I did. Go check it out, it's on github, 

https://github.com/computingbee/check_overlandstorage

This lets you monitor Disk, RAID status, and NIC failures on your Overland Storage arrays.

Thursday, April 14, 2016

check_nwc_health icinga2 service config script

This bash script lets you quickly generate configs for you switch for use with icinga2 monitoring command check_nwc_health as described here, https://gist.github.com/lazyfrosch/005c8becab82c712681c. It assumes you have already configured and installed check_nwc_health under /usr/bin/nagios/plugins/.

It's helpful if you have 100s of interfaces on your switches in MDFs or IDFs.

#!/bin/bash
host_addr="1.1.1.1"
for i in {1..2} #module
do 
  for j in {1..24} #interfaces
   do 
    if_name="GigabitEthernet$i/0/$j"
    if_desc=`/usr/lib/nagios/plugins/check_nwc_health --hostname "$host_addr" --mode interface-status --community mysnmp --name "$if_name" | cut -d' ' -f5 | tr -d ')'`
  
    if [ "$if_desc" == "is" ]; then
     continue
    fi
  
    if_setting='
vars.interfaces["'"$if_name"'"] = {
  description = "'"$if_desc"'"
}'
    echo "$if_setting"
   done
done

#####
#Port Channels
#####

for i in {1..10} #Port Channel Numbers
 do 
 if_name="Port-Channel$i"
 if_desc=`/usr/lib/nagios/plugins/check_nwc_health --hostname "$host_addr" --mode interface-status --community mysnmp --name "$if_name" | cut -d' ' -f5 | tr -d ')'`
  
 if [ "$if_desc" == "" ]; then
  continue
 fi
  
 if_setting='
vars.interfaces["'"$if_name"'"] = {
  description = "'"$if_desc"'"
}'
 echo "$if_setting"
done