switch in scheduled downtime generates cron failure messages

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
manymiles
Posts: 43
Joined: Sat Mar 16, 2013 8:24 am

switch in scheduled downtime generates cron failure messages

Post 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

Code: Select all

> /dev/null
but, that might be too draconian?

How should I handle?
You do not have the required permissions to view the files attached to this post.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: switch in scheduled downtime generates cron failure mess

Post 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.
manymiles
Posts: 43
Joined: Sat Mar 16, 2013 8:24 am

Re: switch in scheduled downtime generates cron failure mess

Post 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).
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: switch in scheduled downtime generates cron failure mess

Post by abrist »

You can either edit the MAILTO= option on your crons, or suffice the mrtg cron with:

Code: Select all

  >/dev/null 2>&1
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
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.
manymiles
Posts: 43
Joined: Sat Mar 16, 2013 8:24 am

Re: switch in scheduled downtime generates cron failure mess

Post by manymiles »

Thanks, abrist.

I went with the

Code: Select all

>/dev/null
solution.

I was considering that, but, I didn't know its implications in regards to Nagios.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: switch in scheduled downtime generates cron failure mess

Post by tmcdonald »

Are we all set to close this topic?
Former Nagios employee
manymiles
Posts: 43
Joined: Sat Mar 16, 2013 8:24 am

Re: switch in scheduled downtime generates cron failure mess

Post by manymiles »

Yes, you can close this.
Locked