Cacti / plugin_webseer

Cacti Web Services Monitoring Plugin
GNU General Public License v2.0
8 stars 9 forks source link

Site down email #1

Closed smiles1969 closed 7 years ago

smiles1969 commented 7 years ago

I am not able to get an email to send when a site is down. I see this is using the PHP Mail function, and have made sure I can send test emails from all methods successfully, so I don't think its a mail config issue on Cacti.

I am also not seeing anything in the cacti logs other than the SYSTEM STATS WEBSEER messages every 5 mins.

cigamit commented 7 years ago

More than likely this is due to the fact that thus far only the UI has been ported. It's still using the old mail API. Should be a quick migration to the PHPMailer though.

smiles1969 commented 7 years ago

In addition to the mailer issue, it seems there may be also an issue with the trigger logic in webseer_process.php:

             if ($host['failures'] >= $tf && $host['triggered'] == 0) {

To save you time debugging this, $host['failures'] never increments over 1 for successive polling cycles where the site stays down. In fact it's incrementing to 1 for the first down cycle, then goes back to 0 for all cycles after that.

Unless I'm not understanding how $tf is being calculated correctly??

Looking at the query for $host['failures'], Im not seeing multiple records for the test host, , so the count(url_id) is always returning 1, and 1 is never >= $tf (which is 5).

Hope this helps.

cigamit commented 7 years ago

This plugin is getting a major overhaul at the moment. Don't try to fix too much. More to follow.

cigamit commented 7 years ago

Also, when I first wrote the webseer plugin (over 7 years ago?), I had hard coded a 60 second polling interval into it, since that is what I always ran. I will need to update it to allow for other polling intervals now that it is public.

cigamit commented 7 years ago

This issue should be resolved now.

naterg commented 5 years ago

Same issue as Smiles1969 still. I'm running the Cacti default 300 sec polling interval. Setting the trigger time less than my polling interval will never trigger (bug?). Setting my trigger time = my polling interval also doesn't work because of the current logic in webseer_process.php line ~198

if ($url['failures'] >= $tf && $url['triggered'] == 0)