[Nagios-devel] Parsing host_list within neb module

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Parsing host_list within neb module

Post by Guest »

Greetings...

I'm writing a module which intends to parse the host_list variable and
display the configured hosts to a log file (this is a simplified
snippet):

...
.
host *hl;

for (hl=3Dhost_list; hl !=3D NULL; hl=3Dhl->next)
{
sprintf(log,"log: host %s registered",hl->name);
write_to_logs_and_console(log,NSLOG_INFO_MESSAGE,TRUE);

}
.
.

Am able to register the callback for the function which contains the
above code with no problem.

In my configs, I have defined 2 hosts, and both are recognized and
monitored actively (as verified via the gui). But, the above code in my
module only displays 1 host. The same is true for the service_list, in
which I have 5 services defined in the config files, but a similar piece
of code only results in 1 service being printed to the log..... I've
looked at other places w/in the base code with references to host_list,
and all seem to use the above convention when referring to the host_list
or service_list....

Thoughts? Anybody out there have dealt with this? Is there another way
to get a list of all the hosts/services (via the event broker)?

Thanks,

Eloy F. 'Frank' Macha
ERP Technology Services
AtosOrigin, Inc
Office: +1 817 264 8465
Cell: +1 972 814 4979
Fax: +1 817 264 8209
email: [email protected]
www.atosorigin.com






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked