mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: Added additional Unbound chart for query cache info (#6574)
* Update unbound.inc.php * Update unbound.inc.php * Create unbound_cache.inc.php * Update AUTHORS.md * Update apps.inc.php
This commit is contained in:
@@ -204,6 +204,7 @@ LibreNMS contributors:
|
||||
- Svenn D'Hert <admin at svennd.be> (svennd)
|
||||
- Dominik Bay <db@rrbone.net> (eimann)
|
||||
- Nick Peelman <nick@peelman.us> (peelman)
|
||||
- Patrick Ryon <patrick@slashdoom.com> (slashdoom)
|
||||
|
||||
Observium was written by:
|
||||
- Adam Armstrong
|
||||
|
||||
30
html/includes/graphs/application/unbound_cache.inc.php
Normal file
30
html/includes/graphs/application/unbound_cache.inc.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$i = 0;
|
||||
$scale_min = 0;
|
||||
$nototal = 1;
|
||||
$unit_text = 'Query/s';
|
||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'unbound-cache', $app['app_id']));
|
||||
$array = array(
|
||||
'queries',
|
||||
'hits',
|
||||
'misses'
|
||||
);
|
||||
|
||||
$colours = 'mixed';
|
||||
$rrd_list = array();
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = strtoupper($ds);
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo "file missing: $rrd_filename";
|
||||
}
|
||||
|
||||
require 'includes/graphs/generic_multi_line.inc.php';
|
||||
@@ -226,6 +226,7 @@ $graphs['fbsd-nfs-client'] = array(
|
||||
|
||||
$graphs['unbound'] = array(
|
||||
'queries',
|
||||
'cache',
|
||||
);
|
||||
|
||||
$graphs['bind'] = array(
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
global $config;
|
||||
|
||||
$graphs = array(
|
||||
'unbound_queries' => 'Unbound - Queries'
|
||||
'unbound_queries' => 'Unbound - Queries',
|
||||
'unbound_cache' => 'Unbound - Cache'
|
||||
);
|
||||
foreach ($graphs as $key => $text) {
|
||||
$graph_type = $key;
|
||||
|
||||
@@ -62,4 +62,18 @@ $fields = array (
|
||||
);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
#Unbound Cache
|
||||
$rrd_name = array('app', $name,'cache',$app_id);
|
||||
$rrd_def = RrdDefinition::make()
|
||||
->addDataset('queries', 'DERIVE', 0, 125000000000)
|
||||
->addDataset('hits', 'DERIVE', 0, 125000000000)
|
||||
->addDataset('misses', 'DERIVE', 0, 125000000000);
|
||||
$fields = array (
|
||||
'queries' => $unbound['total.num.queries'],
|
||||
'hits' => $unbound['total.num.cachehits'],
|
||||
'misses' => $unbound['total.num.cachemiss']
|
||||
);
|
||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
|
||||
unset($lines , $unbound, $rrd_name, $rrd_def, $fields, $tags);
|
||||
|
||||
Reference in New Issue
Block a user