SNMP Traps Not Trapping
Greetings. I am new to the product and in evaluation period.
I have configured serverscheck to monitor SNMPTRAP, but it appears to be not working. Here is my configuration of the trap.
Allowed IP Range: *.*.*.*
community: public
Generic ID : All
OID: *
OID Type: text
OID value: ignore value
When trap matches...: DOWN
I also created another rule with OID Type: integer
ServersCheck is running on Win2003 Server.
SNMP Service is running.
SNMP Trap Service is running.
netstat -na shows snmptrap.exe listening on port 162.
I know that traps are indeed being sent to this host as I momentarily stopped all services and ran a different SNMPTrapper, and it reported the traps. I then re-enabled the SNMP services.
When I send traps to ServersCheck host, I see no indication of them being received or processed.
I have configured serverscheck to monitor SNMPTRAP, but it appears to be not working. Here is my configuration of the trap.
Allowed IP Range: *.*.*.*
community: public
Generic ID : All
OID: *
OID Type: text
OID value: ignore value
When trap matches...: DOWN
I also created another rule with OID Type: integer
ServersCheck is running on Win2003 Server.
SNMP Service is running.
SNMP Trap Service is running.
netstat -na shows snmptrap.exe listening on port 162.
I know that traps are indeed being sent to this host as I momentarily stopped all services and ran a different SNMPTrapper, and it reported the traps. I then re-enabled the SNMP services.
When I send traps to ServersCheck host, I see no indication of them being received or processed.
This discussion has been closed.
Comments
ServersCheck comes with its own SNMP Trap listener: monitoring_snmptrap.exe
After you defined it, restart the ServersCheck Monitoring service
In your process list (task manager) you should see the monitoring_snmptrap.exe running and a netstat -na should provide the same result.
I then restarted ServersCheck Monitoring Service.
I can confirm that UDP port 162 is now owned by monitoring_snmptrap.exe*32.
I still cannot see any indication that the trap was received or processed. I am looking at the Dashboard - All Rules View.
What next?
1/ kill the monitoring_snmptrap.exe process
2/ open command window
3/ go to main serverscheck directory
4/ in there type following command
monitoring_snmptrap.exe > debuglog.txt
It takes a minute to initialize, after that fire some traps and press CTRL+C to stop the process. Open the debuglog.txt file and in there you will see the traps that have been received
Ensure that there is no local firewall blocking incoming UDP messages.
I see this message as soon as I send the trap:
Thread 1 terminated abnormally: Bad arg length for Socket::inet_ntoa, length is
0, should be 4 at monitoring_snmptrap.pl line 1259.
After which there is no more visible logging from the application, regardless of how many traps are sent. I repeated this test several times.
Maybe the sending application has a poorly formed SNMP message? I will generate a wireshark trace. Do you want me to send it somewhere?
Hold on for 30 minutes
http://files.serverscheck.net/fixes/monitoring_snmptrap.zip
UPDATE:
It will still fail but at least it will show some debugging info just before failing allowing us to have some more data. It might be related to the fact that the sender data in the SNMP is not correct.
# Mon Oct 29 17:17:12 2007 trap received from - - 1.3.6.1.2.1.1.3.0|151970572|
|1.3.6.1.6.3.1.1.4.1.0|1.3.6.1.4.1.8008.2.2.5||1.3.6.1.4.1.8008.2.2.5|test test
test||
Thread 1 terminated abnormally: Bad arg length for Socket::inet_ntoa, length is
0, should be 4 at monitoring_snmptrap.pl line 1261.
# Mon Oct 29 17:17:13 2007 trap ignored for 1193682700SNMPTRAP; no match for com
munity and public
# Mon Oct 29 17:17:13 2007 trap ignored for 1193683655SNMPTRAP; no match for com
munity and public
# Mon Oct 29 17:17:13 2007 trap 0 removed - match result: 0
In your settings remove the community: Public (so make it empty).
Repeat above and then it should have a match resulting in an alert.
1/ open the serverscheck.conf file in the /conf subdirectory with notepad
2/ find the line starting with SNMPTRAP and in there remove the public value
I restarted only monitoring_snmptrap.exe.
I sent the same trap, and got the what looks like the same error, but with one more useful log line (maybe I didn't see it earlier):
# Mon Oct 29 18:17:19 2007 trap received from - - 1.3.6.1.2.1.1.3.0|152331222|
|1.3.6.1.6.3.1.1.4.1.0|1.3.6.1.4.1.8008.2.2.5||1.3.6.1.4.1.8008.2.2.5|test test
test||
Thread 1 terminated abnormally: Bad arg length for Socket::inet_ntoa, length is
0, should be 4 at monitoring_snmptrap.pl line 1261.
Try again with this update:
http://files.serverscheck.net/fixes/monitoring_snmptrap.zip
Also, to avoid browser cache, I tired downloading from a different (fresh) PC and got the same results.
Was there a typo?
http://files.serverscheck.net/fixes/monitoring_snmptrap.zip
I ran it in console.
It handled one trap, and then no more after that.
Here is the output from the console.
# Thu Nov 1 15:22:14 2007 trap received from - - 1.3.6.1.2.1.1.3.0|177199965|
|1.3.6.1.6.3.1.1.4.1.0|1.3.6.1.4.1.8008.2.2.5||1.3.6.1.4.1.8008.2.2.5|test test
test||
Thread 1 terminated abnormally: Bad arg length for Socket::inet_ntoa, length is
0, should be 4 at monitoring_snmptrap.pl line 1261.
# Thu Nov 1 15:22:15 2007 trap / oid ignored for 1193682700SNMPTRAP; no match f
or oid id 1.3.6.1.2.1.1.3.0 and
# Thu Nov 1 15:22:15 2007 trap / oid ignored for 1193682700SNMPTRAP; no match f
or oid id 1.3.6.1.6.3.1.1.4.1.0 and
# Thu Nov 1 15:22:15 2007 trap / oid ignored for 1193682700SNMPTRAP; no match f
or oid id 1.3.6.1.4.1.8008.2.2.5 and
# Thu Nov 1 15:22:15 2007 trap / oid ignored for 1193683655SNMPTRAP; no match f
or oid id 1.3.6.1.2.1.1.3.0 and
# Thu Nov 1 15:22:15 2007 trap / oid ignored for 1193683655SNMPTRAP; no match f
or oid id 1.3.6.1.6.3.1.1.4.1.0 and
# Thu Nov 1 15:22:15 2007 trap / oid ignored for 1193683655SNMPTRAP; no match f
or oid id 1.3.6.1.4.1.8008.2.2.5 and
# Thu Nov 1 15:22:15 2007 trap 0 removed - match result: 0
On closer inspection the browser downloaded an old version of the zip. I have downloaded a fresh copy of the zip file and i'm evaluating it now.
I am currently running both monitoring_manager and monitoring_snmptrap now as console apps.
Why do I not trigger any of the rules (described early in the thread, above) ? I thought that I had configured the rule to go DOWN on any value for text or numeric.
Output:
# Thu Nov 1 15:39:30 2007 trap received from 0.0.0.0 - - 1.3.6.1.2.1.1.3.0|177303560||1.3.6.1.6.3.1.1.4.1.0|1.3.6.1.4.
1.8008.2.2.5||1.3.6.1.4.1.8008.2.2.5|test test test||
# Thu Nov 1 15:39:31 2007 trap / oid ignored for 1193682700SNMPTRAP; no match for oid id 1.3.6.1.2.1.1.3.0 and
# Thu Nov 1 15:39:31 2007 trap / oid ignored for 1193682700SNMPTRAP; no match for oid id 1.3.6.1.6.3.1.1.4.1.0 and
# Thu Nov 1 15:39:31 2007 trap / oid ignored for 1193682700SNMPTRAP; no match for oid id 1.3.6.1.4.1.8008.2.2.5 and
# Thu Nov 1 15:39:31 2007 trap / oid ignored for 1193683655SNMPTRAP; no match for oid id 1.3.6.1.2.1.1.3.0 and
# Thu Nov 1 15:39:31 2007 trap / oid ignored for 1193683655SNMPTRAP; no match for oid id 1.3.6.1.6.3.1.1.4.1.0 and
# Thu Nov 1 15:39:31 2007 trap / oid ignored for 1193683655SNMPTRAP; no match for oid id 1.3.6.1.4.1.8008.2.2.5 and
# Thu Nov 1 15:39:31 2007 trap 3 removed - match result: 0
This has been solved.
You can download it from following url:
http://files.serverscheck.net/fixes/monitoring_snmptrap.zip