If a contact defined with such as xi_host_notification_handler" and "xi_service_notification_handler" commands, then the standard email notification will have the Response URL in the message content.
I have the following command defined for qpage notification and it worked.
/usr/bin/printf "Service: %s\nHost: %s\nAddress: %s\nState: %s\nInfo: %s\nDate: %s" '$SERVICEDESC$' '$HOSTNAME$' '$HOSTADDRESS$' '$SERVICESTATE$' '$SERVICEOUTPUT$' '$LONGDATETIME$' | /usr/local/bin/qpage -l 0 -p $CONTACTPAGER$ -s <qpage-server>
I would like to add the Response URL to the Qpage notification message. May I know the variable name referring to response_url which can be used in custom notification?
Thanks
Add Response URL to custom notification commands
-
westernuniv
- Posts: 120
- Joined: Tue Aug 21, 2012 9:29 am
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Add Response URL to custom notification commands
This is not possible without creating it in the custom handler.
This is created in the XI Event Notification
This is created in the XI Event Notification
-
westernuniv
- Posts: 120
- Joined: Tue Aug 21, 2012 9:29 am
Re: Add Response URL to custom notification commands
Ok, Thanks
The response URL is something like this…
Respond: https://<nagios-host>/nagiosxi//rr.php?uid=49-326-6afb870716f6ee5896167299877d028b
And the xi_service_notification_handler defined as below, May I know which variable below representing the uid in the above URL?
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$"
Thanks
The response URL is something like this…
Respond: https://<nagios-host>/nagiosxi//rr.php?uid=49-326-6afb870716f6ee5896167299877d028b
And the xi_service_notification_handler defined as below, May I know which variable below representing the uid in the above URL?
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$"
Thanks
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Add Response URL to custom notification commands
None of these represent it. it is built internally and is complex (on purpose)..but I will break it down for you
49-326-6afb870716f6ee5896167299877d028b
49 = user_id (has to be an XI user id)
326 = object_id of the host/service to open
6afb870716f6ee5896167299877d028b = md5 hash of the use users backend API ticket for the user (from the backend API component)
49-326-6afb870716f6ee5896167299877d028b
49 = user_id (has to be an XI user id)
326 = object_id of the host/service to open
6afb870716f6ee5896167299877d028b = md5 hash of the use users backend API ticket for the user (from the backend API component)
-
westernuniv
- Posts: 120
- Joined: Tue Aug 21, 2012 9:29 am
Re: Add Response URL to custom notification commands
Oh, it's really complex. I'll give up the idea of having Response URL int he qpage message.
Thanks alot
Thanks alot