nagios api

Tony Sceats tony at tungsten.bulletproof.net.au
Tue Mar 30 15:03:29 CEST 2004


hey there...

first all, love your work :) 

So, I suppose I have 1 question and one
suggestion.. the first question is does Nagios have an API, and is it
documented anywhere? If so, I suppose it would be in C or C++ ? 

The reason I ask is that I a while
ago now I wrote a cgi script that will list all the hosts currently
monitored with nagios.. it does this by parsing the relevant config files, and will display this list as series of options.. for each host selected it will put a comment in nagios by writing to the named pipe file (in debian at least /var/log/nagios/rw/nagios.cmd ).

So, anyway, I can see a few other uses to the interface that i've created
including easy mass acknowledging of problems and scheduling
downtime for a seemingly random set of hosts/services (in terms of the config - ie, hosts
in different groups etc), but in order to do so it would be better to
get a list of things in a certain state. I know this is possible via the
cgi interface, however I would ultimatley prefer not to have to strip
html etc etc to get this list.. so, is there a way to get this via an API of
some kind?

And I suppose a related question would be how would one acknowledge
things and schedule downtime for this list? Is there a way to do this
via the named pipe file used for comments mentioned above? 

The suggestion I have is really for some of the plugins, I'm not sure if
this is the right place to put this... But anyway, it would be nice if they
supported an option to specify a source address. I have already patched
check_http to do this (well, in fact I modified netutils.c), although
I did this dodgely, as I hard coded the IP (I was extremely short of
time to do this by the time it was considered to be the only option
forward). During the course of going over the code it was seen clearly
that a lot of the plugins would require to be patched as the change had
to be made to the my_connect function in netutils.. so I would like to
put this forward as a suggestion for future versions of the core
plugins.

anyway, thanks for your time.

Tony Sceats


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click




More information about the Developers mailing list