Home

Search this site:
 

Horshack’s
very
own site

 

This is Bavaria, Germany!
You will find links to Perl,
bootdisks for system administration,
a lot of Linux,
Windows administration
and some personal belongings.
Nagios, HP-server, DL385, checking health of power-supply

Nagios - HP-Server, checking health of powersupply

All common question to SNMP, MIB-files, where to get them etc. can be found here: mibfiles.html

How to find what to ask

I found the searched values in the files delivered with HP insight manager in the file cpqhlth.mib

How many powersupplies are there

-- The compaq enterprise               (1.3.6.1.4.1.232)
--      cpqHealth Group                (1.3.6.1.4.1.232.6)
--       cpqHeComponent Group          (1.3.6.1.4.1.232.6.2)
--        cpqHeFltTolPowerSupply Group (1.3.6.1.4.1.232.6.2.9)
--         cpqHeFltTolPowerSupplyTable (1.3.6.1.4.1.232.6.2.9.3)
[...]
    CpqHeFltTolPowerSupplyEntry ::= SEQUENCE {
        cpqHeFltTolPowerSupplyChassis             INTEGER,
        cpqHeFltTolPowerSupplyBay                 INTEGER,
        cpqHeFltTolPowerSupplyPresent             INTEGER,
[...]
    cpqHeFltTolPowerSupplyPresent OBJECT-TYPE
        SYNTAX  INTEGER {
            other(1),
            absent(2),
            present(3)
            }
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "Indicates whether the power supply is present in the chassis."
        ::= { cpqHeFltTolPowerSupplyEntry 3 }

When browsing the OID .1.3.6.1.4.1.232.6.2.9.3 I got also these values:

.1.3.6.1.4.1.232.6.2.9.3.1.3.0.1 = 3
.1.3.6.1.4.1.232.6.2.9.3.1.3.0.2 = 3
which means that I have to power-supplies in this server.

How is the status of every power-supply

A little later I find this in the MIB-file

    cpqHeFltTolPowerSupplyCondition OBJECT-TYPE
        SYNTAX  INTEGER {
            other(1),
            ok(2),
            degraded(3),
            failed(4)
            }
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
            "The condition of the power supply.

            This value will be one of the following:

            other(1)
              The status could not be determined or not present.

            ok(2)
              The power supply is operating normally.

            degraded(3)
              A temperature sensor, fan or other power supply component is
              outside of normal operating range.

            failed(4)
              A power supply component detects a condition that could
              permanently damage the system."
        ::= { cpqHeFltTolPowerSupplyEntry 4 }

When browsing the OID .1.3.6.1.4.1.232.6.2.9.3.1.4.0 I got also these values:

.1.3.6.1.4.1.232.6.2.9.3.1.4.0.1 = 2
.1.3.6.1.4.1.232.6.2.9.3.1.4.0.2 = 4 
which means that .1-powersupply is ok, .2-powersupply is defect.

Nagios configuration

I want to check in Nagios wether my powersupply 1 and 2 are ok. On the commandline I do it like this:

OID=.1.3.6.1.4.1.232.6.2.9.3.1.4.0.1
/usr/lib/nagios/plugins/check_snmp -H ddeck1.zdf -o $OID -C public -m : -r 2 -l "2=ok 3=degraded 4=failed"
2=ok 3=degraded 4=failed OK - 2

To integrate this into Nagios:

# file: checkcommand.cfg
[...]
# check an snmp-value
# There is only ONE good value, everything else is critical
# Example for health of 
# powersupply for HP DL380 Server, power supply #1 (= .1), Status 2 = ok,
# in file services.cfg
# check_command   check_snmp_oid_good_value!2!.1.3.6.1.4.1.232.6.2.9.3.1.4.0.1!2=ok 3=degraded 4=failed
define command{
    command_name    check_snmp_oid_good_value
    command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -o $ARG2$ -C $ARG4$ -m : -r $ARG1$ -l "$ARG3$"
}
# file: services.cfg
[...]
# powersupply healthy? ok=2, degraded=3, failed=4
define service{
    use                      generic-service
    host_name                myserver.local
    service_description      powersupply1_healthy
    check_command            check_snmp_oid_good_value!2!.1.3.6.1.4.1.232.6.2.9.3.1.4.0.1!2=ok 3=degraded 4=failed!public
}

define service{
    use                      generic-service
    host_name                my-server.local
    service_description      powersupply2_healthy
    check_command            check_snmp_oid_good_value!2!.1.3.6.1.4.1.232.6.2.9.3.1.4.0.2!2=ok 3=degraded 4=failed!public
}

Impressum