Send Conditional Notice Route

There are two SMS devices. Notification to xy@sms-gw1.local OR xy@sms-gw2.local, by default sms-gw1.local, but if it doesn’t work (doesn’t respond to ping) then it should be sms-gw2.local (postfix transport) based on the recipient’s domain, which device it sends to)

Icinga2 monitors both devices. How can I fix if sms-gw1.local doesn’t work then send the notification to xy@sms-gw2.local?

Hi, it would be easier for us to help you, if you would Show us your notification-script for that and also how your configuration in icinga2 Looks like.

But my first idea is, you should check this in your notification script.
But If it does not work in General: take a look into your (local) firewall rules. Maybe they are not allowed to communicate together.

I guess I would also handly this either in the script or add a HTTP check (see check_http for example) to icinga that checks if the SMS-Gateways are available. In that case Icinga takes care of testing the connectivity, handling retries, etc. and your notification script can just check if the service for GW1 is OK, if not if the service for GW2 is ok and just skip the actual HTTP requests to the gateway if none of both is ok.

Best,
Marcel

Hello
Solved.
Postfix transport with “internal” DNS

I added a zone with two MX records in it, so I already bridged the gap in postfix transport

1 Like