Page 1 of 2

Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 11:47 am
by benhank
Perplexing issues.
1.I had a hostgroup that contained 514 objects. Suddenly it contained 129 objects. I can verify that nobody made any changes to the system. I do know the time period in which the issue must have happened.
I have done the following:
Gotten a list of the 514 objects, re added them to the hostgroup.cfg via command line and did a

Code: Select all

service nagios restart
the objects then showed up in the hg, but then I did an "apply config", and the numbers dropped again.
So I tried again this time doing a database repair 1st. This time a whole bunch of objects I'd deleted came back in ccm as "unsync'd objects", and the issue persisted.
I then deleted the host group, and repeated the db repair and adding the objects via the command line. This time I only got 124 objects BEFORE apply config.
so I recreated the hostgroup file and tried to import it in ccm\tools \import.
nothing no import.
2. While trying to fix this, I noticed than in the legacy ccm, if I looked at a hosts properties, The host would show up as no being a member of the HG. When I looked at the same host in the new CCM, it was listed as a member of the hostgroup this was the case for about sixty of my hosts.


My concern is that even if I manually readded all 514 hosts, I don't know how the problem happed in the 1st place and if it will happen any other hg's.

Re: Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 12:06 pm
by mguthrie
Gotten a list of the 514 objects, re added them to the hostgroup.cfg via command line and did a : service nagios restart
Note the bold print at the top of the .cfg files that say "Do not manually edit this config files, your changes will be overwritten by NagiosQL" ;)

You have to make the changes in the CCM, and then Apply Configuration, otherwise the hand-edits to the config files will always be overwritten every time you Apply Configuration. The only place that it's safe to edit configuration files by hand is the /usr/local/nagios/etc/static directory.

Re: Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 1:01 pm
by benhank
even if I import the files?
i can take the hit and re add all the hosts, but I am really concerned about what caused this.

Re: Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 1:05 pm
by mguthrie
You probably can import those configs, that should work. I don't recommend doing it that way on a regular basis for config changes, but it should save you from having to redo that work in the CCM.

Re: Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 1:14 pm
by benhank
now, when I do an "apply config" it finishes, but when I go back to ccm/hostgroups i am still prompted to apply the config for changes to take affect.

Re: Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 1:19 pm
by scottwilkerson
If you go to Admin -> System Profile

Are the system time and php time synced and correct?

Re: Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 1:27 pm
by benhank
now that you mention it, no. the system and server time are synced, but both are off by 5 mins.

Re: Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 1:29 pm
by scottwilkerson
do the timezones and times match in Admin -> System Profile

Re: Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 1:34 pm
by benhank

Code: Select all

Server Port: 80
Date/Time
PHP Timezone: America/New_York
PHP Time: Mon, 10 Dec 2012 13:27:15 -0500
System Time: Mon, 10 Dec 2012 13:27:15 -0500
thats what i have

Re: Nagios Hostgroup lost half of it's devices?

Posted: Mon Dec 10, 2012 1:39 pm
by scottwilkerson
So after you Apply Configuration from the CCM, it still says that you need to apply configuration for changes to take affect?

Can you post a screenshot?