The default format for alert messages is:
** RECOVERY Host Alert: server is UP ** ***** Nagios ***** Notification Type: RECOVERY Host: server State: UP Address: server.ru Info: PING OK - Packet loss = 0%, RTA = 26.00 ms Date/Time: Thu Aug 13 17:08:16 MSD 2009
I want maximum information in minimum letters. First, to be able to get information from SMS. Second, to read only the headers of e-mail messages in 90% cases.
For example, the previous message can be just "H: server is UP
" where H stands for Host Alert
. If this server is down, I would like to get such a message: [!] H: server is DOWN
.
Instead of message, that "Swap usage on server is CRITICAL" I would like to get "[!] S: server/swap usage is >50%" where 50 was taken from the nagios config for check_swap, not hardcoded into the message.
And if "Router/wan2 is CRITICAL", I want to see "ADSL channel is off".
So, to summarize, I want to customize message for every service and its state separately, with ability to use plugin parameters in text.
How can I achieve this?
Nagios can be configured to send notifications by various ways and in various formats. If you need to personalize that please refer to your commands.cfg.
This is an example to show you how to receive a short notification by sms using gnokii:
The output is like this "hostname is up"
There are several aggregate addons for nagios that, in addition to allowing you to specify shorter alerts, will combine several alerts into 1 page, so that you don't get paged 200 times when lots of things go down at once.
Two good ones are:
Alerts look something like this from nans (but can be customized of course)
Also, if you need more flexibility, think of putting a bash script in between nagios and you. This can let you send out messages with greater flexibility, for example you don't want recovery emails sent to your automated ticket creator.