Maybe someone is trying to solve a similar problem.
I made it by adding a variable
to "Free Variable" in required service, changing xi_service_notification_handler in "Commands" from
Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" ...
to
Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service sendsms=$_SERVICESENDSMS$ ...
(change _SERVICESENDSMS$ to HOSTSENDSMS$ in host case)
Changing email-to-sms subject to
In than case if I will add variable "_sendsms on" in "free variavle" of a service, the subject of e-mail will be "sms on", if not -> "sms $"
And removing all messages with subject "sms $" by Postfix ba adding
to /etc/postfix/header_checks (dont foget uncomment header_checks from main.cf)
So postfix deletes unnecessary messages.