Page 1 of 1
snmptt status and actions
Posted: Thu Nov 12, 2015 4:14 am
by murawweh.daher
Hi All,
i did upgrade today to Nagios from 2014R2.7 to latest 5.2.1.
i tried to test restart all services (nagios, snmptt, snmptrap, mysql) and i see the below for snmptt.
your advice please.
/etc/init.d/snmptt stop
Stopping snmptt: [FAILED]
/etc/init.d/snmptt status
snmptt is stopped
Re: snmptt status and actions
Posted: Thu Nov 12, 2015 10:10 am
by hsmith
Can you try to start it and see what happens? If you tried to stop it when it wasn't running, it'll do that.
Re: snmptt status and actions
Posted: Tue Nov 17, 2015 2:04 am
by murawweh.daher
When i start it it working fine first attempt
When i run service stop, it stop from first or second time.
Re: snmptt status and actions
Posted: Tue Nov 17, 2015 10:12 am
by hsmith
Can you post the output of what happens when you try to stop the service?
Re: snmptt status and actions
Posted: Tue Nov 17, 2015 1:53 pm
by gormank
I've seen this as well. As I recall it was found that changing the SNMP config win Nagios caused SNMPTT to need a restart. The solution (offered by support I think) was to restart SNMPTT when a reconfig was run. This was done by adding the restart at the end of the start section of the Nagios init script just before the done line.
# grep -i snmptt /etc/init.d/nagios
/etc/init.d/snmptt restart
Re: snmptt status and actions
Posted: Tue Nov 17, 2015 1:59 pm
by rkennedy
Thanks
@gormank! Let us know if this works for you.
Re: snmptt status and actions
Posted: Wed Nov 18, 2015 1:14 am
by murawweh.daher
Thanx gormank, restart by using (/etc/init.d/snmptt restart) working fine.
no output for (# grep -i snmptt /etc/init.d/nagios)
Re: snmptt status and actions
Posted: Wed Nov 18, 2015 11:10 am
by rkennedy
I believe what @gormank meant was to modify your nagios init script at
/etc/init.d/nagios by modifying the following.
Look for -
Code: Select all
echo " done."
;;
stop)
echo -n "Stopping nagios:"
above the
echo " done." line, add -
The final result will look like -
Code: Select all
/etc/init.d/snmptt restart
echo " done."
;;
stop)
echo -n "Stopping nagios:"
This will cause the snmptt service to restart every time nagios is restarted.
Re: snmptt status and actions
Posted: Wed Nov 18, 2015 12:09 pm
by gormank
I think that's a more verbose way of saying what I said...
Since this solution was provided by Nagios and is long known, why not add an if statement (in case snmptt isn't used) to the init script to restart the service rather than rediscovering the solution periodically. I think a search of the board will show this has happened several times.
Re: snmptt status and actions
Posted: Wed Nov 18, 2015 2:41 pm
by rkennedy
Your post was straight to the point, but I wanted to outline it for anyone that was confused should this get indexed.
I will discuss it with the developers and see what they say.