]> git.pld-linux.org Git - packages/cacti-plugin-thold.git/blob - cacti-plugin-thold-undefined_variable_subject.patch
dc787342308452bf020f39362073f08e00e4973b
[packages/cacti-plugin-thold.git] / cacti-plugin-thold-undefined_variable_subject.patch
1 diff -dur cacti-plugin-thold-0.4.9.orig/thold/thold_functions.php cacti-plugin-thold-0.4.9/thold/thold_functions.php
2 --- cacti-plugin-thold-0.4.9.orig/thold/thold_functions.php     2011-11-12 19:29:49.000000000 +0100
3 +++ cacti-plugin-thold-0.4.9/thold/thold_functions.php  2012-12-10 08:37:38.000000000 +0100
4 @@ -1589,10 +1589,13 @@
5                         /* re-alert? */
6                         $ra = ($item['bl_fail_count'] > $bl_fail_trigger && ($item['bl_fail_count'] % ($item['repeat_alert'] == '' ? $realert : $item['repeat_alert'])) == 0);
7  
8 -                       if ($item['bl_fail_count'] == $bl_fail_trigger || $ra) {
9 +                       $notify = ($item['bl_fail_count'] == $bl_fail_trigger || $ra);
10 +
11 +                       $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";
12 +
13 +                       if ($notify) {
14                                 thold_debug('Alerting is necessary');
15  
16 -                               $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";
17  
18                                 if ($logset == 1) {
19                                         logger($item['name'], $breach_up, ($breach_up ? $item['thold_hi'] : $item['thold_low']), $currentval, $item['bl_fail_trigger'], $item['bl_fail_count'], $url);
20 @@ -2032,7 +2035,7 @@
21                 $syslog_facility = LOG_DAEMON;
22         }
23  
24 -       openlog('CactiTholdLog', LOG_PID | LOG_PERROR, $syslog_facility);
25 +       openlog('CactiTholdLog', LOG_PID, $syslog_facility);
26  
27         if (strval($breach_up) == 'ok') {
28                 syslog($syslog_level, $desc . ' restored to normal with ' . $currentval . ' at trigger ' . $trigger . ' out of ' . $triggerct . " - ". $urlbreach);
This page took 0.037346 seconds and 2 git commands to generate.