Different message by device instead of user

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sstrudwick
Posts: 2
Joined: Thu Jun 29, 2017 3:15 pm

Different message by device instead of user

Post by sstrudwick »

I have many different type of devices and would like to have a special message based on device instead of by user. I am still in evaluation mode and this would be huge for me. Is this possible? I have looked at notification settings and know that there are templates but from what I am finding is that the messages are based on user. example would be "IT support" gets alerts for remote site connectivity. I would like this to be specific messages based on remote site. "IT Support" also gets alerts based on servers. I would like the message to basically be a list of basic how to's based on the server/service type.

If this is possible can you point me to a document that explains this.

Thanks in advance.

Scott
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Different message by device instead of user

Post by dwhitfield »

You can set up different commands for each type of device.

Here's the default notify-host-by-email command:

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
But, you could turn that into as many as you want (you know, given space limits). The following two are simple, but illustrate the point:

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "DEVELOPERS DEVELOPERS DEVELOPERS ** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "GNU SLASH LINUX ** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
You can learn more about the variables at https://assets.nagios.com/downloads/nag ... olist.html

It's ***VERY*** important that you understand the following: https://assets.nagios.com/downloads/nag ... ntacts.pdf
sstrudwick
Posts: 2
Joined: Thu Jun 29, 2017 3:15 pm

Re: Different message by device instead of user

Post by sstrudwick »

Thanks for the direction. I am working on that now.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Different message by device instead of user

Post by tmcdonald »

Let us know if you need more help!
Former Nagios employee
Locked