On So, 2014-09-28 at 15:12 +0200, Tomasz Chmielewski wrote:
> 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.
Well, as -s is not yet included in the default object, you would have to
extend (not copy) the http CheckCommand:
object CheckCommand "http_custom" {
import "http"
// add own params
arguments += {
"-s" = "$http_search$"
"-t" = "$http_timeout$"
}
}
And use apply Service to add the monitoring:
apply Service "website" {
import "generic-service"
check_command = "http_custom"
vars.sla = "24x7"
vars += {
http_vhost = "www.example.com"
http_search = "2014 Example Inc."
http_timeout = 10
}
assign where match(host.name, "web*.example.com")
// or some other assignment that makes sense
}
Cheers
Markus
--
Markus Frosch
[email protected]
http://www.lazyfrosch.de
signature.asc
Description: This is a digitally signed message part
_______________________________________________ icinga-users mailing list [email protected] https://lists.icinga.org/mailman/listinfo/icinga-users
