Config files identify IPs not in Auto-Discovery
Config files identify IPs not in Auto-Discovery
Hello:
We are running Running Nagios XI 2012R2.9 on RedHat Linux (latest version).
In Auto-Discovery, I specified 6 different scan targets: x.y.z.0/24, but did not run an Auto-Discovery as to where subnet z = 8.
However, that subnet's IPs (z = 8) are appearing in the Monitoring Configuration Snapshots under:
Configure menu - Advanced Configuration - Core Config Manager - Quick Tools - Configuration Snapshots
How can I not have these referenced or clear these out?
This is what I'm thinking (starting fresh):
A). DELETE THE FOLLOWING:
1). Delete all services that were found and save that configuration.
2). Delete all hosts that were found and save that configuration.
3). Delete the Auto-Discovery Jobs
FIRST QUESTION: Do I save after the jobs are deleted or do they delete on the server behind the scenes automatically?
4). Delete the configuration files on the Nagios server in directory:
/usr/local/nagios/etc/hosts
SECOND QUESTION: How does one delete the Monitoring Configuration Snapshots from:
"Admin menu - Monitoring Config - Config Snapshots" when "Download", "View Output", and "Restore" only appear?
5). Restart Nagios.
B). START FRESH:
1). Rerun Auto-Discovery with the needed IP subnets.
2). Write the configuration file(s) in:
"Configure menu - Advanced Configuration - Core Config Manager - Tools - Write Config Files", then Write, then Verify, then Restart
3). Verify in the console
THIRD QUESTION: Is this process, above, reasonable or is there a better method for starting fresh without reinstalling the whole Nagios Core and Nagios XI?
Thank you.
We are running Running Nagios XI 2012R2.9 on RedHat Linux (latest version).
In Auto-Discovery, I specified 6 different scan targets: x.y.z.0/24, but did not run an Auto-Discovery as to where subnet z = 8.
However, that subnet's IPs (z = 8) are appearing in the Monitoring Configuration Snapshots under:
Configure menu - Advanced Configuration - Core Config Manager - Quick Tools - Configuration Snapshots
How can I not have these referenced or clear these out?
This is what I'm thinking (starting fresh):
A). DELETE THE FOLLOWING:
1). Delete all services that were found and save that configuration.
2). Delete all hosts that were found and save that configuration.
3). Delete the Auto-Discovery Jobs
FIRST QUESTION: Do I save after the jobs are deleted or do they delete on the server behind the scenes automatically?
4). Delete the configuration files on the Nagios server in directory:
/usr/local/nagios/etc/hosts
SECOND QUESTION: How does one delete the Monitoring Configuration Snapshots from:
"Admin menu - Monitoring Config - Config Snapshots" when "Download", "View Output", and "Restore" only appear?
5). Restart Nagios.
B). START FRESH:
1). Rerun Auto-Discovery with the needed IP subnets.
2). Write the configuration file(s) in:
"Configure menu - Advanced Configuration - Core Config Manager - Tools - Write Config Files", then Write, then Verify, then Restart
3). Verify in the console
THIRD QUESTION: Is this process, above, reasonable or is there a better method for starting fresh without reinstalling the whole Nagios Core and Nagios XI?
Thank you.
Newbie '14
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Config files identify IPs not in Auto-Discovery
Well all you should really have to do is remove the definitions from the CCM, and apply configuration, or use the Write Config tool if you predict errors, you don't need to do anything further beyond that. You definitely do not need to manually remove the config files as nagios takes care of that for you.
Re: Config files identify IPs not in Auto-Discovery
Thank you for the response, but please excuse my ignorance due to just learning Nagios XI, but I am not understanding what you mean by "remove the definitions from the CCM".
I think you are using "CCM" to mean "Configure menu - Advanced Configuration - Core Config Manager", correct (or any of the many different ways to get to "Core Config Manager")?
Do you go into the "Quick Tools - Configuration Snapshots" (which is then found on that page also as "Monitoring Config - Config Snapshots"), then "View Output" of the snapshot, edit the information, and reload??
It should be easy to do, but this isn't "clicking".
UPDATE:
I noted in "/usr/local/nagios/etc/hosts" and "/usr/local/nagios/etc/services" that the date stamp on the <IP-related filename>.cfg files were older than what should be monitored, so I deleted those older files, then in "CCM" I deleted all Services and applied the configuration twice, then I deleted all the Hosts and applied the configuration twice (due to the errors that came up after the first apply).
Now I notice that in the following:
Tactical Overview
Operations Center
Open Service Problems
Open Host Problems
All Service Problems
All Host Problems
all the respective hosts, etc. still appear (some of these I clear the filter but the errored items come back when I get back in that page).
ALL I WANT TO DO IS START FRESH and not have these keep returning! What am I missing, please??
I think you are using "CCM" to mean "Configure menu - Advanced Configuration - Core Config Manager", correct (or any of the many different ways to get to "Core Config Manager")?
Do you go into the "Quick Tools - Configuration Snapshots" (which is then found on that page also as "Monitoring Config - Config Snapshots"), then "View Output" of the snapshot, edit the information, and reload??
It should be easy to do, but this isn't "clicking".
UPDATE:
I noted in "/usr/local/nagios/etc/hosts" and "/usr/local/nagios/etc/services" that the date stamp on the <IP-related filename>.cfg files were older than what should be monitored, so I deleted those older files, then in "CCM" I deleted all Services and applied the configuration twice, then I deleted all the Hosts and applied the configuration twice (due to the errors that came up after the first apply).
Now I notice that in the following:
Tactical Overview
Operations Center
Open Service Problems
Open Host Problems
All Service Problems
All Host Problems
all the respective hosts, etc. still appear (some of these I clear the filter but the errored items come back when I get back in that page).
ALL I WANT TO DO IS START FRESH and not have these keep returning! What am I missing, please??
Newbie '14
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Config files identify IPs not in Auto-Discovery
Hi Phil,
To delete all of the existing hosts and service definintions do the following:
NOTE: For all my steps below, I would NOT delete the localhost services OR host!
Now you should be back to a clean Nagios XI that is only monitoring itself.
Let me know if you need some more help.
Cheers
Troy
To delete all of the existing hosts and service definintions do the following:
NOTE: For all my steps below, I would NOT delete the localhost services OR host!
- Configure menu - Advanced Configuration - Core Config Manager (this is CCM)
First we'll remove all the services
On the left pane under Monitoring click Services
Here all the current service definitions are shown
Click the Check All link at the top left and all the check boxes should now be selected
(de-select any services named localhost)
At the bottom next to With Checked select Deactivate from the list
The screen will refresh
Click the Apply Configuration button
Wait
Repeat the above steps for all of your service definitions (you might have 200-300)
Once all of them have been disabled and the the configuration has been applied, you can then go through the steps of checking them all again and this time selecting Delete from the With Checked list.
Eventually you'll end up with about eight services for localhost
Now we'll remove all the hosts
On the left pane under Monitoring click Hosts
Here all the current host definitions are shown
Click the Check All link at the top left and all the check boxes should now be selected
(de-select th host named localhost)
At the bottom next to With Checked select Deactivate from the list
The screen will refresh
Click the Apply Configuration button
Wait
Repeat the above steps for all of your host definitions (you might have 200-300)
Once all of them have been disabled and the the configuration has been applied, you can then go through the steps of checking them all again and this time selecting Delete from the With Checked list.
Eventually you'll end up with just the localhost host definition
Now you should be back to a clean Nagios XI that is only monitoring itself.
Let me know if you need some more help.
Cheers
Troy
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Config files identify IPs not in Auto-Discovery
Thank you, Box 293.
I have completed your steps and all the Services and Hosts do not appear in the Services and Hosts area (localhost was removed prior to your response but can we rediscover or add that back?); however, the following appears if you go to all the different views: Tactical Overview, All Service Problems, All Service Problems, All Host Problems, Host Detail, Service Detail
and I still see all the Hosts and Services associated to those Hosts (148):
Host Status Summary
Up Down Unreachable Pending
142 6 0 0
Unhandled Problems All
6 6 148
Service Status Summary
Ok Warning Unknown Critical Pending
423 0 1 14 0
Unhandled Problems All
15 15 438
I do not have any AutoDiscovery Jobs and I have deleted all the Services and Hosts as requested, but I still get the following messages in the most recent Config Snapshot:
"Processing object config file '/usr/local/nagios/etc/hosts/<our FQDN server name>.cfg'..."
Why are those appearing then? There shouldn't be anything displaying, correct? Can this be resolved and how?
I have completed your steps and all the Services and Hosts do not appear in the Services and Hosts area (localhost was removed prior to your response but can we rediscover or add that back?); however, the following appears if you go to all the different views: Tactical Overview, All Service Problems, All Service Problems, All Host Problems, Host Detail, Service Detail
and I still see all the Hosts and Services associated to those Hosts (148):
Host Status Summary
Up Down Unreachable Pending
142 6 0 0
Unhandled Problems All
6 6 148
Service Status Summary
Ok Warning Unknown Critical Pending
423 0 1 14 0
Unhandled Problems All
15 15 438
I do not have any AutoDiscovery Jobs and I have deleted all the Services and Hosts as requested, but I still get the following messages in the most recent Config Snapshot:
"Processing object config file '/usr/local/nagios/etc/hosts/<our FQDN server name>.cfg'..."
Why are those appearing then? There shouldn't be anything displaying, correct? Can this be resolved and how?
Newbie '14
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Config files identify IPs not in Auto-Discovery
Well, if you can't see that number of hosts/services in Home > Service Detail, and you removed them all from the CCM, then try the following:
First, check to see if their flat config files are still present in:
Also, you can try clearing your browser's cache, not sure if this will do anything on this point but it is worth a try. How long did you give the system after removing your hosts/services before going back to look at those pages? You made sure to apply configuration after removing them correct? If not, they should still appear in the Home > Service Details page.
First, check to see if their flat config files are still present in:
Code: Select all
/usr/local/nagios/etc/servicesRe: Config files identify IPs not in Auto-Discovery
If you want to delete ALL of the hosts/services and start clean (with the localhost ONLY), you can just run the "/usr/local/nagiosxi/scripts/restore_defaults.sh" script:
If you have any "ghost" configs left over in the "/usr/local/nagios/etc/hosts" and "/usr/local/nagios/etc/services", they will still show up in the GUI. You will need to remove them manually from the CLI and then apply configuration.
Code: Select all
cd /usr/local/nagiosxi/scripts
./restore_defaults.shBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Config files identify IPs not in Auto-Discovery
Hello:
I clear my Firefox browser's cache upon every exit. Since I did a PC reboot last night and just went in to my Nagios XI system this morning using Firefox, I noted:
Yes, I do see the 438 total records in Home - Details - Service Detail.
It's been over 24 hours since I did the deletion of Services and Hosts and then applied the configuration immediately afterwards.
The Host Status Summary identifies 142 Up and 6 Down (148 All), and Service Status Summary identifies 423 Ok, 2 Unknown, 13 Critical ... 438 All.
On the Nagios XI Linux server, I did an ls -laF of "/usr/local/nagios/etc/services" and noted that the flat config files do exist (same thing in ".../hosts") with dates of April 18, 16:00 (4:00 pm) (hosts has time of 16:03), with all files having "-rw-rw-r--" permissions from the admin account.
I clear my Firefox browser's cache upon every exit. Since I did a PC reboot last night and just went in to my Nagios XI system this morning using Firefox, I noted:
Yes, I do see the 438 total records in Home - Details - Service Detail.
It's been over 24 hours since I did the deletion of Services and Hosts and then applied the configuration immediately afterwards.
The Host Status Summary identifies 142 Up and 6 Down (148 All), and Service Status Summary identifies 423 Ok, 2 Unknown, 13 Critical ... 438 All.
On the Nagios XI Linux server, I did an ls -laF of "/usr/local/nagios/etc/services" and noted that the flat config files do exist (same thing in ".../hosts") with dates of April 18, 16:00 (4:00 pm) (hosts has time of 16:03), with all files having "-rw-rw-r--" permissions from the admin account.
slansing wrote:Well, if you can't see that number of hosts/services in Home > Service Detail, and you removed them all from the CCM, then try the following:
First, check to see if their flat config files are still present in:
Also, you can try clearing your browser's cache, not sure if this will do anything on this point but it is worth a try. How long did you give the system after removing your hosts/services before going back to look at those pages? You made sure to apply configuration after removing them correct? If not, they should still appear in the Home > Service Details page.Code: Select all
/usr/local/nagios/etc/services
Newbie '14
Re: Config files identify IPs not in Auto-Discovery
Hello:
Thanks for the information, but I suspect I'll lose all the user accounts, groups, etc. that we set up but don't wish to lose.
Additionally, when you state "CLI", are you referring to the "command line interface"? Where do I manually remove them from, since I already did a:
rm -rf /usr/local/nagios/etc/services/*.cfg
and
rm -rf /usr/local/nagios/etc/hosts/*.cfg
and did an Apply Configuration in the GUI.
BUT THE DANG GHOST FQDNs STILL APPEAR!! AND THIS IS GETTING EXTREMELY FRUSTRATING AND A WASTE OF MY TIME DEALING WITH THIS!
Thanks for the information, but I suspect I'll lose all the user accounts, groups, etc. that we set up but don't wish to lose.
Additionally, when you state "CLI", are you referring to the "command line interface"? Where do I manually remove them from, since I already did a:
rm -rf /usr/local/nagios/etc/services/*.cfg
and
rm -rf /usr/local/nagios/etc/hosts/*.cfg
and did an Apply Configuration in the GUI.
BUT THE DANG GHOST FQDNs STILL APPEAR!! AND THIS IS GETTING EXTREMELY FRUSTRATING AND A WASTE OF MY TIME DEALING WITH THIS!
lmiltchev wrote:If you want to delete ALL of the hosts/services and start clean (with the localhost ONLY), you can just run the "/usr/local/nagiosxi/scripts/restore_defaults.sh" script:
If you have any "ghost" configs left over in the "/usr/local/nagios/etc/hosts" and "/usr/local/nagios/etc/services", they will still show up in the GUI. You will need to remove them manually from the CLI and then apply configuration.Code: Select all
cd /usr/local/nagiosxi/scripts ./restore_defaults.sh
Newbie '14
Re: Config files identify IPs not in Auto-Discovery
As Box293 mentioned above: If you delete all hosts and services, the apply configuration will fail as you must have 1 host and service configured at a minimum at all times (that is why Box293 suggested leaving the localhost host and service configs). When the configuration fails, the most recent config object snapshot is extracted back to the nagios object directories. I assume the apply is failing and the configs are returned to disk. Try doing most of your removals from the CCM, and then testing the db state: Configure --> CCM --> Tools --> Write Config FIles --> Click write --> Click Verify --> Check to make sure that it verified ok, and then restart/apply config. If you get any errors, resolve them, write and verify once again, repeat until all errors are resolved and only apply config/restart nagios once all errors are resolved.PhilG wrote:rm -rf /usr/local/nagios/etc/services/*.cfg
and
rm -rf /usr/local/nagios/etc/hosts/*.cfg
and did an Apply Configuration in the GUI.
You should not lose the user accounts as those are saved in the postgres database. Likewise, any contacts/groups will be preserved as well, as you are only removing hosts and services. You may need to clean up some dependencies in the contacts/groups though.PhilG wrote:Thanks for the information, but I suspect I'll lose all the user accounts, groups, etc. that we set up but don't wish to lose.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.