From 2cfc7c6f141ea111e526d13046f4be878a631b25 Mon Sep 17 00:00:00 2001 From: SourceDoctor Date: Thu, 5 Mar 2020 11:35:23 +0100 Subject: [PATCH] Extended unbound monitoring (#11255) --- .../application/unbound_recursiontime.inc.php | 29 ++++++++++++++++++ .../application/unbound_requestlist.inc.php | 30 +++++++++++++++++++ .../html/pages/device/apps/unbound.inc.php | 4 ++- includes/polling/applications/unbound.inc.php | 28 +++++++++++++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 includes/html/graphs/application/unbound_recursiontime.inc.php create mode 100644 includes/html/graphs/application/unbound_requestlist.inc.php diff --git a/includes/html/graphs/application/unbound_recursiontime.inc.php b/includes/html/graphs/application/unbound_recursiontime.inc.php new file mode 100644 index 0000000000..00f7fd29a1 --- /dev/null +++ b/includes/html/graphs/application/unbound_recursiontime.inc.php @@ -0,0 +1,29 @@ + 'Unbound - Queries', 'unbound_cache' => 'Unbound - Cache', - 'unbound_operations' => 'Unbound - Operations' + 'unbound_operations' => 'Unbound - Operations', + 'unbound_requestlist' => 'Unbound - Request list', + 'unbound_recursiontime' => 'Unbound - Recursion time' ); foreach ($graphs as $key => $text) { $graph_type = $key; diff --git a/includes/polling/applications/unbound.inc.php b/includes/polling/applications/unbound.inc.php index 1f2ee8e144..7039fec1f3 100644 --- a/includes/polling/applications/unbound.inc.php +++ b/includes/polling/applications/unbound.inc.php @@ -94,6 +94,34 @@ $metrics['operations'] = $fields; $tags = compact('name', 'app_id', 'rrd_name', 'rrd_def'); data_update($device, 'app', $tags, $fields); +#Unbound requestlist +$rrd_name = array('app', $name,'requestlist',$app_id); +$rrd_def = RrdDefinition::make() + ->addDataset('max', 'DERIVE', 0, 125000000000) + ->addDataset('overwritten', 'DERIVE', 0, 125000000000) + ->addDataset('exceeded', 'DERIVE', 0, 125000000000); +$fields = array ( + 'max' => $unbound['total.requestlist.max'], + 'overwritten' => $unbound['total.requestlist.overwritten'], + 'exceeded' => $unbound['total.requestlist.exceeded'] + ); +$metrics['requestlist'] = $fields; +$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def'); +data_update($device, 'app', $tags, $fields); + +#Unbound recursiontime +$rrd_name = array('app', $name,'recursiontime',$app_id); +$rrd_def = RrdDefinition::make() + ->addDataset('avg', 'GAUGE', 0, 125000000000) + ->addDataset('median', 'GAUGE', 0, 125000000000); +$fields = array ( + 'avg' => $unbound['total.recursion.time.avg'], + 'median' => $unbound['total.recursion.time.median'] + ); +$metrics['recursiontime'] = $fields; +$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def'); +data_update($device, 'app', $tags, $fields); + update_application($app, $rawdata, $metrics); unset($lines, $unbound, $rrd_name, $rrd_def, $fields, $tags);