diff -dur cacti-plugin-thold-0.4.9.orig/thold/thold_functions.php cacti-plugin-thold-0.4.9/thold/thold_functions.php --- cacti-plugin-thold-0.4.9.orig/thold/thold_functions.php 2011-11-12 19:29:49.000000000 +0100 +++ cacti-plugin-thold-0.4.9/thold/thold_functions.php 2012-12-10 08:37:38.000000000 +0100 @@ -1589,10 +1589,13 @@ /* re-alert? */ $ra = ($item['bl_fail_count'] > $bl_fail_trigger && ($item['bl_fail_count'] % ($item['repeat_alert'] == '' ? $realert : $item['repeat_alert'])) == 0); - if ($item['bl_fail_count'] == $bl_fail_trigger || $ra) { + $notify = ($item['bl_fail_count'] == $bl_fail_trigger || $ra); + + $subject = ($notify ? "ALERT: " : "TRIGGER: ") . $item['name'] . ($thold_show_datasource ? " [$name]" : '') . ' ' . ($ra ? 'is still' : 'went') . ' ' . ($breach_up ? 'above' : 'below') . " calculated baseline threshold " . ($breach_up ? $item['thold_hi'] : $item['thold_low']) . " with $currentval"; + + if ($notify) { thold_debug('Alerting is necessary'); - $subject = "ALERT: " . $item['name'] . ($thold_show_datasource ? " [$name]" : '') . ' ' . ($ra ? 'is still' : 'went') . ' ' . ($breach_up ? 'above' : 'below') . " calculated baseline threshold " . ($breach_up ? $item['thold_hi'] : $item['thold_low']) . " with $currentval"; if ($logset == 1) { logger($item['name'], $breach_up, ($breach_up ? $item['thold_hi'] : $item['thold_low']), $currentval, $item['bl_fail_trigger'], $item['bl_fail_count'], $url);