Page 1 of 1

Notification Issues (SMS)

Posted: Mon Jul 15, 2024 4:56 am
by jamie87
Hi,

I have added a service to monitor that i can enable/disable to test notifications but having a little fun with it that someone can hopefully help me with.

Email Notifications are coming through to me fine for both Host and Service however SMS notifications only come through for Host notifications.

1. I created a script to send SMS' on the server
2. Created a command in CCM called "notify-host-by-sms"
3. Updated my contact to include notify-host-by-sms in the host notifications

This works, but when doing the same for a new command called "notify-service-by-sms" i don't get service notifications via SMS?

I added the notify-service-by-sms to my contacts manage service notification commands.
Do i need to do something else to make this work for Service Notifications?

If i add the notify-host-by-sms into the service alert commands, i get SMS alerts but they currently just say "PROBLEM Host Alert - MY-SERVER-01 is UP" as its configured with "Host" vaiables rather than "Service" variables

The command for the alerts are:
Host Alert

Code: Select all

/usr/local/bin/send_sms.sh "$CONTACTPAGER$" "Host Alert: $HOSTALIAS$ is $HOSTSTATE$ - Info: $HOSTOUTPUT$"
Service Alert

Code: Select all

/usr/local/bin/send_sms.sh "$CONTACTPAGER$" "Service Alert: $SERVICEDESC$ on $HOSTALIAS$ is $SERVICESTATE$
Regards,
Jamie

Re: Notification Issues (SMS)

Posted: Mon Jul 15, 2024 6:09 am
by jamie87
Got it working, it was an issue with my SMS script, not sure why hosts worked but services didn't be i needed to wrap a couple variables in quotes, since that, it's working great.

Re: Notification Issues (SMS)

Posted: Mon Jul 15, 2024 9:22 am
by sgardil
jamie87 wrote: Mon Jul 15, 2024 6:09 am Got it working, it was an issue with my SMS script, not sure why hosts worked but services didn't be i needed to wrap a couple variables in quotes, since that, it's working great.
I'm glad you figured it out. The reason why services didnt work and hosts did, at least from the scripts you posted, is because of the quotes wrapping. You're service line had a starting quotation however it didn't have the wrapping quote needed. Those are always fun to troubleshoot if you don't catch them right away. Let us know if we can help with anything else.