From b5984d49a808cc29cfb2b7cb60664f2959428938 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 24 Jul 2023 19:59:19 -0400 Subject: [PATCH] QA: #453 - Adjustment of calling parameters and bug fixing - Revert thold_mail() calling parameters to more sane defaults - Continue conversion of 'type' to 'topic' - Add hostname and notification list to Queue GUI --- includes/polling.php | 12 ++++----- notify_queue.php | 51 ++++++++++++++++++++++++++++------- thold_functions.php | 63 ++++++++++++++++++++++++++++---------------- 3 files changed, 87 insertions(+), 39 deletions(-) diff --git a/includes/polling.php b/includes/polling.php index c09446e..ace285a 100644 --- a/includes/polling.php +++ b/includes/polling.php @@ -522,7 +522,7 @@ function thold_update_host_status() { 'device' => $host, 'subject' => $subject, 'message' => $msg, - 'email' => $alert_email + 'email' => $alert_email ) ); @@ -533,7 +533,7 @@ function thold_update_host_status() { } elseif ($host['thold_send_email'] == '0') { cacti_log('NOTE: Device[' . $host['id'] . '] Hostname[' . $host['hostname'] . '] did not send a Device recovering email for \'' . $host['description'] . '\', disabled per Device setting!', true, 'THOLD'); } elseif ($alert_email != '') { - thold_mail($notify_list_id, $alert_email, '', '', $subject, $msg, '', '', 'thold_uhost_mail'); + thold_mail($alert_email, '', '', $subject, $msg, '', '', '', $notify_list_id, $host, 'thold_uhost_mail'); } $command = read_config_option('thold_device_command'); @@ -582,7 +582,7 @@ function thold_update_host_status() { 'envrionment' => $environment ); - thold_notification_add('thold_uhost_cmd', $data); + thold_notification_add('thold_uhost_cmd', $data, 'id', 0, $host); } } else { cacti_log('WARNING: Device Up Command for Device[' . $host['id'] . '] Command[' . $command . '] Is either Not found or Not executable!', false, 'THOLD'); @@ -697,7 +697,7 @@ function thold_update_host_status() { 'device' => $host, 'subject' => $subject, 'message' => $msg, - 'email' => $alert_email + 'email' => $alert_email ) ); @@ -708,7 +708,7 @@ function thold_update_host_status() { } elseif ($host['thold_send_email'] == '0') { cacti_log('NOTE: Device[' . $host['id'] . '] Hostname[' . $host['hostname'] . '] did not send a Device down email for \'' . $host['description'] . '\', disabled per Device setting!', true, 'THOLD'); } elseif ($alert_email != '') { - thold_mail($notify_list_id, $alert_email, '', '', $subject, $msg, '', '', 'thold_dhost_mail'); + thold_mail($alert_email, '', '', $subject, $msg, '', '', '', $notify_list_id, $host, 'thold_dhost_mail'); } $command = read_config_option('thold_device_command'); @@ -756,7 +756,7 @@ function thold_update_host_status() { 'envrionment' => $environment ); - thold_notification_add('thold_dhost_cmd', $data); + thold_notification_add('thold_dhost_cmd', $data, 'id', 0, $host); } } else { cacti_log('WARNING: Device Down Command for Device[' . $host['id'] . '] Command[' . $command . '] Is either Not found or Not executable!', false, 'THOLD'); diff --git a/notify_queue.php b/notify_queue.php index 5904088..9a52f3b 100644 --- a/notify_queue.php +++ b/notify_queue.php @@ -250,7 +250,7 @@ function notify_queue() { '> - +