Skip to content

Commit

Permalink
add device up/down status test for devices without poll items
Browse files Browse the repository at this point in the history
  • Loading branch information
xmacan committed Jan 11, 2024
1 parent 0d4d2d4 commit 8d6ee13
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions cmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,21 +520,17 @@
);

if (cacti_sizeof($hosts) > 0) {

cacti_log('NOTE: Found ' . cacti_sizeof($hosts) . ' device(s) for up/down testing only', true, 'POLLER', $medium);

foreach ($hosts as $host) {

$ping = new Net_Ping;
$ping->host = $host['id'];
$ping->port = $host['ping_port'];

// perform the appropriate ping check of the host
if ($ping->ping($host['availability_method'], $host['ping_method'], $host['ping_timeout'], $host['ping_retries'])) {

update_host_status(HOST_UP, $host['id'], $ping, $host['availability_method'], $print_data_to_stdout);
cacti_log("Device[" . $host['id'] ."] STATUS: Device '" . $host['hostname'] . "' is UP.", $print_data_to_stdout, 'POLLER', debug_level($host['id'], POLLER_VERBOSITY_MEDIUM));

} else {
update_host_status(HOST_DOWN, $host['id'], $ping, $host['availability_method'], $print_data_to_stdout);
cacti_log("Device[" . $host['id'] . "] STATUS: Device '" . $host['hostname'] . "' is Down.", $print_data_to_stdout, 'POLLER', debug_level($host['id'], POLLER_VERBOSITY_MEDIUM));
Expand Down

0 comments on commit 8d6ee13

Please sign in to comment.