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

check_snmp_mem: Argument isn't numeric on RedHat variants #9

Open
abaldoni opened this issue Jul 30, 2014 · 2 comments
Open

check_snmp_mem: Argument isn't numeric on RedHat variants #9

abaldoni opened this issue Jul 30, 2014 · 2 comments

Comments

@abaldoni
Copy link

On Linux systems using a RedHat variant with net-snmp as the default snmpd provider with UCD MIBS, the check_snmp_mem.pl command reports the following errors:
Argument "95923184 kB" isn't numeric in numeric eq (==) at ./check_snmp_mem.pl line 118.

I suggest changing the regexp in do_snmp from
if ($x =~ /([a-zA-Z0-9]+): (.*)$/) {
to
if ($x =~ /([a-zA-Z0-9]+): ([0-9]+)[ ]?(kB)?$/) {

@dooblem
Copy link

dooblem commented Sep 23, 2014

Same on Ubuntu ! @abaldoni patch works like a charm. It also fixes perfdata for pnp4nagios.

Please fix it...

Before:

# /var/lib/shinken/libexec/check_snmp_mem.pl.orig -w 80 -c 95 -- -v 2c -c public XXXX
Argument "1019080 kB" isn't numeric in numeric eq (==) at /var/lib/shinken/libexec/check_snmp_mem.pl.orig line 118.
Argument "84928 kB" isn't numeric in subtraction (-) at /var/lib/shinken/libexec/check_snmp_mem.pl.orig line 127.
Argument "457200 kB" isn't numeric in subtraction (-) at /var/lib/shinken/libexec/check_snmp_mem.pl.orig line 129.
Argument "186880 kB" isn't numeric in subtraction (-) at /var/lib/shinken/libexec/check_snmp_mem.pl.orig line 129.
MEMORY OK: 28.46 % used; Free => 84928 kB Kb, Total => 1019080 kB Kb, Cached => 186880 kB Kb, Buffered => 457200 kB Kb|ram_free=84928 kB ram_total=1019080 kB ram_cached=186880 kB ram_buffered=457200 kB

After:

# /var/lib/shinken/libexec/check_snmp_mem.pl -w 80 -c 95 -- -v 2c -c public XXXX
MEMORY OK: 28.42 % used; Free => 87216 Kb, Total => 1019080 Kb, Cached => 185756 Kb, Buffered => 456480 Kb|ram_free=87216 ram_total=1019080 ram_cached=185756 ram_buffered=456480

@Olivier4murs
Copy link

Same for me with Shinken. Please merge this fix !

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

3 participants