I’ve written a small script used to send email out of Nagios. I want to pass a parameter to this script that indicates if the email should be high or normal priority.
My contacts are all derived from this template.
define contact{
name generic-contact
service_notification_commands notify-service-email
host_notification_commands notify-host-email
}
The check command is
define command{
command_name notify-host-email
command_line /usr/bin/perl /usr/lib/nagios/plugins/send_email.pl \
--smtp <My Host> --from "[email protected]" --email "$CONTACTEMAIL$" \
--subject "$HOSTADDRESS$ $HOSTSTATE$" \
--body "$HOSTADDRESS$: $HOSTSTATE$ \n$HOSTOUTPUT$\n$LONGHOSTOUTPUT$\n$NOTIFICATIONCOMMENT$" \
<whatever I need for a priority to pass>
}
The script works but I don’t have any idea how to pass something from a specific service or host check all the way back to this point or if it even possible. Please help.