Re: [Nagios-devel] A idea to speed up access times to service records

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

Re: [Nagios-devel] A idea to speed up access times to service records

Post by Guest »

Ian Holsman wrote:
>
> Hi.
>
> I was looking through the code while I was attempting to patch the glib
> hash functions into the 1.x codebase, and was thinking that the services
> hash table wasn't ideal.
>
>
> wouldn't it be better if there was a linked list of services for each
> host (instead of either a global linked list/hash on host/service name)
>
>
> ie.. in the host structure you would have something like
>
> host_struct {
> ...
> service *service_head;
> ..
> }
>
> and in the service_struct something like
>
> service_struct {
> ..
> service *service_next;
> host*host
> }
>
I'm currently working on creating proper configuration structs for
nagios. If it doesn't get included in the main branch, I'll open up a
new project and use it there.

> this was you could navigate around instead of having to go through all
> the lists the matching host/service.
> I think the above would work better than having a hash on the combined
> service/host names. and you could use this in a lot of places in the
> nagios code.
>
Indeed. Much isn't properly done in the code, but I'm guessing that is
mostly for legacy reasons.

> oh.. a humble request..
> can someone please run indent on the code in CVS and check that in.
>
I agree completely. However, since Ethan is the main developer, his
coding standards are law in this project.
I suggest you get a nice .indent.pro (mine is attached) and run it
recursively on the nagios code as such;
cd nagios
for i in `find -type d` ; do indent $i/*.c $i/*.h ; done

indent(1) for those who do not know is a GNU program and can be
downloaded from http://www.gnu.org
It's most likely available as prepackaged binaries for your system.

>
> Regards
> Ian.
>
> --
> Ian Holsman
> blog: http://blog.holsman.net
> PH: 03-9857-3742 (oz)

--
Mvh / Best regards
Sourcerer / Andreas Ericsson
OP5 AB
+46 (0)733 709032
[email protected]





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