Hi ,
I am in the process of rewriting a bunch of scripts that do automatic configuration on server deployment from NCONF to NAGIOSQL.
So I have few questions.
What does the actual "write" function do when running do_config.php. It says it writes out a configuration, but I never see anything appear, and strace does not give sufficient information to trace what it is doing.
In the gui what function would run the "Write all config files" , and is there a script to do this.
regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The do_config.php script has some low level functions like:
- write config files
- import config files
- check configuration
- restart nagios
As example - write contact data:
do_config.php write localhost contact
(localhost means the data domain "localhost" - not the target system - although it can end up in the same way)
Important: There is an "exit" at the beginning in do_config.php that has to be comment out to work
"Write all config files" can be found below the host and service table. This is because each host and service in NagiosQL uses its own file, whereas e.g. all contacts are together in one file.
So this command will write all host or service files - no matter if something changes in a file or not.
The script can do this in the same way using:
do_config.php write localhost host
do_config.php write localhost service
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Can anyone please explain exactly what the "write" option does in the do_config.php.
I never get a failure when running it, but it does not seem to write anything out.
I can import a file using the command, but the "write" function has me confused.
Hi ,
I am in the process of rewriting a bunch of scripts that do automatic configuration on server deployment from NCONF to NAGIOSQL.
So I have few questions.
What does the actual "write" function do when running do_config.php. It says it writes out a configuration, but I never see anything appear, and strace does not give sufficient information to trace what it is doing.
In the gui what function would run the "Write all config files" , and is there a script to do this.
regards
The do_config.php script has some low level functions like:
- write config files
- import config files
- check configuration
- restart nagios
As example - write contact data:
do_config.php write localhost contact
(localhost means the data domain "localhost" - not the target system - although it can end up in the same way)
Important: There is an "exit" at the beginning in do_config.php that has to be comment out to work
"Write all config files" can be found below the host and service table. This is because each host and service in NagiosQL uses its own file, whereas e.g. all contacts are together in one file.
So this command will write all host or service files - no matter if something changes in a file or not.
The script can do this in the same way using:
do_config.php write localhost host
do_config.php write localhost service
Thanx for the feedback. I must a permissions issue that is not showing up.
Hi,
Can anyone please explain exactly what the "write" option does in the do_config.php.
I never get a failure when running it, but it does not seem to write anything out.
I can import a file using the command, but the "write" function has me confused.
Examples
php doconfig.php write localhost hosts
Write hosts.cfg ...
Configuration file hosts.cfg successfully written!
Nothing written anywhere
Hello
Look at this examples on my test system:
This files are updated.
I think the error is using "hosts" insteed of "host"