Hi.

I haven't found the following ideas in such a form in the documentation
(maybe I was just utterly blind); once if all questions (marked with
numbers like, 1)...2)...) are solved, we may polish it up and integrated
it somehow in the documentation for the benefit of all.


I'm looking for a way to do about the following:

Szenario a)
* I have a service (let's take check_load as an example), which I want
to check on ALL hosts (or at least on some big hosts groups or so)...
* The service check should run with some reasonable & safe options, e.g.
"-w 1,1,1 -c 5,5,5" (yeah one can argue whether this is
reasonable&safe ;) )
* There are however exceptions, where different settings should be used
(e.g. because I know that that particular host runs always under higher
load)

Another motivation of this is, that I want to "secure" that check_load
runs on every host, even if just with the (possibly wrong) "default
arguments" of ("-w 1,1,1 -c 5,5,5").



What's the cleanest way to get this? I found at least the following
approaches:



I) A first approach
1st I have a "general purpose" check, on all hosts (all is a hostgroup
that matches *),... perhaps it even defines some additional stuff like
an image:

define service {
        name                            load
        use                             default
        service_description             load
        hostgroup_name                  all
        
        display_name                    Load
        icon_image                      Load.png
        
        check_command                   check_load!--warning=1,1,1 
--critical=5,5,5
        check_interval                  1
}


Now I refine settings:
define service {
        use                             load
        service_description             load
        hostgroup_name                  none
        host_name                       host1,host2
        
        check_command                   check_load!--warning=10,10,10 
--critical=20,20,20
        check_interval                  5
}

I "use load", no longer define "global" stuff like icon_image, but check
less often (check_interval) and use "--warning=10,10,10
--critical=20,20,20".
Further I have the SAME service_description.

1) I guess I need to set "hostgroup_name none" in order not to just
override all,...do I???

And I use "host_name" to select the nodes I want to refine.


2) It seems that this works as expected... i.e. every host has JUST ONE
load check,... host1,host2 with my refined settings... all other with
defaults.
However, I would have expected, that for host1,host2 I get actually TWO
load checks.... one with the general settings, one with the refined.
I could not find any place in the documentation why this works... so...
why? And is that intended?
Especially as I nowhere use thy syntax "!host".




II) Getting rid of the "hostgroup_name none"
It's annoying to need "hostgroup_name none" in all refined service
definitions and I would like to get rid of this.
My idea...

The base service is the same as above, just that it doesn't supply any
host/hostgroup:
define service {
        name                            load
        use                             default
        service_description             load
        
        display_name                    Load
        icon_image                      Load.png
        
        check_command                   check_load!--warning=1,1,1 
--critical=5,5,5
        check_interval                  1
}


I have an additional catch-all-service (with the "hostgroup_name all"):
define service {
        use                             load
        service_description             load
        hostgroup_name                  all
}
It again has the SAME service_description and no further
"refinements" (these are already in the base object above).


Now I refine settings (just as above):
define service {
        use                             load
        service_description             load
        hostgroup_name                  none
        host_name                       host1,host2
        
        check_command                   check_load!--warning=10,10,10 
--critical=20,20,20
        check_interval                  5
}


3) Now... I'm not sure whether this is also expected to work.
Because the question is now:
How would Icinga know which of the two versions for the checks for
host1,host2 it should use?
The one from the catch-all-service or the one from the refined-service?
In the first approach I,... it decides (I guess) to simply use that one
from the "youngest" child... but in approach II, both would be childs at
the same level.




III) I just want to refine parameters of the check_command
I.e. I do not want to always write again the full:
        check_command                   check_load!--warning=10,10,10 
--critical=20,20,20
but just what has changed, i.e. "--warning=10,10,10
--critical=20,20,20".

I'm not sure how to best do this,... my first idea was something like:
Base-object:
define service {
        name                            load
        use                             default
        service_description             load
        
        display_name                    Load
        icon_image                      Load.png
        
        check_command                   
check_load!$_SERVICE_DEFAULT_CHECK_PARAMETERS$
        check_interval                  1
        _DEFAULT_CHECK_PARAMETERS       --warning=1,1,1 --critical=5,5,5
}

4) Can I do this? I.e. use the macro for the _DEFAULT_CHECK_PARAMETERS
in the check_command directive (instead of the command object definition
of check_load)?

refined object:
define service {
        use                             load
        service_description             load
        hostgroup_name                  none
        host_name                       host1,host2
        
        _DEFAULT_CHECK_PARAMETERS       --warning=10,10,10 --critical=20,20,20
        check_interval                  5
}
This time without "check_command", but with an overridden
_DEFAULT_CHECK_PARAMETERS.



Okay... the mail got already long enough ;-) but there's a short
scenario b) which builds upon (a):


Scenario b):
The idea is the same, I have a base object which applies to e.g. ALL
hosts.

What I want now is, not selectively refine check parameters, but
selectively disable the whole check for hosts.

Motivation:
I have checks like check_raid for which it is important that they run on
all hosts (especially that I don't forget to configure it for hosts that
actually have a RAID).
But not all of my hosts have a RAID,... some of them are e.g. VMs.
Still, because that check is so important, I want to have it run per
default on ALL nodes, even if that means I get CRITICAL/UNKNOWN "no RAID
found" for my VMs in the first place.
I must really manually say: "no host1 has no RAID, don't check there" to
get away with this.

5) Is that somehow possible by similar refining as I did above in
scenario (a) ?



Thanks for your attention and help ;)

Chris.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users

Reply via email to