Page 1 of 4

mv .cfg for switch I don't want to monitor crashes Nagios

Posted: Thu Mar 13, 2014 2:52 pm
by billperrotta
Not sure what the proper way to get rid of a switch I don't want to currently monitor but perhaps reenable to monitor later.
When I did a rename of " mv sw_amct.cfg sw_amct.bak" Nagios crashes so I renamed it back. Is it that only .cfg files can live under /objects/devices/sonicwalls.

Im assuming moving the file to a location that has nothing to do with nagios will remove the monitoring of it without crashing nagios?

or is there an extension I can rename it to to deactivate it? or is there some other way to do this?

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Posted: Thu Mar 13, 2014 3:00 pm
by lmiltchev
You can comment the out the "sw_amct.cfg" in the nagios.cfg file, for example:

Code: Select all

# cfg_file=/usr/local/nagios/etc/objects/devices/sonicwalls/sw_amct.cfg
...depending on how you defined it.

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Posted: Thu Mar 13, 2014 3:10 pm
by billperrotta
Doesn't seem possible because he defined all directories cfg_dir=/etc/nagios/devices

and under that is subdirectory sonicwalls and a .cfg for each sonicwall.

in my experience so far copying one and changing parameters lets me add a device of the same type.

renaming it crashes nagios. would moving it somewhere unrelated remove it from my monitoring grid and everything else still work?

I inherited this setup.

Or it just dawned on me do I add a similar statement to the one you just mentioned to nagios.cfg? That probably wouldn't work unless there was some kind of ignore statement?

To make it clear no such statement exists and I cannot comment out the whole devices directory.

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Posted: Thu Mar 13, 2014 3:28 pm
by sreinhardt
You should create a folder(s) for disabled configs, and move them there. Do not include this in the nagios.cfg file. This way you can keep old or not needed configs for future reference without causing nagios issues. However yest you really should only keep .cfg files in any directory that nagios.cfg references as a config dir.

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Posted: Thu Mar 13, 2014 3:45 pm
by billperrotta
I accidentally 86ed the file instead of copying it to /etc/disabled objects and now my nagios is down and won't start.


Helllllp Please!!!!

I used mv to that path but the file disappeared can't copy it back.

I'm getting "Job for nagios.service failed. See 'systemctl status nagios.service' and 'journalctl -n' for details."

when typing nagios stop start or restart

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Posted: Thu Mar 13, 2014 4:03 pm
by slansing
Did you try to move it (but removed it) when nagios was running?:

Code: Select all

service nagios stop

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Posted: Thu Mar 13, 2014 4:03 pm
by billperrotta
maybe just please help me get nagios running

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Posted: Thu Mar 13, 2014 4:06 pm
by tmcdonald
billperrotta wrote:maybe just please help me get nagios running
That is what we are trying to do. "maybe" does not help us. We need you to run the commands slansing posted and provide us with the output.

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Posted: Thu Mar 13, 2014 4:09 pm
by billperrotta
my nagios directory is /etc/nagios/objects then subdirectories. I am a little confused sorry

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Posted: Thu Mar 13, 2014 4:10 pm
by slansing
Then you will need to alter the above verification command to your nagios bin location, and your nagios cfg location, just don't forget the "-v" for verification.