[Nagios-devel] Subservice Definations

John P. Rouillard rouilj at cs.umb.edu
Sat Dec 13 19:05:09 CET 2003


In message <1a2801c3c198$be533620$fb00a8c0 at office.toastedmedia.net>,
"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.

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.

I still am having problems trying to get the call tree graph laid out
in my head and finding the places where all the work is done, so my
conjecture above is most likely wrong. Does anybody have development
or architecture docs for nag2?

>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.

>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.

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


>> In message <07b801c3bb42$33585b10$fb00a8c0 at office.toastedmedia.net>,
>> "Sam Stickland" writes:
>> >SNMP traps are submitted as passive service checks. All the examples show
>> >the a single service defination for the traps - this has the unfortunate
>> >effect of the next SNMP trap overwriting the previous. I'd like to have
>> >different services definations for different SNMP traps on our networking
>> >equipment, but that would result in a LOT of service definations.
>> >
>> >It would be nice if there was a sub-service id that could be submitted
>with
>> >passive checks, that effectively divides a single service into multiple
>> >services on demand, without the need for 1000's of service definations.
>> >
>> >Is there a solution to this that I've missed, or is it going to require
>> >changes to Nagios? I'm a fair programmer so I'm happy to make these
>changes
>> >myself, but others might not consider this a good solution to this
>problem.
>>
>> Actually I had come to the same conclusion. Having page after page
>> after page of services to navigate through (not to mention set up)
>> when the majority of them are OK is a pain. My planned implementation
>> was to take passive services of the form service::subservice and
>> display them only if they were in a non-ok state.
>>
>> The base service would have to be defined (e.g. snmp) in order for the
>> dynamic subservices to be displayed. The base service would act as a
>> template for the dynamic services as far as notification, max_retries
>> etc. If needed, you could define the service with the :: if you needed
>> different settings.
>>
>> This service::subservice also opens the possibility of "rolling up"
>> the subservice states into an overall service state.
>>
>> One difference is that I had considered it for both the passive and
>> active polling case as I could have temperature, temperature::disk1,
>> temperature::disk2, temperature::motherboard items that wouldn't
>> overwrite each other. The only difference from the normal services is
>> that :: services wouldn't be displayed unless they were non-ok or
>> pending.
>>
>> -- 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-devel mailing list
>> Nagios-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/nagios-devel
>>
>
>
>
>-------------------------------------------------------
>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-devel mailing list
>Nagios-devel at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/nagios-devel


-------------------------------------------------------
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 Users mailing list