Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon May 22, 2017 2:41 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Thold 0.5.1 Baseline ReAlerts error log
PostPosted: Fri Jul 01, 2016 2:34 am 
Offline

Joined: Fri Jul 01, 2016 1:59 am
Posts: 3
Hi,

I'm using thold 0.5.1 and using the baseline functionality. I'm now receiving error logs of Division by zero in /usr/share/cacti/site/plugins/thold/thold_functions.php on line 1708 which has a code:

line 1708
/* re-alert? */
$ra = ($item['bl_fail_count'] > $bl_fail_trigger && ($item['bl_fail_count'] % ($item['repeat_alert'] == '' ? $realert : $item['repeat_alert']) ) == 0);

The division by zero was triggered if I selected "NEVER" in the Re-Alert Cycle in the thold template. Setting other options other than "NEVER" will not trigger this division by zero error.

Also receiving Undefined variable: subject in /usr/share/cacti/site/plugins/thold/thold_functions.php on line 1764 pointing to the thold_log array "description". Variable $subject seems to be undefined since the $subject values is under the if conditions.

} else {
thold_log(array(
'type' => 1,
'time' => time(),
'host_id' => $item['host_id'],
'graph_id' => $graph_id,
'threshold_id' => $item['id'],
'threshold_value' => ($breach_up ? $item['thold_hi'] : $item['thold_low']),
'current' => $currentval,
'status' => ST_TRIGGERA,
'description' => $subject,
'emails' => $alert_emails));
}

fixed this by

adding this in line 1710 before the IF statement:

$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";


and commented line 1715 inside the IF statement:

// $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";


I don't know if this is the correct behavior since thold 0.5.0 and 0.6.0 contains the same code under the baseline re-alerts.


Thank you,


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group