Sending and receiving a test trap
-
thennessey
- Posts: 13
- Joined: Tue Feb 05, 2013 10:33 am
Sending and receiving a test trap
How can I send a test trap from a windows machine and verify on Nagios that it was received?
I have run tcpdump and saw when I stopped and started the snmp service on the windows machine that nagios received traps about that. Does that mean everything is working?
How can I simulate something going wrong on the windows server and get nagios to notify me from the trap and not just from nagios doing it's regularly scheduled monitoring? And how do I know it resulted from the trap and not monitoring?
thanks
I have run tcpdump and saw when I stopped and started the snmp service on the windows machine that nagios received traps about that. Does that mean everything is working?
How can I simulate something going wrong on the windows server and get nagios to notify me from the trap and not just from nagios doing it's regularly scheduled monitoring? And how do I know it resulted from the trap and not monitoring?
thanks
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Sending and receiving a test trap
Have you taken a look at Implimenting Snmp Traps in Nagios XI
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
-
thennessey
- Posts: 13
- Joined: Tue Feb 05, 2013 10:33 am
Re: Sending and receiving a test trap
Yes many times. I changed the "Normal" to "Critical" for all events in the snmptt.conf file, and then stopped snmp on the windows server. All that happened was the traps service for all my devices in Nagios said "pending."
I read some other guide that said if you turn off snmp on the windows server and then wait for the services in nagios to come back with failures, then turn snmp back on....the windows server will send out a trap and you will see that in nagios before the other services return to normal. I didn't see anything like that.
So how do I make the server send out a trap that will be received by nagios and notify me something is wrong? Or at least show me something in the nagios gui?
I read some other guide that said if you turn off snmp on the windows server and then wait for the services in nagios to come back with failures, then turn snmp back on....the windows server will send out a trap and you will see that in nagios before the other services return to normal. I didn't see anything like that.
So how do I make the server send out a trap that will be received by nagios and notify me something is wrong? Or at least show me something in the nagios gui?
Re: Sending and receiving a test trap
I found this link - I hope it will help you set up traps on the windows machine. On the nagios site - did you run the SNMP Trap Monitoring Wizard against your windows box?
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
thennessey
- Posts: 13
- Joined: Tue Feb 05, 2013 10:33 am
Re: Sending and receiving a test trap
This looks like it might work. I set windows to send a trap whenever a service is started or stopped. I see net-snmp is already installed on Nagios and I can run it. The guide doesn't have much info on what commands I use for snmptrap. Can you help me with this. The help file is pretty hard to understand. Thanks!
Re: Sending and receiving a test trap
Microsoft has some documentation on sending traps from a windows system:
http://technet.microsoft.com/en-us/libr ... 06050.aspx
In XI, you configure the traps through the wizard. What part of the guide are you having problems with?
http://technet.microsoft.com/en-us/libr ... 06050.aspx
In XI, you configure the traps through the wizard. What part of the guide are you having problems with?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
thennessey
- Posts: 13
- Joined: Tue Feb 05, 2013 10:33 am
Re: Sending and receiving a test trap
I've configured traps through the wizard. The traps services is running on all my hosts in Nagios. It says "waiting for traps".
Per the previous guide in this thread, I set one of my windows hosts to send a trap whenever a service is started or stopped. However, when I start or stop a service, nothing shows up in Nagios. A trap should be sent to Nagios and I should be able to see it there. Where? Shouldn't I get a note, warning, alert, or something from the nagios trap service?
I tried using the snmptrap or snmptrapd utility in Nagios command line but I can't get it to work. Can you give me an example command to use snmptrap to monitor for incoming traps?
snmptrap -v 1 -c communitystring enterprise-oid? agent? (is this the agent to listen for or can I listen for all?) trap type? specific type uptime? OID-type-value? Can I listen for all incoming OID's?
Thanks
Per the previous guide in this thread, I set one of my windows hosts to send a trap whenever a service is started or stopped. However, when I start or stop a service, nothing shows up in Nagios. A trap should be sent to Nagios and I should be able to see it there. Where? Shouldn't I get a note, warning, alert, or something from the nagios trap service?
I tried using the snmptrap or snmptrapd utility in Nagios command line but I can't get it to work. Can you give me an example command to use snmptrap to monitor for incoming traps?
snmptrap -v 1 -c communitystring enterprise-oid? agent? (is this the agent to listen for or can I listen for all?) trap type? specific type uptime? OID-type-value? Can I listen for all incoming OID's?
Thanks
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Sending and receiving a test trap
In the Implimenting Snmp Traps in Nagios XI guide page 6 & 7 show how to test the traps.
Also, can you run the following:
Also, can you run the following:
Code: Select all
ll /var/log/snmptt/-
thennessey
- Posts: 13
- Joined: Tue Feb 05, 2013 10:33 am
Re: Sending and receiving a test trap
How do I change the nagios community string if I don't want to use public? I assume it's in snmpd.conf somewhere.
Can I just change "public" to the string I want in this code?
# First, map the community name "public" into a "security name"
# sec.name source community
com2sec notConfigUser default public
Is anything else needed to change the community string besides that, and maybe verifying config and restart?
Can I just change "public" to the string I want in this code?
# First, map the community name "public" into a "security name"
# sec.name source community
com2sec notConfigUser default public
Is anything else needed to change the community string besides that, and maybe verifying config and restart?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact: