Showing posts with label check_multi. Show all posts
Showing posts with label check_multi. 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