Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser problem for PS #19

Closed
mikehubert4012 opened this issue Jan 19, 2016 · 3 comments
Closed

Parser problem for PS #19

mikehubert4012 opened this issue Jan 19, 2016 · 3 comments

Comments

@mikehubert4012
Copy link

Hi,

When I remove power on a PS to test a critical problem, i get that a hardware not found. (PS#2)

/usr/lib/nagios/plugins/check_idrac.py -H 10.x.x.x -v2c -c public -w PS#1
OK - PS 1: OK, Volt I/O: 264 V/208 V, Current: 0.4 A, Watt I/O: 900.0 W/750 W

/usr/lib/nagios/plugins/check_idrac.py -H 10.x.x.x -v2c -c public -w PS#2
hardware not found! If you sure the hw exists then you may want to edit TRANSLATOR code (line 612).

/usr/lib/nagios/plugins/check_idrac.py -H 10.x.x.x -v2c -c public -w PS
PS 1: OK, Volt I/O: 264 V/208 V, Current: 0.4 A, Watt I/O: 900.0 W/750 W
PS 2: CRITICAL(!!), Volt I/O: 264 V/(N/A) V, Current: (N/A) A, Watt I/O: 900.0 W/750 W

I was able to correct this, but i think the solution is not permanent one.
I added thoses lines at line 388:

            if self.hardware[2] == 'PS' :
                output = output.replace('No Such Instance currently exists at this OID','0')
            else:

That way I get a CRIT on PS#2.
/usr/lib/nagios/plugins/check_idrac.py -H 10.x.x.x -v2c -c public -w PS#2
CRIT - PS 2: CRITICAL(!!), Volt I/O: 264 V/(N/A) V, Current: 0.0 A, Watt I/O: 900.0 W/750 W

Regards,
Mike

@dangmocrang
Copy link
Owner

Hi,

When you remove the power its equal to the situation that you don't have
that power device, the script won't know if the device existed and be
removed or if its never exist before.
On Jan 20, 2016 2:44 AM, "mikehubert4012" notifications@github.com wrote:

Hi,

When I remove power on a PS to test a critical problem, i get that a
hardware not found (PS#2)

/usr/lib/nagios/plugins/check_idracpy -H 10xxx -v2c -c public -w PS#1
OK - PS 1: OK, Volt I/O: 264 V/208 V, Current: 04 A, Watt I/O: 9000 W/750 W

/usr/lib/nagios/plugins/check_idracpy -H 10xxx -v2c -c public -w PS#2
hardware not found! If you sure the hw exists then you may want to edit
TRANSLATOR code (line 612)

/usr/lib/nagios/plugins/check_idracpy -H 10xxx -v2c -c public -w PS
PS 1: OK, Volt I/O: 264 V/208 V, Current: 04 A, Watt I/O: 9000 W/750 W
PS 2: CRITICAL(!!), Volt I/O: 264 V/(N/A) V, Current: (N/A) A, Watt I/O:
9000 W/750 W

I was able to correct this, but i think the solution is not permanent one
I added thoses lines at line 388:

        if selfhardware[2] == 'PS' :
            output = outputreplace('No Such Instance currently exists at this OID','0')
        else:

That way I get a CRIT on PS#2
/usr/lib/nagios/plugins/check_idracpy -H 10xxx -v2c -c public -w PS#2
CRIT - PS 2: CRITICAL(!!), Volt I/O: 264 V/(N/A) V, Current: 00 A, Watt
I/O: 9000 W/750 W

Regards,
Mike


Reply to this email directly or view it on GitHub
#19.

@mikehubert4012
Copy link
Author

The problem is that when you call the snmpwalk manually from the snmp_cli string (see the request and answer for PS#1 and PS#2 below)

/etc/nagios/conf.d$ snmpget 10.x.x.x -O q -v 2c -c public powerSupplyIndex.1.1 powerSupplyStatus.1.1 powerSupplyOutputWatts.1.1 powerSupplyInputVoltage.1.1 powerSupplyRatedInputWattage.1.1 amperageProbeReading.1.1 -m ALL IDRAC-MIB-SMIv2::powerSupplyIndex.1.1 1 IDRAC-MIB-SMIv2::powerSupplyStatus.1.1 ok IDRAC-MIB-SMIv2::powerSupplyOutputWatts.1.1 7500 IDRAC-MIB-SMIv2::powerSupplyInputVoltage.1.1 264 IDRAC-MIB-SMIv2::powerSupplyRatedInputWattage.1.1 9000 IDRAC-MIB-SMIv2::amperageProbeReading.1.1 4 /etc/nagios/conf.d$ snmpget 10.x.x.x -O q -v 2c -c public powerSupplyIndex.1.2 powerSupplyStatus.1.2 powerSupplyOutputWatts.1.2 powerSupplyInputVoltage.1.2 powerSupplyRatedInputWattage.1.2 amperageProbeReading.1.2 -m ALL IDRAC-MIB-SMIv2::powerSupplyIndex.1.2 2 IDRAC-MIB-SMIv2::powerSupplyStatus.1.2 critical IDRAC-MIB-SMIv2::powerSupplyOutputWatts.1.2 7500 IDRAC-MIB-SMIv2::powerSupplyInputVoltage.1.2 264 IDRAC-MIB-SMIv2::powerSupplyRatedInputWattage.1.2 9000 IDRAC-MIB-SMIv2::amperageProbeReading.1.2 No Such Instance currently exists at this OID

As you see, the information for this device is present, the "No Such Instance..." is only present for the amperage reading. The powerSupplyStatus is there. Since the script trap "No Such Instance..." globally, it generate an error. (In that case, the amperage reading should be ignored)

Suppose the power is removed accidentaly, you need to know that the server is in a critical state to take action.

Regards,
Mike

@dangmocrang
Copy link
Owner

Ok i will check script logic later, i'm on rush for another task. Thanks
for your ideal.
On Jan 20, 2016 8:53 PM, "mikehubert4012" notifications@github.com wrote:

The problem is that when you call the snmpwalk manually from the snmp_cli
string (see the request and answer for PS#1 and PS#2 below)

/etc/nagios/conf.d$ snmpget 10.x.x.x -O q -v 2c -c public
powerSupplyIndex.1.1 powerSupplyStatus.1.1 powerSupplyOutputWatts.1.1
powerSupplyInputVoltage.1.1 powerSupplyRatedInputWattage.1.1
amperageProbeReading.1.1 -m ALL
IDRAC-MIB-SMIv2::powerSupplyIndex.1.1 1
IDRAC-MIB-SMIv2::powerSupplyStatus.1.1 ok
IDRAC-MIB-SMIv2::powerSupplyOutputWatts.1.1 7500
IDRAC-MIB-SMIv2::powerSupplyInputVoltage.1.1 264
IDRAC-MIB-SMIv2::powerSupplyRatedInputWattage.1.1 9000
IDRAC-MIB-SMIv2::amperageProbeReading.1.1 4

/etc/nagios/conf.d$ snmpget 10.x.x.x -O q -v 2c -c public
powerSupplyIndex.1.2 powerSupplyStatus.1.2 powerSupplyOutputWatts.1.2
powerSupplyInputVoltage.1.2 powerSupplyRatedInputWattage.1.2
amperageProbeReading.1.2 -m ALL
IDRAC-MIB-SMIv2::powerSupplyIndex.1.2 2
IDRAC-MIB-SMIv2::powerSupplyStatus.1.2 critical
IDRAC-MIB-SMIv2::powerSupplyOutputWatts.1.2 7500
IDRAC-MIB-SMIv2::powerSupplyInputVoltage.1.2 264
IDRAC-MIB-SMIv2::powerSupplyRatedInputWattage.1.2 9000
IDRAC-MIB-SMIv2::amperageProbeReading.1.2 No Such Instance currently
exists at this OID

As you see, the information for this device is present, the "No Such
Instance..." is only present for the amperage reading. The
powerSupplyStatus is there. Since the script trap "No Such Instance..."
globally, it generate an error.

Suppose the power is removed accidentaly, you need to know that the server
is in a critical state to take action.

Regards,
Mike


Reply to this email directly or view it on GitHub
#19 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants