Page 1 of 1
Alert enrichment
Posted: Thu May 09, 2013 2:33 am
by gosmart
Hi!
I am looking for a way to enrich the information about particular alert (eg. with equipment location, id of trouble ticket created etc.)
I have found the way to add service or host variables with external commands, but nothing about alerts (problems).
Am I missing something?
Re: Alert enrichment
Posted: Thu May 09, 2013 9:52 am
by slansing
One way to do this would be to modify the commands used for mailing notifications.
They currently should look similar to the following:
Code: Select all
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Following the protocol of using standard macro's you could add "for instance" the $HOSTNOTES$ macro:
$HOSTNOTES$ Notes for the host. This macro may contain other macros (e.g. $HOSTNAME$), which can be useful when you want to host-specific status information, etc. in the description.
These macro's can all be found in the following list:
http://nagios.sourceforge.net/docs/3_0/ ... #hostnotes
Is this a possibility for you? If not let us know and we can brain storm some more.
Re: Alert enrichment
Posted: Fri May 10, 2013 2:03 am
by gosmart
Thanks for help. For that, event handlers can be used too.
I didn't explain well.
I would like to enrich alarm in Nagios with additional details.
I have found only how to add host or service variables, but not alarm variables.
Eg. CHANGE_CUSTOM_HOST_VAR
http://old.nagios.org/developerinfo/ext ... and_id=139
Re: Alert enrichment
Posted: Fri May 10, 2013 10:43 am
by slansing
Hello gosmart, as opposed to the XI notification variables:
http://assets.nagios.com/downloads/nagi ... iables.pdf
Nagios core has a bit smaller list:
http://nagios.sourceforge.net/docs/3_0/macrolist.html
However many of the normal macro's can be used, as shown on my first post where the notification commands were placed, you can see variable macro's such as $HOSTADDRESS$ and $HOSTSTATE$ being used to pull information.
Re: Alert enrichment
Posted: Fri May 10, 2013 11:43 am
by gosmart
I am not looking for customization of alert notification, but alert itself in Nagios GUI. XI would be fine too, if such thing is supported.
Re: Alert enrichment
Posted: Fri May 10, 2013 3:14 pm
by sreinhardt
So you would like some form of a popup? I think we need more details as to what you mean by enriching alerts. what exactly do you want to see happening?
Re: Alert enrichment
Posted: Tue May 14, 2013 3:30 am
by gosmart
Hi!
Sorry for not replying earlier. Busy time.
I had in mind something like on attached picture,
but popup with additional fields would be fine.
Re: Alert enrichment
Posted: Tue May 14, 2013 9:55 am
by slansing
Currently there is no documented way to add additional columns in the Service / Host / Details Page's, though this is something highly requested. If you are interested, you can also add in a feature request at
http://tracker.nagios.org