UDP port 162 is taken by sh and python

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: UDP port 162 is taken by sh and python

Post 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?
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.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: UDP port 162 is taken by sh and python

Post 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.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: UDP port 162 is taken by sh and python

Post 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.
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: UDP port 162 is taken by sh and python

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: UDP port 162 is taken by sh and python

Post by lmiltchev »

phyo, have you tried the script posted by questrad? Let us know if this fixed your issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: UDP port 162 is taken by sh and python

Post 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.
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: UDP port 162 is taken by sh and python

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: UDP port 162 is taken by sh and python

Post by tgriep »

Let us know how this works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: UDP port 162 is taken by sh and python

Post by phyo »

tgriep wrote:Let us know how this works for you.
After changing the script file, so far it is working well.
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: UDP port 162 is taken by sh and python

Post 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.
Locked