[Nagios-devel] Subservice Definations

John P. Rouillard rouilj at cs.umb.edu
Sun Dec 14 01:22:50 CET 2003


In message <1a8e01c3c1a8$13ccc800$fb00a8c0 at office.toastedmedia.net>,
"Sam Stickland" writes:
>From: "John P. Rouillard" <rouilj at cs.umb.edu>
>To: "Sam Stickland" <sam_ml at spacething.org>
>Cc: <nagios-users at lists.sourceforge.net>;
><nagios-devel at lists.sourceforge.net>

Please don't inclue email addresses in your quotes. You have probably
just guaranteed another few thousand spam messages to all concerned.

>> "Sam Stickland" writes:
>> >Thanks for you reply. I haven't yet started looking into the
>> >internals of nagios yet (particulary as I gather 2.0 is very
>> >different). Do you have any idea how difficult something like this
>> >would be to write? eg. Is it going to slide in nicely, or is it
>> >going to require some major restructuring? If it's the former I'm
>> >happy to have a go at writing it, and even it doesn't get accepted
>> >into the core I can maintain a patch. If it's more the later then
>> >obviously I'd need some feedback from the core developers.
>>
>> [rouilj says]
>> I am looking at 2.0 now for the purpose of refining the sec/nagios
>> integration interface. To start passive service checks of the form
>> service::foo will need to make it into the status file. Currently (If
>> I understand the code/operation properly) the service::foo passive
>> check result will be ignored (well reported as service not found) if
>> it doesn't exists as a defined service.  I would suggest working only
>> on nagios 2 since I understand 1.x is in feature freeze for the most
>> part.
>>
>> Somewhere around line 1753 in base/commands.c
>> process_passive_service_check() in nagios 2 is:
>>
>>      /* make sure the service exists */
>>      if((temp_service=find_service(real_host_name,svc_description))==NULL)
>>               return ERROR;
>>
>> So the first thing would be to change this to lookup the
>> service::subservice to see if it was explicitly defined. If it's not
>> found then break the svc_description on :: (if it exists) and lookup
>> the resulting prefix. My guess is that this logic (check svc:sub and
>> then svc) would ripple through the code.
>
>Would this actually ripple through for stuff like notifications and
>acknowledgements though?

Yes, I believe so. I think it was a similar dispalt loop, but I
haven't really checked.

>I'd really like to be able to separately acknowledge subservices.

Agreed. I think that's a required feature.

>> >I also remember reading a while back something about version 2 supporting
>> >the dynamic insertion of new services?
>>
>> I remember talk about changing polling intervals etc, but not dynamic
>> services. Then again I may be having a senior moment.
>
>If I remember correctly Ethan said that version 2 could support new services
>being added at runtime, but not the removal of current ones.

Ok. Wonder how that was going to work with the CGI's. Maybe refreeze
the config file?

>> >That and some kind of container-subservice relationship between
>> >services (a seperate relationship to service dependancies), would
>> > seem to be a reasonable starting point.
>>
>> Actually, for dynamic subservices, if the primary service is down, has
>> passive results turned off etc, then the dynamic subservices have it
>> turned off as well.
>>
>> I am not sure how the cgi's will have to be changed to handle dynamic
>> services, but my WAG is that they will have to change quite a bit
>> since I belive they look up the services on an as needed basis,
>> i.e. they work from a list of services gleaned from the config files.
>
>Well I was thinking about the container-subservice relationship so that the
>cgis could work out how to display the information, although that could
>obviously also be gleaned from the :: formating of the service name.
>
>It's my understanding that the web frontend has changed dramically in
>version 2. Do you know if they still read the configuration files, or
>whether they query the nagios process?

I think they read config files that are frozen at nagios
startup. Maybe Berkeley DB or DBM style hash files??

   -- rouilj
 John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Developers mailing list