Info |
---|
This document provides steps on how to setup an Email alert when a production Iguana’s channels are down/off. Note: we assume you have basic knowledge on how to setup From Translator. All code below is intended for demo purpose. |
The main idea is to utilize a From Translator polling channel to log a warning whenever a channel is down and for Iguana Monitoring to watch for such logs and send an email whenever a these logs come in.
...
From the dashboard, add a new From-Translator channel (for this example, I will call it Channel Monitor) with a From Translator component and for the Destination you can select to To Channel (you can leave it empty).
Select a Update the poll time (default is 10 seconds) under Source in the channel settings appropriate to your email monitoring needs.
Input the following snippet of code in the translator, the code works as follows:
It uses the iguana.status() API to retrieve the Iguana status (which includes channel status) and parse the data.
Next it will check for any stopped channels.
Finally it will log a warning message using iguana.logWarning with a header and the names of the channels. (The header will be used in Iguana monitoring to detect the warnings).
...