> Greetings,
>
> I just recently started migrating to SMS notifications and therefor
> testing escalations.
> I discovered several possible bugs in the configfiles parsing.
>
> I am using a CVS snapshot of nagios 2.0 dated from 08.10.2004.
> config.c hasn't been modified since then according to the CVS.
>
Would that be Aug 10 2004 or Oct 8 2004?
> Under certain circumstances nagios ends up in an endless loop in
> pre_flight_check().
>
> Everything is running fine, unless I put any kind of escalation into the
> config files.
>
This is an "extension" (in lack of a better word) to a known bug. I
discovered it myself yesterday with serviceescalations. It differs from
the 'original' infinite loop bug in that it doesn't matter how many
objects you have specified (previously it would only hang if only one
object of any type was specified, and it hung on that object type).
That bug was however located in common/object.c, which handles
populating all the object tables initially. Perhaps you will have better
luck if you look for it there.
> example:
>
> define hostescalation {
> host_name PDC01
> first_notification 1
> last_notification 1
> notification_interval 60
> contact_groups SMS-Alarm
> }
>
> Now running nagios -v nagios.cfg:
>
> [root@SRV00032 etc]# ../bin/nagioscheck
>
> Nagios 2.0a1
> Copyright (c) 1999-2004 Ethan Galstad ([email protected])
> Last Modified: 11-18-2003
> License: GPL
>
> Reading configuration data...
>
> Running pre-flight check on configuration data...
>
> Checking services...
> Checked 253 services.
> Checking hosts...
> Warning: Host 'ABIT-DMZ_switch' has no services associated with it!
> Warning: Host 'RECHT.NET-DMZ_switch' has no services associated with it!
> Checked 106 hosts.
> Checking host groups...
> Checked 35 host groups.
> Checking service groups...
> Checked 0 service groups.
> Checking contacts...
> Checked 9 contacts.
> Checking contact groups...
> Checked 7 contact groups.
> Checking service escalations...
> Checked 0 service escalations.
> Checking service dependencies...
> Checked 0 service dependencies.
> Checking host escalations...
>
> Then nagios hangs with 99.9% cpu load.
>
> There is another interesting anomaly when I tried using escalations.
>
> I had a contactgroup that was unused called SMS-Test. When that
> contactgroup
> was activated nagios -v nagios.cfg outputs:
>
> [root@SRV00032 etc]# ../bin/nagioscheck
>
> Nagios 2.0a1
> Copyright (c) 1999-2004 Ethan Galstad ([email protected])
> Last Modified: 11-18-2003
> License: GPL
>
> Reading configuration data...
>
> Running pre-flight check on configuration data...
>
> Checking services...
> Checked 253 services.
> Checking hosts...
> Warning: Host 'ABIT-DMZ_switch' has no services associated with it!
> Warning: Host 'RECHT.NET-DMZ_switch' has no services associated with it!
> Checked 106 hosts.
> Checking host groups...
> Checked 35 host groups.
> Checking service groups...
> Checked 0 service groups.
> Checking contacts...
> Checked 9 contacts.
> Checking contact groups...
>
> And nagios hangs again with 99.9% cpu load.
> It didn't even get to checking the host escalations, for some reason it
> already
> hangs in the contactgroups.cfg.
>
> This leads me to the conclusion that checking the references relating to
> contacts does
> have an error and can lead to a possible endless loop in
> pre_flight_check(). I took a
> quick look into config.c, but the problem didn't strike me yet.
> The code is quite... strange
>
Ethan has his peculiarities about indentation style. I suggest making
heavy use of the indent program to make it readable and fix the bug.
Then run it once more with whatever options needed to restore it,
followed by:
sed -i 's/\([\t ]*\)}/\1\t}/' some_file.c
(requirese sed version 4.0.9 or higher) to push the closing brackets to
where Ethan wants them.
> The problem is that I don't believe it doesn't work for anyone, because I
> never seen
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]