host - a service

Andrew Meredith andrew at anvil.org
Fri Feb 7 02:37:53 CET 2003


Hi Jason,

I have been scouting around that area of the code myself just recently, 
after trying to do something to yourself.

As far as I can tell, there is nothing that will do exactly what you 
want, but it will get quite close. You will still have the service in 
the system, but it will be switched off ... the same as if you didn't 
mention the lack of this service on this particular host and then 
switched it off through the interface.

There are 3 parameter names that seem to have something to do with this 
function.

enable_active_checks
--------------------

   $ fgrep -rl enable_active_checks .
   ./html/docs/distributed.html

This appears to be something that is either going to be and hasn't yet, 
or used to be and hasn't been trimmed out of the docs yet .. either that 
or its a typo :)

active_checks_enabled
---------------------

This is service template parameter that has support all through the 
template reading and writing stuff and in the examples and convertcfg 
program.

However ..

checks_enabled
--------------

... is what it becomes when an xodtemplate_service structure is used to 
initialise a service structure using set_service_state_information() in 
xdata/xrddefault.c:593.

(It is also a parameter at the host level where it keeps it's name the 
whole way through and would seem to be involved in host level checks.)

Why have just gone through all this ? .. two reasons.

1 - I would be very grateful if someone who actually has a clue (unlike 
myself) would please have a look through the above and confirm whether I 
have got it right or not. The name change caught me right out until I 
spotted that the set_service_state_information() argument named 
active_checks_enabled was given the value of a variable called 
checks_enabled in xdata/xrddefault.c .. which given that checks_enabled 
is also a parameter in the host object made things a little confusing 
for a bear of very little brain.

2 - If this is true then (in theory .. I think) you should just be able 
to explicitly reference the service description by hostname and service 
name and then insert additional parameters of "active_checks_enabled=0" 
  and "passive_checks_enabled=0" .. I think this should over-ride the 
value inherited from the hostgroup when that service structure is 
actually created in memory and render that service inoperative.

The downside would be that it still shows up in the UI, but has no 
effect on anything. This as I say is not really what you are after, but 
might be a reasonable stop-gap until something tidier can be done in 
version 2.0 ... how about a service parameter called "vanish" (or for 
the LinuxHeads "mrproper" ;) that causes that service structure to be 
deleted.


Having said all that, I haven't got a 1.0 test system on which I can try 
it right now, so it may well turn out that this is flexing the 
inheritance mechanism a little bit too hard.

BTW .. If the developers are watching, I would be quite willing to go 
through the CVS version and rename the service structure variable from 
checks_enabled to active_checks_enabled in the code. I know that this 
would help me understand the logic a little better .. and I suspect that 
future newcomers might also be a little confused by the sudden change of 
name.

Cheers

Andy M

Jason Burnett wrote:
> is there any way to tell a host to ignore one of the tests assigned to
> it's hostgroup?
> example:
> 
> define hostgroup{
>         hostgroup_name  neospire-virtuals-apache
>         alias           Neospire Apache & Zeus webservers
>         contact_groups  admins
>         members         one,two,linux1
> }
> define service{
>         hostgroup_name                  neo-vs-web-apache
>         service_description             SSH
> }
> 
> 
> define host{
> #server only runs telnet
>     host_name       linux1
>     ....
>     check_command   **IGNORE SSH**
> }
> What I am looking for is an easy way to standardize tests across groups,
> but as always there are exceptions and I need to be able to tell a
> certain host to ignore certain tests inherited from it's group.
> 
> oh and before anyone starts chastising me, I dont actually run telnet on
> any of my servers.





-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com




More information about the Users mailing list