Hi,
Is there a way to "Apply Configuration" from command ?
I'm using Linux.
I can verify but how do i Apply ?
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Thanks
Nagios CLI
Re: Nagios CLI
The /usr/local/nagiosxi/scripts/reconfigure_nagios.sh is the actual script that gets run under the hood when you Apply Configuration. : )
Re: Nagios CLI
Great !! Thanks
Another question, before the "Apply Configuration" I'm using the "Import Config Files" to import all services under /etc/services.
Can i do it from CLI also ?
Thanks
Another question, before the "Apply Configuration" I'm using the "Import Config Files" to import all services under /etc/services.
Can i do it from CLI also ?
Thanks
Re: Nagios CLI
If you're importing configs, I would strongly recommend reading the below docs and using the procedure outlined in them. There is a config prep process that should be run before importing.
http://assets.nagios.com/downloads/nagi ... ngfromcore
http://assets.nagios.com/downloads/nagi ... ngfromcore
Re: Nagios CLI
Hi,
I'm familiar with the import steps.
I need it in CLI as I need Nagios to be able to to change between two states automatically using a script.
I have 2 folders containing a defferent services.cfg files which I made in advance and i need to be able to control which is active, means 1 of the 2 folders content should be copied into /usr/local/nagios/etc/services
Steps in script:
1) deleting all current /usr/local/nagios/etc/services content
2) copy the desired content from 1 of the 2 folders I made in advance into /usr/local/nagios/etc/services
3) truncating from nagiosql database the tbl_service table.
then I need to do 2 more steps in that script:
4) import all /etc/services content to database - I don't know how it can be done from CLI so I'm doing it meanwhile from GUI
5) Apply configuration (which I know now how to do it as you helped me) -
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
so I need your help only with section number 4
Hope this is clear
Thanks
I'm familiar with the import steps.
I need it in CLI as I need Nagios to be able to to change between two states automatically using a script.
I have 2 folders containing a defferent services.cfg files which I made in advance and i need to be able to control which is active, means 1 of the 2 folders content should be copied into /usr/local/nagios/etc/services
Steps in script:
1) deleting all current /usr/local/nagios/etc/services content
2) copy the desired content from 1 of the 2 folders I made in advance into /usr/local/nagios/etc/services
3) truncating from nagiosql database the tbl_service table.
then I need to do 2 more steps in that script:
4) import all /etc/services content to database - I don't know how it can be done from CLI so I'm doing it meanwhile from GUI
5) Apply configuration (which I know now how to do it as you helped me) -
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
so I need your help only with section number 4
Hope this is clear
Thanks
Re: Nagios CLI
Found it,
I just copied the new folder content to "/usr/local/nagios/etc/import" and ran the "/usr/local/nagiosxi/scripts/reconfigure_nagios.sh"
Thanks anyway
I just copied the new folder content to "/usr/local/nagios/etc/import" and ran the "/usr/local/nagiosxi/scripts/reconfigure_nagios.sh"
Thanks anyway
Re: Nagios CLI
Yeah, that was going to be my suggestion. Just a note though, the import directory is meant for *new* configs, I wouldn't recommend it for regular configuration changes.