Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/datasources/WeatherMapDataSource_cactithold.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ function ReadData($targetstring, &$map, &$item)
// use target aggregation to build these up into a 'badness' percentage
// takes the same two values that are visible in thold's own URLs (the actual thold ID isn't shown anywhere)

$rra_id = intval($matches[1]);
$data_id = intval($matches[2]);
$local_data_id = intval($matches[1]);
$data_template_rrd_id = intval($matches[2]);

$SQL2 = "select thold_alert from thold_data where rra_id=$rra_id and data_id=$data_id and thold_enabled='on'";
$SQL2 = "select thold_alert from thold_data where local_data_id=$local_data_id and data_template_rrd_id=$data_template_rrd_id and thold_enabled='on'";
$result = db_fetch_row($SQL2);
if(isset($result))
{
Expand Down Expand Up @@ -179,13 +179,13 @@ function ReadData($targetstring, &$map, &$item)
wm_debug("CactiTHold ReadData: Checking threshold states for host $id\n");
$numthresh = 0;
$numfailing = 0;
$SQL2 = "select rra_id, data_id, thold_alert from thold_data,data_local where thold_data.rra_id=data_local.id and data_local.host_id=$id and thold_enabled='on'";
$SQL2 = "select local_data_id, data_template_rrd_id, thold_alert from thold_data,data_local where thold_data.local_data_id=data_local.id and data_local.host_id=$id and thold_enabled='on'";
# $result = db_fetch_row($SQL2);
$queryrows = db_fetch_assoc($SQL2);
if( is_array($queryrows) )
{
foreach ($queryrows as $th) {
$desc = $th['rra_id']."/".$th['data_id'];
$desc = $th['local_data_id']."/".$th['data_template_rrd_id'];
$v = $th['thold_alert'];
$numthresh++;
if(intval($th['thold_alert']) > 0)
Expand Down
2 changes: 1 addition & 1 deletion lib/datasources/WeatherMapDataSource_rrd.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function wmrrd_read_from_real_rrdtool_aggregate($rrdfile,$cf,$aggregatefn,$start
$args[] = "graph";
$args[] = "/dev/null";
$args[] = "-f";
$args[] = "''";
$args[] = "'%s %lu %lu'";
$args[] = "--start";
$args[] = $start;
$args[] = "--end";
Expand Down