Skip to content

Commit

Permalink
Fixing issue #34 - poller_graphs.php returns no data
Browse files Browse the repository at this point in the history
* Multiple HMIB errors with Graphing function returning no data.
* This is a second attempt to catch the second instance of errors.
  • Loading branch information
TheWitness committed Mar 17, 2024
1 parent 5f2c524 commit bc20b8d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion poller_graphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,25 @@ function add_summary_graphs($host_id, $host_template) {
' --graph-type=cg' .
' --host-id=' . $host_id;

print str_replace("\n", ' ', passthru($command)) . "\n";
$output = array();
$return_code = 0;
$timeout = 20;

exec_with_timeout($command, $output, $return_code, $timeout);

if ($return_code == 0) {
if (cacti_sizeof($output)) {
print implode(PHP_EOL, $output);
} else {
print 'Graph command completed sucessfully without returning any data.' . PHP_EOL;
}
} else {
print 'Graph command completed with errors.' . PHP_EOL;

if (cacti_sizeof($output)) {
print implode(PHP_EOL, $output);
}
}
}
}
}
Expand Down

0 comments on commit bc20b8d

Please sign in to comment.