Code: Select all
/usr/bin/printf "%b" "Nagios Says: $SERVICEDESC$ on $HOSTALIAS$ is: $SERVICESTATE$ $LONGDATETIME$ Info is: $SERVICEOUTPUT$" | /usr/local/bin/sendsms $CONTACTPAGER$This results with an SMS that tries to reach the destination "$", which of course fails.
Also tried using:
Code: Select all
/usr/local/bin/sendsms $CONTACTPAGER$ "$LONGDATETIME$ ** $NOTIFICATIONTYPE$ $HOSTALIAS$ Service Alert: $SERVICEDESC$ is $SERVICESTATE$ **"What am I missing?
Edit: Using
Code: Select all
/usr/local/bin/sendsms $CONTACTPAGER$ "$LONGDATETIME$ ** $NOTIFICATIONTYPE$ $HOSTALIAS$ Service Alert: $SERVICEDESC$ is $SERVICESTATE$ **"Contact:
Code: Select all
define contact {
contact_name testmobil
alias test
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r,f,s,n,
service_notification_options w,u,c,r,f,s,n,
host_notification_commands notify_by_mobile
service_notification_commands notify_by_mobile
can_submit_commands 1
retain_status_information 1
retain_nonstatus_information 1
pager +4676#######
}
Code: Select all
define command {
command_name notify_by_mobile
command_line /usr/local/bin/sendsms +4676####### "$LONGDATETIME$ ** $NOTIFICATI\
ONTYPE$ $HOSTALIAS$ Service Alert: $SERVICEDESC$ is $SERVICESTATE$ **"
}