Cant send sms notification

Hello for the best community
I have that i cant receive SMS notification to my mobile phone
My superior gived me a getway created with our VOIP direction , its work normaly for PRTG but when i added to icinga i cant receive any notification
here is url that he gived me

http://sms.icosnet.com:8080/bulksms/bulksms?username=theusername&password=thepassword&type=0&dlr=1&destination=%SMSNUMBER&source=213982400300&message=%SMSTEXT
i have configure the notification for sms in notification.conf

apply Notification “sms-notification” to Host {
import “sms-host-notification”
user_groups = host.vars.notification.sms.groups
users = host.vars.notification.sms.users
interval = 0
assign where host.vars.notification.sms
}

my template.conf file :

template Notification “sms-host-notification” {
command = “sms-host-notification”

states = [ Down]
types = [ Problem, Acknowledgement, Recovery, Custom, FlappingStart,
FlappingEnd, DowntimeStart, DowntimeEnd, DowntimeRemoved ]
interval = 0
period = “24x7”
}

i want to Apply notification only for a specific service :

apply Service “GE02-A06-SE02” {
import “generic-service”
check_command = “snmpv3”
vars.snmpv3_address = “x.x.x.x”
vars.snmpv3_user = “icingamonitoring”
vars.snmpv3_oid = “my-oid”
vars.snmpv3_seclevel = “authPriv”
vars.snmpv3_auth_key = “Mypass”
vars.snmpv3_priv_key = “Mypass”
vars.snmpv3_priv_alg = “DES”
vars.snmpv3_auth_alg = “SHA”
vars.snmpv3_warn = 1
vars.snmpv3_crit = 1
vars.sms_phone = “213770840511”
assign where host.vars.agent_type == “snmpv3”
vars.notification[“mail”] = {
groups = [ “icingadatacenters” ]
users = [“icingadatacenter”]
}
vars.notification[“sms”] = {
groups = [ “icingadatacenters” ]
users = [ “icingadatacenter” ]
}
}


and i modified the script with My getway

#!/bin/sh
template=$(cat <<TEMPLATE
$NOTIFICATIONTYPE-$HOSTDISPLAYNAME-is-$HOSTSTATE
TEMPLATE
)

/usr/bin/curl --output “/var/log/icinga2/smslog” “http://sms.icosnet.com:8080/bulksms/bulksms?username=theusername&password=thepassword&type=0&dlr=1&destination=213770XXXXX&source=213982400300

any advices ? whats i’m making it wrong ?

Thank you .

Hello , Any News guys , i really need it urgent :slight_smile:

Modify the script to write a log locally and see if it is at all being executed. If not then the apply rule has an issue. Start with small.

icinga2 object list --type=notification

See if you can see the apply rule is at all applied on the Object specified

Hello ,
Here is the output of my command

[root@icingamaster ~]# icinga2 object list --type=notification | grep ‘sms’
Object ‘icingamaster.icosnetcloud.com!sms-notification’ of type ‘Notification’:

  • __name = “icingamaster.icosnetcloud.com!sms-notification”
  • command = “sms-host-notification”
  • name = “sms-notification”
  • templates = [ “sms-notification”, “sms-host-notification” ]

i have applied that to specific service and that service is not showing up on the command ? what’s wrong in that ?

Start small. Your apply rule is very complex. See if simple apply rule sends notification

apply Notification "Notification-Apply" to Service {
import "Notification-Template"
assign where match("Service_Name*", service.display_name)
states = [ Critical, Warning ]
types = [ Problem, Recovery ]
users = [ "icingauser" ]

}

Hello
The State and type are not part of notification.conf beceause i tried to add them and the error is displaying anytime that i add theme
I dont know where is the problem with my apply notification rules and i cant receive SMS notification
Thanks for your time
i hope i can get a solution to my issue
Thanks you