Page 1 of 1
switch in scheduled downtime generates cron failure messages
Posted: Mon Jun 22, 2015 7:00 am
by manymiles
I have a switch in Scheduled Downtime.
However, every 5 minutes, an email message to root is generated complaining about no SNMP response.
Code: Select all
SNMP Error:
no response received
SNMPv2c_Session (remote host: "w.x.y.z" [w.x.y.z].161)
...
I imagine I can suffix the cron job with
but, that might be too draconian?
How should I handle?
Re: switch in scheduled downtime generates cron failure mess
Posted: Mon Jun 22, 2015 11:48 am
by jdalrymple
The problem is that MRTG is still trying to run. The E-mails to root should largely be aesthetic unless you're handling them or relying on them for some other purpose. Nothing should show up in the XI interface.
There isn't going to be a good way to put a single switch/router into maintenance mode because they're all handled with the one line in /etc/cront.d/mrtg - changing that line in any way will affect all of your switches and routers.
Re: switch in scheduled downtime generates cron failure mess
Posted: Tue Jun 23, 2015 3:17 pm
by manymiles
Thanks for the response.
What do you think about moving /etc/mrtg/conf.d/ip-in-question.cfg outside of /etc/mrtg/conf.d temporarily and then restoring it when downtime is over?
My problem is that adding or changing a 24 port switch with the wizard is great, except if you have custom templates to apply to each service. I end up manually changing 48 services, which is an awful lot of clicking.
I know the wizard makes the mrtg config, but I'm not sure the implications of removing and re-injecting an mrtg config file at the file system level (outside of the Nagios XI web GUI).
Re: switch in scheduled downtime generates cron failure mess
Posted: Tue Jun 23, 2015 4:51 pm
by abrist
You can either edit the MAILTO= option on your crons, or suffice the mrtg cron with:
e.g:
Code: Select all
*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok >/dev/null 2>&1
Re: switch in scheduled downtime generates cron failure mess
Posted: Wed Jun 24, 2015 5:33 am
by manymiles
Thanks, abrist.
I went with the
solution.
I was considering that, but, I didn't know its implications in regards to Nagios.
Re: switch in scheduled downtime generates cron failure mess
Posted: Wed Jun 24, 2015 8:33 am
by tmcdonald
Are we all set to close this topic?
Re: switch in scheduled downtime generates cron failure mess
Posted: Mon Dec 28, 2015 11:42 am
by manymiles
Yes, you can close this.