Check HPE ProCurve

Hi Icinga Community,

I’m new here and tried to modify an existing check to monitor HPE switches.
Hopefully someone can help me solve the problem or give me hints.
Problem:

  • SNMP OID works with Paessler SNMP Tester
  • in icinga the check indicates that there is no OID.

to my project

Thank you in advance!

Hi,

try it the manual way - run snmpwalk/snmpget on the CLI and check whether the OIDs are available. It may be a permission or protocol problem too.

snmpwalk -v2c -c public localhost .1.3.6.1.2.1.47.1.1.1.1.2.1

Cheers,
Michael

1 Like

Hi Michael,

thanks!

snmpwalk -v2c -c public IP-address .1.3.6.1.2.1.47.1.1.1.1.2.1

I just tested it and with this command it works. But I don’t understand why the check isnt working?

greets Manuel

Hi,

the plugin’s code is hard to read, I would start investigating in this line …

if (!defined($s->get_request($oid_systype))) {

And add more verbose logging, e.g.

use Data::Dumper;

print Dumper($s);

for connection tests, likewise read the docs for get_request().

Also, you didn’t show how you call the plugin on the CLi, please add that.

Cheers,
Michael

1 Like

“if it was hard to write, then it should also be hard to read” :smiley:
Jokes aside, it’s my first code… still have to learn a lot :slight_smile:

To test, I call the plugin with this CLi command:

root@icinga:/usr/local/nagios/libexec# ./check_hpe_procurve.pl -H IP-address -C public

output:

WARNING - SNMP OID CPU LOAD does not exist|

planned output:

OK - HP JXXX Switch - CPU LOAD: x% - MEMORY: x bytes FREE - FAN STATUS: x - PSU1 STATUS: x - PSU2 STATUS: x - TEMP STATUS: x - SYS TEMP: x °C -

Thanks, I will take a closer look at the docs.

greets Manuel

Hi,

I’m used to several Perl styles, and have adopted one for the manubulon plugins with perltidy, you might want to have a look at this. Your style isn’t bad at all, just needs some more formatting love :slight_smile:

One thing which differs to the snmpwalk plugin is the protocol. The argument parser allows to specify the version, but sets this to 2 if not given. Try the exact plugin call as you would do from the snmpwalk.
https://github.com/42bios/check_hpe_procurve.pl/blob/master/check_hpe_procurve.pl#L492

Also, don’t test as root but as the icinga user.

sudo -u icinga /usr/local/nagios/libexec/check_hpe_procurve.pl -H IP-address -C public --version 2c

Cheers,
Michael

Hi Michael,

many thanks for the input! :slight_smile: