Page 1 of 2

snmp traps

Posted: Sun Jun 08, 2014 12:59 am
by hanya.radwan
most snmp traps services aren't working as before(before upgrade to 2014 R1.0)
one snmp service at nagios 2014 R1.0 returns the following error:
External command error: Bad SIZE syntax (OCTETSTRING): At line 203 in /usr/share/snmp/mibs/HPOV-NNM.txt
Bad parse of OBJECT-TYPE: At line 203 in /usr/share/snmp/mibs/HPOV-NNM.txt
Did not find 'openViewSeverity' in module HPOV-NNM-MIB (/usr/share/snmp/mibs/ALCATEL-NMC-PROXY-AGENT-MIB.txt)
Timeout: No Response from 10.202.6.23:161.

and from test command, it gives the following error:
COMMAND: /usr/local/nagios/libexec/check_snmp -H 10.202.6.23 -P 2c -C public -o numberOfSessions.6 -u sessions --rate --rate-multiplier 300 -w 5: -c 1:
OUTPUT: Cannot create temporary filename

and from server returns the following:
[root@nms ~]# /usr/local/nagios/libexec/check_snmp -H 10.202.6.23 -P 2c -C public -o numberOfSessions.6 -u sessions --rate --rate-multiplier 300 -w 5: -c 1:
SNMP RATE CRITICAL - *0.3734827264* sessions | GLENAYRE-ILSP2-ASU-ALARMS-MIB::numberOfSessions.6=0.3734827264sessions;0;0;

Re: snmp traps

Posted: Mon Jun 09, 2014 9:11 am
by slansing
Looks like what I suspected, check_snmp does not have permissions to write to the directory where it will keep it's temp check files. Can you try running that command as root? Did you change the directory where that plugin places those files?:


http://comments.gmane.org/gmane.network ... ugins/5125

It appears to happen specifically with --rate.

Code: Select all

/usr/local/nagios/libexec/check_snmp -H 10.202.6.23 -P 2c -C public -o numberOfSessions.6 -u sessions --rate --rate-multiplier 300 -w 5: -c 1

Re: snmp traps

Posted: Mon Jun 09, 2014 12:29 pm
by hanya.radwan
the command gives the following:
[root@nms ~]# /usr/local/nagios/libexec/check_snmp -H 10.202.6.23 -P 2c -C public -o numberOfSessions.6 -u sessions --rate --rate-multiplier 300 -w 5: -c 1
SNMP RATE CRITICAL - *9.230769231* sessions | GLENAYRE-ILSP2-ASU-ALARMS-MIB::numberOfSessions.6=9.230769231sessions;0;1;

Re: snmp traps

Posted: Mon Jun 09, 2014 12:40 pm
by hanya.radwan
this folder already exit
[root@nms ~]# cd /usr/local/nagios/var/check_snmp/
[root@nms check_snmp]# ls
090807575257bb1dfbcd7cec6488d5eb71f09f15 65a1d36206f3776e19e3acce247344b76ea06ed6 b8ee451dc7181fcd18a1ce641dd3469ddba20e06
09f25ec8d66ee2729f1a1cd7aaf5e1f19ee97358 6721d919781777be47b01313812a755d5a637787 b9889ba04f68fb523ada0014b1317025986a8287
0d98923a74b5f6f749d85f291add56abb484089d 6c9d40a4230d5a0d7ce8744c5681ca7d13a6782b b999804c3fa889eeb558cd12fd84bb93fc52d4c7
17067aee5a3d60a54c66b2e44e4036a41892063f 74abd36187997cffe439b32fe09aaf5e28790ce2 ba70938b68691e93c3cc36a34810fb406730ac06

Re: snmp traps

Posted: Mon Jun 09, 2014 12:49 pm
by hanya.radwan
also check_snmp has the following permission

[root@nms ~]# ll -d /usr/local/nagios/var/check_snmp
drwx------ 2 nagios nagios 4096 Jun 9 20:48 /usr/local/nagios/var/check_snmp

Re: snmp traps

Posted: Mon Jun 09, 2014 1:05 pm
by sreinhardt
The with those permissions, the apache user, which is part of the nagios group would never be able to create or modify files in that directory. Try the following:

Code: Select all

rm -rf /usr/local/nagios/var/check_snmp/*
chmod ug+rw -R /usr/local/nagios/var/check_snmp/
Now both apache(test command button) and nagios core can add\modify\remove files in that directory.

Re: snmp traps

Posted: Mon Jun 09, 2014 1:13 pm
by hanya.radwan
i did the command and the permissions becomes as the following:

[root@nms ~]# ll -d /usr/local/nagios/var/check_snmp
drwxrw---- 2 nagios nagios 4096 Jun 9 21:12 /usr/local/nagios/var/check_snmp

Re: snmp traps

Posted: Mon Jun 09, 2014 1:47 pm
by sreinhardt
That looks much better. Are you able to successfully run the command from nagios core now? Preferably by letting it be scheduled or by running an immediate check and not via the test command button?

Re: snmp traps

Posted: Tue Jun 10, 2014 4:15 am
by hanya.radwan
the same error:
[root@nms ~]# /usr/local/nagios/libexec/check_snmp -H 10.202.6.23 -P 2c -C public -o numberOfSessions.6 -u sessions --rate --rate-multiplier 300 -w 5: -c 1
SNMP RATE WARNING - *0.0797089601* sessions | GLENAYRE-ILSP2-ASU-ALARMS-MIB::numberOfSessions.6=0.0797089601sessions;0;1;

COMMAND: /usr/local/nagios/libexec/check_snmp -H 10.202.6.23 -P 2c -C public -o numberOfSessions.6 -u sessions --rate --rate-multiplier 300 -w 5: -c 1:
OUTPUT: Cannot create temporary filename

from nagiosxi:
External command error: Bad SIZE syntax (OCTETSTRING): At line 203 in /usr/share/snmp/mibs/HPOV-NNM.txt
Bad parse of OBJECT-TYPE: At line 203 in /usr/share/snmp/mibs/HPOV-NNM.txt
Did not find 'openViewSeverity' in module HPOV-NNM-MIB (/usr/share/snmp/mibs/ALCATEL-NMC-PROXY-AGENT-MIB.txt)
Timeout: No Response from 10.202.6.23:161.

Re: snmp traps

Posted: Tue Jun 10, 2014 1:30 pm
by sreinhardt
COMMAND: /usr/local/nagios/libexec/check_snmp -H 10.202.6.23 -P 2c -C public -o numberOfSessions.6 -u sessions --rate --rate-multiplier 300 -w 5: -c 1:
OUTPUT: Cannot create temporary filename
Again, please do not use the test command button, this is run via the apache user and will often have issues overwriting files created by the nagios and root users, as it is now.
the same error:
[root@nms ~]# /usr/local/nagios/libexec/check_snmp -H 10.202.6.23 -P 2c -C public -o numberOfSessions.6 -u sessions --rate --rate-multiplier 300 -w 5: -c 1
SNMP RATE WARNING - *0.0797089601* sessions | GLENAYRE-ILSP2-ASU-ALARMS-MIB::numberOfSessions.6=0.0797089601sessions;0;1;

from nagiosxi:
External command error: Bad SIZE syntax (OCTETSTRING): At line 203 in /usr/share/snmp/mibs/HPOV-NNM.txt
Bad parse of OBJECT-TYPE: At line 203 in /usr/share/snmp/mibs/HPOV-NNM.txt
Did not find 'openViewSeverity' in module HPOV-NNM-MIB (/usr/share/snmp/mibs/ALCATEL-NMC-PROXY-AGENT-MIB.txt)
Timeout: No Response from 10.202.6.23:161.
As for these, the response should be identical between cli and running from the XI interface. Just to confirm, these are from the same system? I also note that your first command returns proper results, however the second times out due to the system not responding, this is very indicitive of either differing systems when running the command or network issues. Please try the following command.

Code: Select all

cd /usr/local/nagios/libexec
su - nagios ./check_snmp -H 10.202.6.23 -P 2c -C public -o numberOfSessions.6 -u sessions --rate --rate-multiplier 300 -w 5: -c 1:
OUTPUT: Cannot create temporary filename