Nagios plugin - check_apcext.pl
05.03.07 Paul Venezia 

This plugin monitors several APC power and air conditioning units for most pertinent information. 

Usage: ./check_apcext.pl -H <hostip> -C <community> -p <parameter> -w <warnval> -c <critval>

Parameters:
APC NetBotz 
        nbmstemp        NetBotz main sensor temp
        nbmshum         NetBotz main sensor humidity
        nbmsairflow     NetBotz main sensor airflow

APC Metered Rack PDU (3 phase)
        rpduamps        Amps on each phase

APC ACSC In-Row
        acscstatus      System status (on/standby)
        acscload        Cooling load
        acscoutput      Cooling output
        acscsupair      Supply air
        acscairflow     Air flow
        acscracktemp    Rack inlet temp
        acsccondin      Condenser input temp
        acsccondout     Condenser outlet temp 

APC ACRC In-Row
        acrcstatus      System status (on/standby)
        acrcload        Cooling load
        acrcoutput      Cooling output
        acrcairflow     Air flow
        acrcracktemp    Rack inlet temp
        acrcsupair      Supply air
        acrcretair      Return air
        acrcfanspeed    Fan speed
        acrcfluidflow   Fluid flow
        acrcflenttemp   Fluid entering temp
        acrcflrettemp   Fluid return temp

Thus, in checkcommands.cfg, place the following:

define command{
        command_name    check_apcext
        command_line    $USER1$/check_apcext.pl -H $HOSTADDRESS$ -C $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$
}

and in services.cfg, you'll have something similar to the following:

define service{
        use                             generic-service
        hostgroup_name                  acsc
        service_description             ACSC Status
        is_volatile                     0
        contact_groups                  admins
        check_command                   check_apcext!public!acscstatus
        }
define service{
        use                             generic-service
        hostgroup_name                  acsc
        service_description             ACSC Rack Temps
        is_volatile                     0
        contact_groups                  admins
        check_command                   check_apcext!public!acscracktemp!90!95
        }

... and so on, for all parameters you wish to inspect. There are two special cases: 

1) ACSC and ACRC status has no warn/critical values -- it's OK if the unit is operating, and WARNING if it's on standby
2) Rack PDUs will flag as WARNING or CRITICAL if any of the three phases is beyond the threshold.

TODO: 
1) NetBotz external sensor monitoring
2) Other rack PDUs (although I don't have any to test)
3) Bugfixes?

Enjoy

-Paul
