Alert enrichment

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gosmart
Posts: 4
Joined: Thu May 09, 2013 2:24 am

Alert enrichment

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Alert enrichment

Post 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.
gosmart
Posts: 4
Joined: Thu May 09, 2013 2:24 am

Re: Alert enrichment

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Alert enrichment

Post 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.
gosmart
Posts: 4
Joined: Thu May 09, 2013 2:24 am

Re: Alert enrichment

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Alert enrichment

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
gosmart
Posts: 4
Joined: Thu May 09, 2013 2:24 am

Re: Alert enrichment

Post by gosmart »

Hi!

Sorry for not replying earlier. Busy time.
I had in mind something like on attached picture,
nagiosProblemEnrichment.JPG
but popup with additional fields would be fine.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Alert enrichment

Post 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
Locked