Hi,

Has anyone any experience with implementing checks through ssh and defining them in 
a sweet & generic syntax with :

command = [ PluginDir + "/check_users" ]
arguments = {
  "-w" = "$users_warn$"
"-c" = "$users_crit$"
}

This doesn't look a so big advantage in this example since there are only a few 
arguments (and they all are mandatory), but for other checks (like my_mysql 
described in 
http://docs.icinga.org/icinga2/latest/search?q=arguments#!/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics?highlight-search=arguments#command-passing-parameters)
 it might be a really big step further!

Thanks,
Samuel

On 28. 09. 15 11:20, Bancal Samuel wrote:
Hi,

All our Linux servers are monitored through ssh with such kind of config :

template Host "generic-ssh-host" {
    import "generic-host"
    vars.os = "Linux"
    vars.agent_type = "by_ssh"

    vars.by_ssh_logname = "nagios"
    vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa"
}
object Host "unitbkp1" {
    import "generic-ssh-host"

    [...]
}
apply Service "users" {
    import "generic-service"
    check_command = "by_ssh_users"
    assign where host.vars.agent_type == "by_ssh"
}
object CheckCommand "by_ssh_users" {
    import "by_ssh"

    vars.by_ssh_command = "/usr/lib/nagios/plugins/check_users -w 
$by_ssh_users_warn$ -c $by_ssh_users_crit$"
    vars.by_ssh_users_warn = "20"
    vars.by_ssh_users_crit = "50"
}

Since syntax described at 
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#commands
 :
command = [...]
arguments = {...}
seems much more efficient & generic, we'd like to know if there is an 
equivalent for ssh hosts and be able to do something similar to :

object CheckCommand "by_ssh_users" {
    import "by_ssh"# or something else?

command = [ PluginDir + "/check_users" ]
    arguments = {
        "-w" = "$users_warn$"
        "-c" = "$users_crit$"
    }

    vars.users_warn = "20"
    vars.users_crit = "50"
}

Thanks,
Samuel


--
Samuel Bancal
ENAC-IT
EPFL

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to