Hello…
I have written a perl script and droped it into /usr/bin/ and named it nag_sms which is a script i have written to send data to our sms text server.
I have added the following to the miscommands.cfg
‘host-notify-by-sms’ command definition
define command{
command_name host-notify-by-sms
command_line usr/bin/nag_sms ‘$HOSTNAME$’ ‘$HOSTSTATE$’ ‘$HOSTADDRESS$’ ‘$CONTACTEMAIL$’ ‘$DATETIME$’
}
‘notify-by-sms’ command definition
define command{
command_name notify-by-sms
command_line usr/bin/nag_sms ‘$HOSTNAME$’ ‘$HOSTSTATE$’ ‘$HOSTADDRESS$’ ‘$CONTACTEMAIL$’ ‘$DATETIME$’
}
I have added the following to the contacts.cfg
‘Flandercan’ contact definition
define contact{
contact_name flanderp_sms
alias flanderp_sms
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-sms
host_notification_commands host-notify-by-sms
email
}
i have then added flanderp_sms to the admin group and when i watch the log file i see the following
[1109003952] SERVICE NOTIFICATION: flanderp_sms;ned-linux;PING;OK;notify-by-sms;PING OK - Packet loss = 0%, RTA = 0.36 ms
The command seems to run perfect, however it doesnt actually run the script.
If from the command line i type
usr/bin/nag_sms ‘$HOSTNAME$’ ‘$HOSTSTATE$’ ‘$HOSTADDRESS$’ ‘$CONTACTEMAIL$’ ‘$DATETIME$’
The script runs and does what it should
where have i gone wrong
any help much appres
thanks
Paul