On 2014-09-28 14:27 (Sun), Markus Frosch wrote:

Thats simple, just add the appropriate vars to the service definition.

object Service "http" {
    import "generic-service"

    host_name = "localhost"
    check_command = "http"
    vars.sla = "24x7"
    vars.http_ssl = 1
    vars.http_vhost = "host.domain.com"
}

http_address (-I) is automatically set to the hosts address.

Thanks - and what would be the best way to achieve the following?

Coming from Nagios, I was using the following check which was useful to set custom parameters:

1) first, I've defined a custom http command - very simple:

define command {
        command_name    check_http_cmd
        command_line    $USER1$/check_http $ARG1$
}


2) then, it allowed me to use a check like this:

define service {
        use                             generic-service-nknews
hosts web1.example.com, web2.example.com, web3.example.com
        service_description             HTTP - www.example.com
        max_check_attempts              3
        normal_check_interval           10
        retry_check_interval            1
check_command check_http_cmd!-I $HOSTADDRESS$ -H www.example.com -s "2014 Example Inc" -t 10
}


And with a few lines, I was able to:

a) monitor several hosts at once (web1, web2, web3)

b) use custom check_http parameters for any other hosts

Now, I'm struggling to recreate a similar thing in Icinga 2.


--
Tomasz Chmielewski
http://www.sslrack.com

_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to