Hi Support team,
Recently I've made a new Nagios server to replace the old one and I was trying to export Nagios config files to new server.
I did all instructions in Nagios Library but unfortunately I can not see my hosts in new server.I can see all hostgroups,servicegroups,contacts and any feature in old server but only I can not see hosts in new server.
What can I do to solve my problem?
Regards
Majid
Importing config files
Re: Importing config files
You don't see the hosts because they are either not in the database or recorded in the current flat files for some reason. Did you migrate configs from Nagios Core --> Nagios XI, or were they both XI machines and if so, were both machines running the same version?
To be clear did you refer to these docs?
https://assets.nagios.com/downloads/nag ... p_Tool.pdf
https://assets.nagios.com/downloads/nag ... nto_XI.pdf
During the import procedure (Configure > CCM > Tools > Import Config Files), do you recall seeing any errors at the bottom of the page?
Here are couple of things you can try:
1) Check to see if there are multiple Nagios processes running, as this will cause an array of problems.
run this cmd on your nagios server:
ps - aef | grep nagios.cfg
* Look for multiple parent (PPID) processes. The Nagios process forks itself to run checks therefore subprocesses are normal. The nagios user should probably be the only owner of the nagios process. If in any doubt post the output here.
If there are multiple Nagios processes running, run these commands to resolve:
2) When errors occur during 'Apply config' its usually a conflict between what the DB has on record and what the flat files have listed at the moment. The following process should resolve it:
In the XI UI go to:
Core Config Manager > Tools > Write Config Files
Then follow these steps in order:
delete (deletes all flat files)
write (creates new flat files based off of what is in MySQL)
verify (runs the nagios verify cmd)
* If verify is good = apply config
* If verify is bad = correct the corresponding errror, then repeat these steps until there are no more errors.
To be clear did you refer to these docs?
https://assets.nagios.com/downloads/nag ... p_Tool.pdf
https://assets.nagios.com/downloads/nag ... nto_XI.pdf
During the import procedure (Configure > CCM > Tools > Import Config Files), do you recall seeing any errors at the bottom of the page?
Here are couple of things you can try:
1) Check to see if there are multiple Nagios processes running, as this will cause an array of problems.
run this cmd on your nagios server:
ps - aef | grep nagios.cfg
* Look for multiple parent (PPID) processes. The Nagios process forks itself to run checks therefore subprocesses are normal. The nagios user should probably be the only owner of the nagios process. If in any doubt post the output here.
If there are multiple Nagios processes running, run these commands to resolve:
Code: Select all
service nagios stop
killall -9 nagios
service nagios start2) When errors occur during 'Apply config' its usually a conflict between what the DB has on record and what the flat files have listed at the moment. The following process should resolve it:
In the XI UI go to:
Core Config Manager > Tools > Write Config Files
Then follow these steps in order:
delete (deletes all flat files)
write (creates new flat files based off of what is in MySQL)
verify (runs the nagios verify cmd)
* If verify is good = apply config
* If verify is bad = correct the corresponding errror, then repeat these steps until there are no more errors.
Be sure to check out the Knowledgebase for helpful articles and solutions!
-
mdsupersonic
- Posts: 84
- Joined: Fri May 13, 2016 2:25 pm
Re: Importing config files
Thank you for your reply,I'm just migrating from trial NagiosXI which is expired to new Nagios XI which going to be the main server?
those documents are for migration from Nagios core to Nagios XI which is not applicable to my issue.I've just done write in old Nagios XI and Importing to new one.
But the problem is,there are no host.cfg or service cfg file in exported files. you can see attached file which shows which files are exported.I exactly imported the same files in new Nagios XI but unfortunately no hosts and services are there.
those documents are for migration from Nagios core to Nagios XI which is not applicable to my issue.I've just done write in old Nagios XI and Importing to new one.
But the problem is,there are no host.cfg or service cfg file in exported files. you can see attached file which shows which files are exported.I exactly imported the same files in new Nagios XI but unfortunately no hosts and services are there.
-
mdsupersonic
- Posts: 84
- Joined: Fri May 13, 2016 2:25 pm
Re: Importing config files
Thank you ,I did Delete and write and it gave me all the hosts and services files.Now I'm going to test this files thank you again.
Re: Importing config files
Let us know when it is safe to lock this topic, and mark it as resolved. We will keep the thread open for the time being.Thank you ,I did Delete and write and it gave me all the hosts and services files.Now I'm going to test this files thank you again.
Be sure to check out our Knowledgebase for helpful articles and solutions!