Page 2 of 3
Re: UDP port 162 is taken by sh and python
Posted: Fri Feb 13, 2015 10:40 am
by abrist
I believe there also was a bug in the older nagios init script that would cause the command file to be removed and not recreated it you tried to start the nagios processes while it was already running.
What version of XI are you running?
Re: UDP port 162 is taken by sh and python
Posted: Sun Feb 15, 2015 9:21 pm
by phyo
questrad wrote:Question - that 4 days ago, did you restart your Nagios XI?
I mean did you stop everything and started it again?
If yes - then there is bug in snmptraphandling, which tries to write in to cmd file (pipe file) but file is not exist any more when you stop the nagios and python is stuck on that step.
Attached is my modified trap handler python script.
Stop everything means snmptarpd, sh, python and snmptt?
I found that issued on Jan 27. Then I killed all those services and restart snmptt and snmptrapd services.
After that I found this issue on Feb 12. I run the command that tmcdonald. After that I killed all and restart snmptt and snmptrapd services.
But Last week friday ( 13 Feb 2015), I restarted snmptt and snmptrapd because i have changed some of the /etc/snmp/snmptt.conf file.
Should I replaced your attached snmptraphandling.py with current one?
Thanks.
Re: UDP port 162 is taken by sh and python
Posted: Sun Feb 15, 2015 9:22 pm
by phyo
abrist wrote:I believe there also was a bug in the older nagios init script that would cause the command file to be removed and not recreated it you tried to start the nagios processes while it was already running.
What version of XI are you running?
We are using Nagios XI 2014R1.0 and we can't upgrade to latest version because of maintenance license expired.
Thanks.
Re: UDP port 162 is taken by sh and python
Posted: Mon Feb 16, 2015 1:35 am
by questrad
Before replacing just make sure that my script is fine for your current configuration, it was 2 year ago that I made changes and I dont remember - did I some other changes else or not related to our configuration.
Just before replacing, make copy of your current one and do some test - if it is OK, and you continue receiving snmp traps without interruption - go ahead with changes.
Re: UDP port 162 is taken by sh and python
Posted: Mon Feb 16, 2015 9:38 am
by lmiltchev
phyo, have you tried the script posted by questrad? Let us know if this fixed your issue.
Re: UDP port 162 is taken by sh and python
Posted: Mon Feb 16, 2015 8:09 pm
by phyo
lmiltchev wrote:phyo, have you tried the script posted by questrad? Let us know if this fixed your issue.
I will try to replace with the file posted by questrad. I will post back after monitoring a few days.
Re: UDP port 162 is taken by sh and python
Posted: Mon Feb 16, 2015 9:27 pm
by questrad
You need just on the time when you sending snmp traps to Nagios, do restart of Nagios Core or NagiosXI or apply configuration or executed backup.
Dont send just one trap, send many traps (test traps of course) on that time.
Do test before changing the script and after.
Thanks
Re: UDP port 162 is taken by sh and python
Posted: Tue Feb 17, 2015 11:02 am
by tgriep
Let us know how this works for you.
Re: UDP port 162 is taken by sh and python
Posted: Sun Mar 01, 2015 9:21 pm
by phyo
tgriep wrote:Let us know how this works for you.
After changing the script file, so far it is working well.
Re: UDP port 162 is taken by sh and python
Posted: Mon Mar 02, 2015 9:55 am
by cmerchant
phyo, that is good to hear that you have you tried the script. Let us know if the issue is fixed and that we can close this thread. Thanks.