Feature Request: Event Handler parameters

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
iam33
Posts: 58
Joined: Mon Mar 18, 2013 5:30 am

Feature Request: Event Handler parameters

Post by iam33 »

Hi! thanks in advance!

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$"
	}
NEW- with Nagios XI :

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!
User avatar
ajcoil
Posts: 49
Joined: Wed Aug 09, 2023 10:30 am

Re: Feature Request: Event Handler parameters

Post by ajcoil »

Hi @iam33,

Thank you for your feedback!

I will put in a feature request for the ability to pass parameters to event_handler commands.
Post Reply