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
Different message by device instead of user
-
sstrudwick
- Posts: 2
- Joined: Thu Jun 29, 2017 3:15 pm
-
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
You can set up different commands for each type of device.
Here's the default notify-host-by-email command:
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:
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
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$
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$
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
Thanks for the direction. I am working on that now.
Re: Different message by device instead of user
Let us know if you need more help!
Former Nagios employee