From 55544b113216637a881333c57133028ed4066aa3 Mon Sep 17 00:00:00 2001 From: Sean Mancini Date: Tue, 17 Sep 2024 16:37:45 -0400 Subject: [PATCH 1/2] Update remove_device.php Add logging to cacti log upon removal --- cli/remove_device.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli/remove_device.php b/cli/remove_device.php index 0c9c8ece0..202212367 100755 --- a/cli/remove_device.php +++ b/cli/remove_device.php @@ -173,8 +173,11 @@ foreach ($hosts as $host) { printf('%8.d | %30.s | %30.s' . PHP_EOL,$host['id'],$host['hostname'],$host['description']); $ids_found[] = $host['id']; + $ids_details = $host['id'] . ' - ' . $host['hostname'] . ' - ' . $host['description']; } + + print PHP_EOL; } @@ -191,6 +194,10 @@ exit(1); } else { print "Success - removed device-ids: $ids_confirm" . PHP_EOL; + foreach ($hosts as $host) { + cacti_log("CLI: Device Removed via remove_device.php - Device ID: " . $host['id'] . ", Hostname: " . $host['hostname'] . ", Description: " . $host['description']); + } + exit(0); } } else { From 941c8f5d797d046a1385882f2a14b0d99208362e Mon Sep 17 00:00:00 2001 From: Sean Mancini Date: Tue, 17 Sep 2024 16:39:26 -0400 Subject: [PATCH 2/2] Update remove_device.php --- cli/remove_device.php | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/remove_device.php b/cli/remove_device.php index 202212367..73b5c5fac 100755 --- a/cli/remove_device.php +++ b/cli/remove_device.php @@ -173,7 +173,6 @@ foreach ($hosts as $host) { printf('%8.d | %30.s | %30.s' . PHP_EOL,$host['id'],$host['hostname'],$host['description']); $ids_found[] = $host['id']; - $ids_details = $host['id'] . ' - ' . $host['hostname'] . ' - ' . $host['description']; }