etsy / 411

An Alert Management Web Application
https://demo.fouroneone.io
MIT License
969 stars 112 forks source link

Improvement: Add time constraint to search #61

Closed AGirin closed 7 years ago

AGirin commented 7 years ago

We have a lot of custom scripts that we use to search Elasticsearch and alert on various events. 411 would be great replacement for this but we need time constraint in our search - let's say we have monitoring for elasticsearch not having events from some source. But we only want to alert on this during production hours. It is easy to do with a python script. It would be great to have such functionality in 411.

kasperbrandenburg commented 7 years ago

Couldn't you just configure this on the cronjob running the saved alerts? I guess that would work.

AGirin commented 7 years ago

Good point. I did not think about using cron at all. Let me try that.

kiwiz commented 7 years ago

That would work. I'd advise running cron.php during work hours (or whatever times you'd like) and running worker.php every minute.

AGirin commented 7 years ago

@kiwiz - are you referring to this cron command?

/var/www/411/bin/cron.php > /dev/null 2>&1 && /var/www/411/bin/worker.php > /dev/null 2>&1

Coud you give me a little bit more info on what this command actually does?

kiwiz commented 7 years ago

Yup. The cron.php script is responsible for scheduling jobs in 411. It sounds like you want to limit this to work hours. The worker.php script is responsible executing jobs. Currently, only cron.php does this. However, if this ever changes, running worker.php every minute ensures jobs will get completed outside work hours.