Specify actual values in SMS Alerts
Posted: Wed Nov 02, 2016 1:08 pm
Hi,
I am using Nagios 4.2.0 version in production. I get sms saying it is critical but does not tell how much disk space is consumed. is there a way to specify values in the sms text messages?
For example hard disk space is critical and it should specify value how much disk space is remaining. In the SMS alert it should specify value like :- Current Disk used is 98GB.
is it done using SERVICEOUTPUT or LONGSERVICEOUTPUT as per https://assets.nagios.com/downloads/nag ... olist.html. Any examples to understand the usage of SERVICEOUTPUT or LONGSERVICEOUTPUT or is there a better way to handle it.
My command line to send sms is as follows.
#command_name notify-service-by-sms
define command{
command_name notify-service-by-sms
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$ \nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | wget "http://smsgatewayprovider/HttpLink?uid= ... $&message='** $NOTIFICATIONTYPE$ Service Alert: $SERVICEDESC$ on $HOSTNAME$ State: $SERVICESTATE$ @ $LONGDATETIME$ **'&signature=PROD"
}
Any help will be highly appreciable.
Thanks in Advance
Regards,
Kaushal
I am using Nagios 4.2.0 version in production. I get sms saying it is critical but does not tell how much disk space is consumed. is there a way to specify values in the sms text messages?
For example hard disk space is critical and it should specify value how much disk space is remaining. In the SMS alert it should specify value like :- Current Disk used is 98GB.
is it done using SERVICEOUTPUT or LONGSERVICEOUTPUT as per https://assets.nagios.com/downloads/nag ... olist.html. Any examples to understand the usage of SERVICEOUTPUT or LONGSERVICEOUTPUT or is there a better way to handle it.
My command line to send sms is as follows.
#command_name notify-service-by-sms
define command{
command_name notify-service-by-sms
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$ \nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | wget "http://smsgatewayprovider/HttpLink?uid= ... $&message='** $NOTIFICATIONTYPE$ Service Alert: $SERVICEDESC$ on $HOSTNAME$ State: $SERVICESTATE$ @ $LONGDATETIME$ **'&signature=PROD"
}
Any help will be highly appreciable.
Thanks in Advance
Regards,
Kaushal