Cacti / plugin_syslog

Syslog Plugin for Cacti
GNU General Public License v2.0
21 stars 16 forks source link

The syslog alert email is not sent if the Reporting Method is set to threshold. #128

Closed kim-fitness closed 3 years ago

kim-fitness commented 4 years ago
  1. Navigate to page Syslog Settings -> Alert Rules.
  2. Add a new role, and set the 'Reporting Method' as 'Threshold'.
  3. Set the Re-Alert Cycle to any options other than 'Not Set'.
  4. Check the log file, only following log exists, "SYSLOG WARNING: The Syslog Intance Alert 'xxx' with Severity 'xxx', has been Triggered, Count was 'x', and Sequence 'xxx'".
  5. Can not find log "MAILER INFO: Mail successfully sent via PHP Mail() Function from 'xxx', to 'xxx', cc '', Subject 'xxx'".
  6. There is no mail be sent.
kim-fitness commented 4 years ago

Root cause: The following SQL is called after called function syslog_log_alert, which makes the $found always bigger than 0.

$found = syslog_db_fetch_cell('SELECT count(*)
    FROM syslog_logs
    WHERE alert_id=' . $alert['id'] . "
    AND logtime>'$date'");