How to make notification when some conditions written by user are true.
I have one table DATA which has 3 rows.
name value ---- ----- a1 10 a2 20 a3 30
This table changes some values every 1-10 minutes.
Example: a1=12 , a2=21
a2>20 send me some message.
Question: How to check when a value in DATA fulfils the conditions in alert, and then my php/python environment takes any action on this alarm?
- After update on DATA table run trigger that will check if ALERT exist and set active on it (how to check when DATA id a1=12 and then check if there is some alert like a1>11)
- Run every 1 minute process that checks if ALERT is active and execute it.
I don't now where to start...
I will use: PostgreSQL, php, cron