I have Nagios setup and e-mail notifications are being sent successfully, however, currently notifications don't tell me which host is having problems.
I have multiple servers running, and would like to have notifications tell me specifically which server is down/having trouble.
So basically, how do I add the HOSTNAME to notification content?
Any advice would be greatly appreciated, thanks!
How to show HOSTNAME in service notifications?
-
- Posts: 10
- Joined: Tue Jun 30, 2015 2:17 pm
Re: How to show HOSTNAME in service notifications?
You will need to modify your notify-service-by-email command (or whichever command you have set) to include the $HOSTADDRESS$ macro.
Former Nagios employee
-
- Posts: 10
- Joined: Tue Jun 30, 2015 2:17 pm
Re: How to show HOSTNAME in service notifications?
Thanks so much for the quick reply.
Could you confirm where I set the variables, such as: $HOSTADDRESS$. Or are they globally set by nagios and stay the same for everyone?
Could you confirm where I set the variables, such as: $HOSTADDRESS$. Or are they globally set by nagios and stay the same for everyone?
Re: How to show HOSTNAME in service notifications?
That is a macro, and is set by Nagios on a per-object basis. So if you have a host with the address of 192.168.1.100 and a service is attached to it, both the host and the service will have access to that value in the macro. This can be used in notification commands, event handlers, etc.
Former Nagios employee
-
- Posts: 10
- Joined: Tue Jun 30, 2015 2:17 pm
Re: How to show HOSTNAME in service notifications?
You are quite welcome.
I'll be closing this thread now, but feel free to open another if you need anything in the future!
I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee