I think it would be very useful to be able to pass parameters (arguments) to a command defined as event_handler, since it would allow the retrieval of a command by multiple services that could send different parameters, in the same way that the check command is allowed.
Before in Nagios Core, the "event_handler" directive passed: both the name of the command and the parameters to it.
Now the parameters are defined directly in the command, making this less versatile and dynamic, since before an "event_handler" command could be reused in different services, passing different parameters.
OLD - With Nagios Core:
Code: Select all
define service {
host_name Aplicaciones
service_description server1.es/AppWS
use aplicacionesexp-service
servicegroups aplicacionesexp-servicegroup
check_command check_http!"server1.es"!"/AppWS"
event_handler reiniciar_sic!1!tomcat7!sic!user1@domain.es
register 1
}
define command {
command_name reiniciar_sic
command_line $USER2$/event_handler_servicio.sh -u:$USER4$ -H:server1.es -ss:$SERVICESTATE$ -sa:$SERVICEATTEMPT$ -i:$ARG1$ -s:$ARG2$ -m:$ARG3$ -e:$ARG4$ -sd:"$SERVICEDESC$"
}
Code: Select all
define service {
host_name Aplicaciones
service_description server1.es/AppWS
use aplicacionesexp-service
servicegroups aplicacionesexp-servicegroup
check_command check_http!"server1.es"!"/AppWS"
event_handler reiniciar_sic
register 1
}
define command {
command_name reiniciar_sic
command_line $USER2$/event_handler_servicio.sh -u:$USER4$ -H:server1.es -ss:$SERVICESTATE$ -sa:$SERVICEATTEMPT$ -i:1 -s:tomcat7 -m:sic -e:user1@domain.es -sd:"$SERVICEDESC$"
}
Regards!