Showing posts with label Nagios. Show all posts
Showing posts with label Nagios. Show all posts

Wednesday, September 3, 2008

check_iostat and check_multi - perfdata discarded bad UOM ','

i had this dumb issue today.

The plugin check_iostat returned wrong perfdata. check_multi discards perfdata that is not returned like its defined in the nagios developer guidelines so i wasnt able to get perfdata from my check_iostat checks within a check_multi Service.

So i just 'patched' (is it possible to "patch" shell scripts? - dont think so ;-) ) the plugins.
I Just replaced the last lines where the performance data is returned with my own ones which do replace all 'comma' with 'dots'. It is looking like this:

UPDATE: I recognized that the whole perfdata output wrong, not even the issue with the commata there was even an issue with the order of the returned values, here is how it is working for me:

# Perfdata support
#${ECHO} "$msg|ioread=${ioread}c;${CRITICALREAD};${WARNINGREAD};0;iowrite=${iowrite}c;${CRITICALWRITE};${WARNINGWRITE};0; \n"
MYPERF="$msg|ioread=${ioread}kByte/s;${WARNINGREAD};${CRITICALREAD};0;0;iowrite=${iowrite}kByte/s;${CRITICALWRITE};${WARNINGWRITE};0;"
MYPERF=`echo "$MYPERF" | sed 's/\(,\)\([0-9]*\)/\.\2/g'`
echo $MYPERF
exit ${exitstatus}


Hope this helps somebody.

bohboh,
kratediggah

Monday, September 1, 2008

Nagios Check Fails: Can't locate utils.pm in @INC (@INC

i had this issue today several times. It is caused because a particular plugin isn't able to locate the utils.pm file. In my case this was caused by a wrong defined lib include path in following plugins:

check_generic, check_snmp_int, check_multi, check_file_age

It's pretty easy to fix it, just change:

use lib "/usr/local/nagios/libexec" ;

to

use lib "/usr/lib/nagios/plugins" ;

and everything will be fine.

bohboh,
kratediggah

Friday, August 29, 2008

Citrix Presentation Server Farm Montiroring in Nagios with check_multi and SNMP

here is how i do monitor Citrix Presentation Servers. It is mostly about checking normal System Parameters like CPU, Disks and the Check out if all Services are running and the corresponding Ports are responding.

I do it with a check_multi query.

check_multi Command File:

#
# win_citrix.cmd
#
# config file for checking Citrix Presentation Servers
#
# Sebastian Koch, 2008
#
#--- citrix states ---
#state [ WARNING ] = COUNT(WARNING) > 2
#state [ CRITICAL ] = COUNT(CRITICAL) > 2

#--- citrix ports
command[ citrix_cmc_port ] = check_tcp -H $HOSTADDRESS$ -p 2513 -w 2.0 -c 3.0
command[ citrix_ica_port ] = check_tcp -H $HOSTADDRESS$ -p 1494 -w 2.0 -c 3.0
command[ citrix_ima_port ] = check_tcp -H $HOSTADDRESS$ -p 2512 -w 2.0 -c 3.0
command[ citrix_outlook_de ] = check_ica_metaframe_pub_apps.pl -C citrix.mydomain.tld -W "Outlook 2003"

#--- citrix services
command[ service_activesync] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix ActiveSync Service"
command[ service_clientnetwork] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix Client Network"
command[ service_diagnostic] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix Diagnostic Facility COM Server"
command[ service_encryption] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix Encryption Service"
command[ service_management] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix Independent Management Architecture"
command[ service_mfcom] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix MFCOM Service"
command[ service_print] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix Print Manager Service"
command[ service_servicesmgr] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix Services Manager"
command[ service_sma] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix SMA Service"
command[ service_xml] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix XML Service"
command[ service_xte] = check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG2$ -n "Citrix XTE Server"


Check Command Definiton:
$ARG3$ can be used for additional parameters (e.g. -s suppress_perfdata-,

define command {
command_name check_multi
command_line $USER1$/check_multi -t 40 -T 180 -f $ARG1$ -l /usr/local/nagios/libexec/ -r 11 $ARG3$
}

Service Definition:

check_command check_multi!/usr/local/nagios/etc/multicommands/win_citrix.cmd!community

Hopefullt this works out for you. Please send me comments if you got additions/corrections.

bohboh,
kratediggah


Cisco Call Manager Monitoring in Nagios with check_multi and SNMP

Hi,

I recently needed to integrate Cisco Call Manager Devices into Nagios and i did not find anything on the web, no plugins, neither OIDs. So i needed to figure them out by myself and after some work i had this check_multi command definition which integrates some ccm parameters like version, hostname and registered phones, ata's gateway ip's and some ither stuff.

The best is to do it the "check_multi" way, but it would be possible to cut every checkout and make a single one outof it.

Requirements:
ftp://ftp-sj.cisco.com/pub/mibs/v2/CISCO-CCM-MIB.my - Cisco Call Manager MIB - should be placed into /usr/share/snmp/mibs
check_multi

The cisco_ccm.cmd - i place all my multi commadn definitions in nagios/etc/multicommands/

Command File:

#
# cisco_callmanager.cmd
#
# Sebastian Koch, 2008
#
# $ARG2$ needs to be the snmp community string
#
#--- voice gateway ips
#
# 1.3.6.1.4.1.9.9.156.1.11.1.1.6.2
# 1.3.6.1.4.1.9.9.156.1.11.1.1.6.3
# 1.3.6.1.4.1.9.9.156.1.11.1.1.6.4
#
#--- cisco system parameters
command[ hostname ] = check_snmp -m SNMPv2-MIB -H $HOSTADDRESS$ -C $ARG2$ -o 'SNMPv2-MIB::sysName.0' -l SysName -l 'System Name'

#--- call manager ios versions
command[ ccm_version ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 'CISCO-CCM-MIB::ccmVersion.1' -l "CCM Version"
command[ ccm_system_version ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 'CISCO-CCM-MIB::ccmSystemVersion.0' -l "CCM System Version"

#--- call manager stats
command[ active_phones ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 'CISCO-CCM-MIB::ccmInActivePhones.0' -l "Active Phones" -u 'Phones'
command[ registered_phones ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 'CISCO-CCM-MIB::ccmRegisteredPhones.0' -l "Registered Phones" -u 'Phones'
command[ unregistered_phones ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 'CISCO-CCM-MIB::ccmUnregisteredPhones.0' -l "Unregistered Phones" -u 'Phones'
command[ rejected_phones ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 'CISCO-CCM-MIB::ccmRejectedPhones.0' -l "Rejected Phones" -u 'Phones'
command[ active_atas ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 'CISCO-CCM-MIB::ccmActiveGateways.0' -l "Active ATA's" -u "ATA's"
command[ unregistered_atas ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 'CISCO-CCM-MIB::ccmUnregisteredGateways.0' -l "Unregistered ATAs" -u 'ATAs'
command[ rejected_atas ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 'CISCO-CCM-MIB::ccmRejectedGateways.0' -l "Unregistered ATAs" -u 'ATAs'

#--- gateway ip's
#--- check if the gateway ip's are the expected ones (-r directive), the sed command is to correct the ouput

command[ gateway_ip1 ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 1.3.6.1.4.1.9.9.156.1.11.1.1.6.2 -l "Gateway Ip 1" -r "10.150.14.3" | sed s/\Wrong\ Type\ \(should\ be\ OCTET\ STRING\)\:// | sed s/\*//
command[ gateway_ip2 ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 1.3.6.1.4.1.9.9.156.1.11.1.1.6.4 -l "Gateway Ip 2" -r "10.200.14.3" | sed s/\Wrong\ Type\ \(should\ be\ OCTET\ STRING\)\:// | sed s/\*//
command[ gateway_ip3 ] = check_snmp -m CISCO-CCM-MIB -P 2c -H $HOSTADDRESS$ -C $ARG2$ -o 1.3.6.1.4.1.9.9.156.1.11.1.1.6.3 -l "Gateway Ip 3" -r "10.100.14.3" | sed s/\Wrong\ Type\ \(should\ be\ OCTET\ STRING\)\:// | sed s/\*//
#command[ interfaces] = check_interface_table.pl -H $HOSTADDRESS$ -C $ARG2$ -HTMLUrl 'https://monitoring-server/nagios/interfacetable'

Service Definition:

define service {
check_command check_multi!/usr/local/nagios/etc/multicommands/cisco_callmanager.cmd!public!-s suppress_perfdata=hostname,ccm_system,ccm_system_version,gateway_ip_1,gateway_ip_2,gateway_ip_3
}


Check Command Definition:


define command {
command_name check_multi
command_line $USER1$/check_multi -t 40 -T 180 -f $ARG1$ -l /usr/local/nagios/libexec/ -r 11 $ARG3$
}


Hopefully this helps out some people as i did not found anything on the web to monitor CCM Stats with nagios.

bohboh,
kratediggah

Thursday, July 31, 2008

Howto Link ilo2 Webinterface into Nagios

i needed to link my ilo2 webinterfaces into the Nagios Host Pages. As i got a bunch of servers i searched something to make this as simple as possible for me.

To ease the pain in of adding new servers, just add all your ilo2 controller to your dns domain. I added a CNAME Entry for every server like -ilo..tld

Now just create a hostextinfo file:

/usr/local/nagios/etc/hostextinfo_custom.cfg
# HP Server with ilo2 Controllers
define hostextinfo {
host_name server1,server2,server3,server4,serverX
notes <a href=https://$HOSTNAME$-ilo.mydomain.tld target=_blank style='text-decoration: underline'>$HOSTNAME$ -- ilo2 Webinterface</a>
icon_image hp.png
}

Now place something like: cfg_file hostextinfo_custom.cfg to your nagios.cfg to make sure it will be included on startup of the nagios daemon.

Now you will see a ilo2 Link in every Host View.

bohboh,
kratediggah

Monday, July 21, 2008

Firefox: Nagios Checker

I am using this since several weeks and it is a great plugin. Just try it out, it is great for getting nagios informations without being directly on the webinterface. It is developed by Peter Simek.

You can check it out here projects webpage or you can download the plugin here

bohboh,
kratediggah

Thursday, July 3, 2008

Nagios Plugin for Checking Cisco MPLS / HSRP States and IPs

This is my first self written plugin.

It will Check Cisco Routers (Active/Passive/HSRP) for Correct Active and Passive IP's and the Actual State of Components.

Download:

You can download it here.


This Script is capable to check MPLS Routers for their correct Ip's (Active / Passive) by querying them with SNMP and to compare this result with provided Ip's.
It is also possible to check for the Standby State of a Router.

Just see ./check_cisco_hsrp.sh -h for more Information.

Some Examples:

Check if the Active Router got a specific IP-Address

./check_cisco_hsrp.sh -H 10.35.10.250 -C public -m active 10.35.10.248
OK - Active Router Ip 10.35.10.248 is the correct ip (10.35.10.248)


Check if the Standby Router got the correct IP-Address

./check_cisco_hsrp.sh -H 10.35.10.250 -C public -m standby 10.35.10.249
OK - Standby Router Ip 10.35.10.249 is the correct ip (10.35.10.249)


Check if the Second (Standby) Router is in Standby State

./check_cisco_hsrp.sh -H 10.35.10.249 -C public -m state 5
OK - 10.35.10.249 is in HSRP State: standby

./check_cisco_hsrp.sh -H 10.35.10.248 -C public -m state 5
CRITICAL - 10.35.10.248 is in HSRP State: Active but should be Standby

HSRP States:
Standby = 5
Active = 6

Please let me know what you think about it. Please report bugs if you find some (i think so).

bohboh,
kratediggah