Page 1 of 1
remove a Device via command line
Posted: Tue Oct 02, 2012 4:31 pm
by dmrholloway
new to nagios, what is the command to remove a device.
No web interface
Re: remove a Device via command line
Posted: Wed Oct 03, 2012 12:05 am
by jsmurphy
Nagios stores its configuration in flat files, which are by default in /usr/local/nagios/etc/ you will find a whole lot of .cfg files. Inside these files will be a whole bunch of different object definitions, you need to find the host definition and remove that. It will look something like:
define host {
host_name <my hostname>
...
}
Re: remove a Device via command line
Posted: Sat Oct 06, 2012 4:58 am
by inventsekar
i do had the same question at first...
As said above, Nagios just uses flat files.. We can add / remove hosts from the config file and the change takes effect, restarting/reloading is nececessary when you modify your configuration files and want those changes
to take effect.
Re: remove a Device via command line
Posted: Tue Dec 11, 2012 12:26 am
by ChrisWilli
Hi,
i am able to remove the <hostname>.cfg file however when i restart the Nagios service i get the following error > "Configuration validation failed"
If i re-enter the <hostname>.cfg file with all the contects then the service starts again.
It must be something simple but it means i am unable to remove devices.
I am new to Nagios , so any advice would be appreciated.
Re: remove a Device via command line
Posted: Tue Dec 11, 2012 3:54 pm
by jsmurphy
If you run a "/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg" it will tell you exactly why validation has failed. It's probably because another host object is dependent on or parented to that host. If you have trouble working it out, post the validation output
