add the ability for storing app data to prevent spamming of the event log via via component usage (#14087)

* initial work on add the ability to save/fetch app data

* update to use get_app_data for ZFS

* update the poller for the new app_data stuff

* ZFS now logs changes to pools

* add schema update for app_data stuff

* small formatting fix

* add a missing \

* now adds a column

* sql-schema is no longer used, so remove the file that was added here

* misc cleanups

* rename the method in database/migrations/2022_07_03_1947_add_app_data.php

* hopefully fix the migration bit

* add the column to misc/db_schema.yaml

* more misc small DB fixes

* update the test as the json column uses collat of utf8mb4_bin

* revert the last change and try manually setting it to what is expected

* remove a extra ;

* update suricata as well

* correct the instance -> instances in one location to prevent the old instance list from being stomped

* remove a extra ;

* update fail2ban to use it as well

* remove two unused functions as suricata and fail2ban no longer use components

* style cleanup

* postgres poller updated to use it

* update html side of the postgres bits

* chronyd now uses app data bits now as well

* portactivity now uses it as well

* style fix

* sort the returned arrays from app_data

* correct log message for port activity

* collocation change

* try re-ordering it

* add in the new data column to the tests

* remove a extra ,

* hmm... ->collate('utf8mb4_unicode_ci') is not usable as apparently collate does not exist

* change the column type from json to longtext

* mv chronyd stuff while I sort out the rest of the tests... damn thing is always buggy

* hmm... fix a missing line then likely move stuff back

* style fix

* add fillable

* add the expexcted data for fail2ban json

* escape a " I missed

* add data for portactivity

* add suricata app data

* add app data to zfs legacy test

* put the moved tests back into place and update zfs-v1 test

* add app data for chronyd test

* add app data for fail2ban legacy test

* update zfs v1 app data

* add some notes on application dev work

* add Developing/Application-Notes.md to mkdocs.yml

* add data column to it

* added various suggestions from bennet-esyoil

* convert from isset to sizeof

* type fix

* fully remove the old save app data function and move it into a helper function... the other still needs cleaned up prior to removal

* update docs

* get_app_data is fully removed now as well

* a few style fixes

* add $casts

* update chronyd test

* attempt to fix the data

* more doc cleanup and try changing the cast

* style fix

* revert the changes to the chronyd test

* apply a few of murrant's suggestions

* document working with ->data as json and non-josn

* remove two no-longer used in this PR exceptions

* ->data now operates transparently

* style fix

* update data tests

* fix json

* test fix

* update the app notes to reflect how app data now works

* app test fix

* app data fix for linux_lsi

* json fix

* minor doc cleanup

* remove duplicate querty and use json_decode instead

* style fix

* modelize the app poller

* use a anon func instead of foreach

* test update

* style cleanup

* style cleanup

* another test cleanup

* more test cleanup

* reverse the test changes and add in some more glue code

* revert one of the test changes

* another small test fix

* Make things use models
Left some array access, but those will still work just fine.

* missed chronyd and portactivity

* rename poll to avoid make it any confusion

* Remove extra save and fix timestamp

* save any changes made to app->data

* nope, that was not it

* What are magic methods and how do they work?

* fix two typos

* update linux_lsi test

* change quote type

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
Zane C. Bowers-Hadley
2022-07-22 16:01:55 -05:00
committed by GitHub
parent 6e98139cd1
commit 0bbcde1227
404 changed files with 968 additions and 1385 deletions

View File

@@ -29,19 +29,12 @@ use LibreNMS\Util\StringHelpers;
class Application extends DeviceRelatedModel
{
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = false;
/**
* The primary key column name.
*
* @var string
*/
protected $primaryKey = 'app_id';
protected $fillable = ['data'];
protected $casts = [
'data' => 'array',
];
// ---- Helper Functions ----
@@ -52,6 +45,6 @@ class Application extends DeviceRelatedModel
public function getShowNameAttribute()
{
return StringHelpers::niceCase($this->app_type);
return $this->displayName();
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAppData extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('applications', function (Blueprint $table) {
$table->longText('data')->after('app_instance')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('applications', function (Blueprint $table) {
$table->dropColumn('data');
});
}
}

View File

@@ -0,0 +1,82 @@
# Notes On Application Development
## LibreNMS JSON SNMP Extends
The polling function `json_app_get` makes it easy to poll complex data
using SNMP extends and JSON.
The following exceptions are provided by it.
It takes three parameters, in order in the list below.
- Integer :: Device ID to fetch it for.
- String :: The extend name. For example, if 'zfs' is passed it will
be converted to 'nsExtendOutputFull.3.122.102.115'.
- Integer :: Minimum expected version of the JSON return.
The required keys for the returned JSON are as below.
- version :: The version of the snmp extend script. Should be numeric
and at least 1.
- error :: Error code from the snmp extend script. Should be > 0
(0 will be ignored and negatives are reserved)
- errorString :: Text to describe the error.
- data :: An key with an array with the data to be used.
The supported exceptions are as below.
- JsonAppPollingFailedException :: Empty return from SNMP.
- JsonAppParsingFailedException :: Could not parse the JSON
- JsonAppBlankJsonException :: Blank JSON.
- JsonAppMissingKeysException :: Missing required keys.
- JsonAppWrongVersionException :: Older version than supported.
- JsonAppExtendErroredException :: Polling and parsing was good, but
the returned data has an error set. This may be checked via
$e->getParsedJson() and then checking the keys error and
errorString.
The error value can be accessed via $e->getCode(). The output can be
accessed via $->getOutput() Only returned
JsonAppParsingFailedException. The parsed JSON can be access via
$e->getParsedJson().
An example below from `includes/polling/applications/zfs.inc.php`...
```php
try {
$zfs = json_app_get($device, $name, 1)['data'];
} catch (JsonAppMissingKeysException $e) {
//old version with out the data key
$zfs = $e->getParsedJson();
} catch (JsonAppException $e) {
echo PHP_EOL . $name . ':' . $e->getCode() . ':' . $e->getMessage() . PHP_EOL;
update_application($app, $e->getCode() . ':' . $e->getMessage(), []);
return;
}
```
## Application Data Storage
The `$app` model is supplied for each application poller and graph.
You may access and update the `$app->data` field to store arrays of data
the Application model.
When you call update_application() the `$app` model will be saved along with
any changes to the data field.
```
// set the varaible data to $foo
$app->data = [
'item_A' => 123,
'item_B' => 4.5,
'type' => 'foo',
'other_items' => [ 'a', 'b', 'c' ],
];
// save the change
$app->save();
// var_dump the contents of the variable
var_dump($app->data);
```

View File

@@ -206,18 +206,6 @@ function get_port_by_id($port_id)
}
}
function get_application_by_id($application_id)
{
if (is_numeric($application_id)) {
$application = dbFetchRow('SELECT * FROM `applications` WHERE `app_id` = ?', [$application_id]);
if (is_array($application)) {
return $application;
} else {
return false;
}
}
}
function get_sensor_by_id($sensor_id)
{
if (is_numeric($sensor_id)) {
@@ -242,18 +230,6 @@ function get_device_id_by_port_id($port_id)
}
}
function get_device_id_by_app_id($app_id)
{
if (is_numeric($app_id)) {
$device_id = dbFetchCell('SELECT `device_id` FROM `applications` WHERE `app_id` = ?', [$app_id]);
if (is_numeric($device_id)) {
return $device_id;
} else {
return false;
}
}
}
function ifclass($ifOperStatus, $ifAdminStatus)
{
// fake a port model
@@ -540,26 +516,6 @@ function search_phrase_column($c)
return "$c LIKE '%$searchPhrase%'";
} // search_phrase_column
/**
* Constructs the path to an RRD for the Ceph application
*
* @param string $gtype The type of rrd we're looking for
* @return string
**/
function ceph_rrd($gtype)
{
global $device;
global $vars;
if ($gtype == 'osd') {
$var = $vars['osd'];
} else {
$var = $vars['pool'];
}
return Rrd::name($device['hostname'], ['app', 'ceph', $vars['id'], $gtype, $var]);
} // ceph_rrd
/**
* Parse location field for coordinates
*

View File

@@ -133,19 +133,6 @@ function port_permitted($port_id, $device_id = null)
return \Permissions::canAccessPort($port_id, Auth::id());
}
function application_permitted($app_id, $device_id = null)
{
if (! is_numeric($app_id)) {
return false;
}
if (! $device_id) {
$device_id = get_device_id_by_app_id($app_id);
}
return device_permitted($device_id);
}
function device_permitted($device_id)
{
if (Auth::user() && Auth::user()->hasGlobalRead()) {
@@ -1075,60 +1062,6 @@ function get_oxidized_nodes_list()
}
}
/**
* Get the fail2ban jails for a device... just requires the device ID
* an empty return means either no jails or fail2ban is not in use
*
* @param $device_id
* @return array
*/
function get_fail2ban_jails($device_id)
{
$options = [
'filter' => [
'type' => ['=', 'fail2ban'],
],
];
$component = new LibreNMS\Component();
$f2bc = $component->getComponents($device_id, $options);
if (isset($f2bc[$device_id])) {
$id = $component->getFirstComponentID($f2bc, $device_id);
return json_decode($f2bc[$device_id][$id]['jails']);
}
return [];
}
/**
* Get the Postgres databases for a device... just requires the device ID
* an empty return means Postres is not in use
*
* @param $device_id
* @return array
*/
function get_postgres_databases($device_id)
{
$options = [
'filter' => [
'type' => ['=', 'postgres'],
],
];
$component = new LibreNMS\Component();
$pgc = $component->getComponents($device_id, $options);
if (isset($pgc[$device_id])) {
$id = $component->getFirstComponentID($pgc, $device_id);
return json_decode($pgc[$device_id][$id]['databases']);
}
return [];
}
/**
* Return stacked graphs information
*
@@ -1174,60 +1107,6 @@ function parse_at_time($time)
return (int) strtotime($time);
}
/**
* Get the ZFS pools for a device... just requires the device ID
* an empty return means ZFS is not in use or there are currently no pools
*
* @param $device_id
* @return array
*/
function get_zfs_pools($device_id)
{
$options = [
'filter' => [
'type' => ['=', 'zfs'],
],
];
$component = new LibreNMS\Component();
$zfsc = $component->getComponents($device_id, $options);
if (isset($zfsc[$device_id])) {
$id = $component->getFirstComponentID($zfsc, $device_id);
return json_decode($zfsc[$device_id][$id]['pools']);
}
return [];
}
/**
* Get the ports for a device... just requires the device ID
* an empty return means portsactivity is not in use or there are currently no ports
*
* @param $device_id
* @return array
*/
function get_portactivity_ports($device_id)
{
$options = [
'filter' => [
'type' => ['=', 'portsactivity'],
],
];
$component = new LibreNMS\Component();
$portsc = $component->getComponents($device_id, $options);
if (isset($portsc[$device_id])) {
$id = $component->getFirstComponentID($portsc, $device_id);
return json_decode($portsc[$device_id][$id]['ports']);
}
return [];
}
/**
* Returns the sysname of a device with a html line break prepended.
* if the device has an empty sysname it will return device's hostname instead
@@ -1324,33 +1203,6 @@ function get_sensor_label_color($sensor, $type = 'sensors')
return "<span class='label $label_style'>" . trim(Number::formatSi($sensor['sensor_current'], 2, 3, $unit)) . '</span>';
}
/**
* Returns a list of the various suricata instances for
* the specified device id.
*
* @param $device_id
* @return array
*/
function get_suricata_instances($device_id)
{
$options = [
'filter' => [
'type' => ['=', 'suricata'],
],
];
$component = new LibreNMS\Component();
$ourc = $component->getComponents($device_id, $options);
if (isset($ourc[$device_id])) {
$id = $component->getFirstComponentID($ourc, $device_id);
return json_decode($ourc[$device_id][$id]['instances']);
}
return [];
}
/**
* @params int unix time
* @params int seconds
@@ -1457,30 +1309,3 @@ function nfsen_live_dir($hostname)
}
}
}
/**
* Get the ZFS pools for a device... just requires the device ID
* an empty return means ZFS is not in use or there are currently no pools
*
* @param $device_id
* @return array
*/
function get_chrony_sources($device_id)
{
$options = [
'filter' => [
'type' => ['=', 'chronyd'],
],
];
$component = new LibreNMS\Component();
$chronyd_cpnt = $component->getComponents($device_id, $options);
if (isset($chronyd_cpnt[$device_id])) {
$id = $component->getFirstComponentID($chronyd_cpnt, $device_id);
return json_decode($chronyd_cpnt[$device_id][$id]['sources']);
}
return [];
}

View File

@@ -4,7 +4,7 @@ $scale_min = 0;
require 'includes/html/graphs/common.inc.php';
$apache_rrd = Rrd::name($device['hostname'], ['app', 'apache', $app['app_id']]);
$apache_rrd = Rrd::name($device['hostname'], ['app', 'apache', $app->app_id]);
if (Rrd::checkRrdExists($apache_rrd)) {
$rrd_filename = $apache_rrd;

View File

@@ -4,7 +4,7 @@ $scale_min = 0;
require 'includes/html/graphs/common.inc.php';
$apache_rrd = Rrd::name($device['hostname'], ['app', 'apache', $app['app_id']]);
$apache_rrd = Rrd::name($device['hostname'], ['app', 'apache', $app->app_id]);
if (Rrd::checkRrdExists($apache_rrd)) {
$rrd_filename = $apache_rrd;

View File

@@ -4,7 +4,7 @@ $scale_min = 0;
require 'includes/html/graphs/common.inc.php';
$apache_rrd = Rrd::name($device['hostname'], ['app', 'apache', $app['app_id']]);
$apache_rrd = Rrd::name($device['hostname'], ['app', 'apache', $app->app_id]);
if (Rrd::checkRrdExists($apache_rrd)) {
$rrd_filename = $apache_rrd;

View File

@@ -4,7 +4,7 @@ $scale_min = 0;
require 'includes/html/graphs/common.inc.php';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'apache', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'apache', $app->app_id]);
$array = [
'sb_reading' => [

View File

@@ -9,6 +9,6 @@ $colour_line = '2EAC6D';
$colour_area_max = 'FFEE99';
$graph_max = 10000;
$unit_text = 'Calls';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'asterisk', 'stats', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'asterisk', 'stats', $app->app_id]);
require 'includes/html/graphs/generic_simplex.inc.php';

View File

@@ -9,6 +9,6 @@ $colour_line = '2EAC6D';
$colour_area_max = 'FFEE99';
$graph_max = 20000;
$unit_text = 'Channels';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'asterisk', 'stats', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'asterisk', 'stats', $app->app_id]);
require 'includes/html/graphs/generic_simplex.inc.php';

View File

@@ -5,7 +5,7 @@ $i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = 'IAX2 Peers';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'asterisk', 'iax2', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'asterisk', 'iax2', $app->app_id]);
$astiax2_access_array = [
'iax2peers' => 'Total Peers',

View File

@@ -6,7 +6,7 @@ $scale_min = 0;
$nototal = 1;
$descr_len = 21;
$unit_text = 'SIP Peers';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'asterisk', 'stats', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'asterisk', 'stats', $app->app_id]);
$astsip_access_array = [
'sippeers' => 'Total Peers',

View File

@@ -1,13 +1,17 @@
<?php
if (is_numeric($vars['id']) && ($auth || application_permitted($vars['id']))) {
$app = get_application_by_id($vars['id']);
$device = device_by_id_cache($app['device_id']);
if ($app['app_type'] != 'proxmox') {
use App\Models\Application;
if (is_numeric($vars['id'])) {
$app = Application::hasAccess(Auth::user())->firstWhere(['app_id' => $vars['id']]);
if ($auth || $app) {
$device = device_by_id_cache($app->device_id);
if ($app->app_type != 'proxmox') {
$title = generate_device_link($device);
$title .= $graph_subtype;
} else {
$title = $vars['port'] . '@' . $vars['hostname'] . ' on ' . generate_device_link($device);
}
$auth = true;
}
}

View File

@@ -2,7 +2,7 @@
require 'includes/html/graphs/common.inc.php';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'backupninja', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'backupninja', $app->app_id]);
$array = [
'last_actions' => [

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'In Hash Table';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'adb']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'adb']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'Table Size';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'adb']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'adb']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'per second';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'cache']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'cache']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'Heap Memory';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'cache']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'cache']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'per second';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'cache']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'cache']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'Tree Memory';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'cache']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'cache']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -33,7 +33,7 @@ $unit_text = 'query/sec';
$colours = 'psychedelic';
$rrd_list = [];
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id]);
$array = [
'any',
'a',
@@ -58,7 +58,7 @@ if (Rrd::checkRrdExists($rrd_filename)) {
echo "file missing: $file";
}
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'incoming']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'incoming']);
$array = [
'afsdb',
'apl',

View File

@@ -9,7 +9,7 @@ $unit_text = 'query/sec';
$colours = 'psychedelic';
$rrd_list = [];
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'outgoing']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'outgoing']);
$array = [
'any',
'a',

View File

@@ -32,7 +32,7 @@ $i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = 'Query/sec';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id]);
$array = [
'any',
'a',

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'per second';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'resolver']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'resolver']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'quiries/sec';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'resolver']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'resolver']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'quiries/sec';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'resolver']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'resolver']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -9,7 +9,7 @@ $unit_text = 'RR sets';
$colours = 'psychedelic';
$rrd_list = [];
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'rrnegative']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'rrnegative']);
$array = [
'any',
'a',

View File

@@ -9,7 +9,7 @@ $unit_text = 'RR sets';
$colours = 'psychedelic';
$rrd_list = [];
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'rrpositive']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'rrpositive']);
$array = [
'any',
'a',

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'RTT in ms/sec';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'resolver']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'resolver']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'per second';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'server']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'server']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'per second';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'server']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'server']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'per second';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'server']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'server']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'accepted/sec';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'sockets']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'sockets']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'active sockets';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'sockets']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'sockets']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'failures / sec.';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'sockets']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'sockets']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'failures / sec.';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'sockets']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'sockets']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'closed / sec.';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'sockets']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'sockets']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'errors / sec';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'sockets']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'sockets']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'establish/sec';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'sockets']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'sockets']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -1,7 +1,6 @@
<?php
$name = 'bind';
$app_id = $app['app_id'];
$unit_text = 'opened / sec.';
$colours = 'psychedelic';
$dostack = 0;
@@ -9,7 +8,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'sockets']);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app->app_id, 'sockets']);
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {

View File

@@ -6,7 +6,7 @@ $ds_out = 'commit_ms';
$in_text = 'Apply';
$out_text = 'Commit';
$ceph_osd_rrd = ceph_rrd('osd');
$ceph_osd_rrd = Rrd::name($device['hostname'], ['app', 'ceph', $app->app_id, 'osd', $vars['osd']]);
if (Rrd::checkRrdExists($ceph_osd_rrd)) {
$rrd_filename = $ceph_osd_rrd;

View File

@@ -2,7 +2,7 @@
require 'includes/html/graphs/common.inc.php';
$ceph_pool_rrd = ceph_rrd('df');
$ceph_pool_rrd = Rrd::name($device['hostname'], ['app', 'ceph', $app->app_id, 'df', $vars['pool']]);
if (Rrd::checkRrdExists($ceph_pool_rrd)) {
$rrd_filename = $ceph_pool_rrd;

View File

@@ -7,7 +7,7 @@ $out_text = 'Write';
$format = 'bytes';
$ceph_pool_rrd = ceph_rrd('pool');
$ceph_pool_rrd = Rrd::name($device['hostname'], ['app', 'ceph', $app->app_id, 'pool', $vars['pool']]);
if (Rrd::checkRrdExists($ceph_pool_rrd)) {
$rrd_filename = $ceph_pool_rrd;

View File

@@ -4,7 +4,7 @@ $scale_min = 0;
require 'includes/html/graphs/common.inc.php';
$ceph_pool_rrd = ceph_rrd('pool');
$ceph_pool_rrd = Rrd::name($device['hostname'], ['app', 'ceph', $app->app_id, 'pool', $vars['pool']]);
if (Rrd::checkRrdExists($ceph_pool_rrd)) {
$rrd_filename = $ceph_pool_rrd;

View File

@@ -4,7 +4,7 @@ $scale_min = 0;
require 'includes/html/graphs/common.inc.php';
$ceph_pool_rrd = ceph_rrd('df');
$ceph_pool_rrd = Rrd::name($device['hostname'], ['app', 'ceph', $app->app_id, 'df', $vars['pool']]);
if (Rrd::checkRrdExists($ceph_pool_rrd)) {
$rrd_filename = $ceph_pool_rrd;

View File

@@ -1,7 +1,6 @@
<?php
$name = 'certificate';
$app_id = $app['app_id'];
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
@@ -12,14 +11,14 @@ $scale_min = 0;
if (isset($vars['cert_name'])) {
$cert_name_list = [$vars['cert_name']];
} else {
$cert_name_list = Rrd::getRrdApplicationArrays($device, $app_id, $name);
$cert_name_list = Rrd::getRrdApplicationArrays($device, $app->app_id, $name);
}
$int = 0;
$rrd_list = [];
while (isset($cert_name_list[$int])) {
$cert_name = $cert_name_list[$int];
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id, $cert_name]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, $cert_name]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list[] = [

View File

@@ -5,7 +5,7 @@ require 'includes/html/graphs/common.inc.php';
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Seconds PPM';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app->app_id]);
$array = [
'frequency' => ['descr' => 'Error rate'],
'residual_frequency' => ['descr' => 'Ref clk offset'],

View File

@@ -5,7 +5,7 @@ require 'includes/html/graphs/common.inc.php';
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Seconds';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app->app_id]);
$array = [
'root_delay' => ['descr' => 'Root clk delay'],
'root_dispersion' => ['descr' => 'Root clk disp.'],

View File

@@ -5,7 +5,7 @@ require 'includes/html/graphs/common.inc.php';
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Seconds PPM';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app['app_id'], $vars['source']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app->app_id, $vars['source']]);
$array = [
'frequency' => ['descr' => 'Estimated'],
'frequency_skew' => ['descr' => 'Est. error'],

View File

@@ -4,7 +4,7 @@ require 'includes/html/graphs/common.inc.php';
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app['app_id'], $vars['source']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app->app_id, $vars['source']]);
$array = [
'polling_rate' => ['descr' => 'Polling rate'],
'last_rx' => ['descr' => 'Last RX'],

View File

@@ -5,7 +5,7 @@ require 'includes/html/graphs/common.inc.php';
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Seconds';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app['app_id'], $vars['source']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app->app_id, $vars['source']]);
$array = [
'adjusted_offset' => ['descr' => 'Adjusted'],
'measured_offset' => ['descr' => 'Measured'],

View File

@@ -5,7 +5,7 @@ require 'includes/html/graphs/common.inc.php';
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Level';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app->app_id]);
$array = [
'stratum' => ['descr' => 'Stratum'],
];

View File

@@ -5,7 +5,7 @@ require 'includes/html/graphs/common.inc.php';
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Seconds';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'chronyd', $app->app_id]);
$array = [
'system_time' => ['descr' => 'Clock lag'],
'last_offset' => ['descr' => 'Last offset'],

View File

@@ -9,20 +9,19 @@ $category = 'networks';
$rrdVar = 'current';
$name = 'dhcp-stats';
$app_id = $app['app_id'];
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 15;
$arrays = Rrd::getRrdApplicationArrays($device, $app_id, $name, $category);
$arrays = Rrd::getRrdApplicationArrays($device, $app->app_id, $name, $category);
$int = 0;
$rrd_list = [];
while (isset($arrays[$int])) {
$array = $arrays[$int];
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id, $array]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, $array]);
if (Rrd::checkRrdExists($rrd_filename)) {
[$net, $subnet] = explode('_', str_replace($category . '-', '', $array));

View File

@@ -9,20 +9,19 @@ $category = 'networks';
$rrdVar = 'max';
$name = 'dhcp-stats';
$app_id = $app['app_id'];
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 15;
$arrays = Rrd::getRrdApplicationArrays($device, $app_id, $name, $category);
$arrays = Rrd::getRrdApplicationArrays($device, $app->app_id, $name, $category);
$int = 0;
$rrd_list = [];
while (isset($arrays[$int])) {
$array = $arrays[$int];
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id, $array]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, $array]);
if (Rrd::checkRrdExists($rrd_filename)) {
[$net, $subnet] = explode('_', str_replace($category . '-', '', $array));

View File

@@ -9,20 +9,19 @@ $category = 'networks';
$rrdVar = 'percent';
$name = 'dhcp-stats';
$app_id = $app['app_id'];
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 15;
$arrays = Rrd::getRrdApplicationArrays($device, $app_id, $name, $category);
$arrays = Rrd::getRrdApplicationArrays($device, $app->app_id, $name, $category);
$int = 0;
$rrd_list = [];
while (isset($arrays[$int])) {
$array = $arrays[$int];
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id, $array]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, $array]);
if (Rrd::checkRrdExists($rrd_filename)) {
[$net, $subnet] = explode('_', str_replace($category . '-', '', $array));

View File

@@ -9,20 +9,19 @@ $category = 'pools';
$rrdVar = 'current';
$name = 'dhcp-stats';
$app_id = $app['app_id'];
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 15;
$arrays = Rrd::getRrdApplicationArrays($device, $app_id, $name, $category);
$arrays = Rrd::getRrdApplicationArrays($device, $app->app_id, $name, $category);
$int = 0;
$rrd_list = [];
while (isset($arrays[$int])) {
$array = $arrays[$int];
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id, $array]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, $array]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list[] = [

View File

@@ -9,20 +9,19 @@ $category = 'pools';
$rrdVar = 'max';
$name = 'dhcp-stats';
$app_id = $app['app_id'];
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 15;
$arrays = Rrd::getRrdApplicationArrays($device, $app_id, $name, $category);
$arrays = Rrd::getRrdApplicationArrays($device, $app->app_id, $name, $category);
$int = 0;
$rrd_list = [];
while (isset($arrays[$int])) {
$array = $arrays[$int];
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id, $array]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, $array]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list[] = [

View File

@@ -9,20 +9,19 @@ $category = 'pools';
$rrdVar = 'percent';
$name = 'dhcp-stats';
$app_id = $app['app_id'];
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 15;
$arrays = Rrd::getRrdApplicationArrays($device, $app_id, $name, $category);
$arrays = Rrd::getRrdApplicationArrays($device, $app->app_id, $name, $category);
$int = 0;
$rrd_list = [];
while (isset($arrays[$int])) {
$array = $arrays[$int];
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id, $array]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, $array]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list[] = [

View File

@@ -2,7 +2,6 @@
require 'includes/html/graphs/common.inc.php';
$name = 'dhcp-stats';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'Leases';
@@ -14,7 +13,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
$array = [
'dhcp_total' => ['descr' => 'Total', 'colour' => '582A72'],

View File

@@ -1,7 +1,6 @@
<?php
$name = 'docker';
$app_id = $app['app_id'];
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
@@ -15,13 +14,13 @@ $smalldescrlen = 25;
if (isset($vars['container'])) {
$containers = [$vars['container']];
} else {
$containers = Rrd::getRrdApplicationArrays($device, $app['app_id'], 'docker');
$containers = Rrd::getRrdApplicationArrays($device, $app->app_id, 'docker');
}
$int = 0;
while (isset($containers[$int])) {
$container_name = $containers[$int];
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id, $container_name]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, $container_name]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list[] = [

View File

@@ -4,7 +4,7 @@ $scale_min = 0;
require 'includes/html/graphs/common.inc.php';
$drbd_rrd = Rrd::name($device['hostname'], ['app', 'drbd', $app['app_instance']]);
$drbd_rrd = Rrd::name($device['hostname'], ['app', 'drbd', $app->app_instance]);
if (Rrd::checkRrdExists($drbd_rrd)) {
$rrd_filename = $drbd_rrd;

View File

@@ -4,7 +4,7 @@ $scale_min = 0;
require 'includes/html/graphs/common.inc.php';
$drbd_rrd = Rrd::name($device['hostname'], ['app', 'drbd', $app['app_instance']]);
$drbd_rrd = Rrd::name($device['hostname'], ['app', 'drbd', $app->app_instance]);
if (Rrd::checkRrdExists($drbd_rrd)) {
$rrd_filename = $drbd_rrd;

View File

@@ -2,7 +2,7 @@
require 'includes/html/graphs/common.inc.php';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'drbd', $app['app_instance']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'drbd', $app->app_instance]);
$array = [
'lo' => 'Local I/O',

View File

@@ -4,7 +4,7 @@ $scale_min = 0;
require 'includes/html/graphs/common.inc.php';
$drbd_rrd = Rrd::name($device['hostname'], ['app', 'drbd', $app['app_instance']]);
$drbd_rrd = Rrd::name($device['hostname'], ['app', 'drbd', $app->app_instance]);
if (Rrd::checkRrdExists($drbd_rrd)) {
$rrd_filename = $drbd_rrd;

View File

@@ -2,7 +2,6 @@
require 'includes/html/graphs/common.inc.php';
$name = 'entropy';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'Random entropy';
@@ -14,7 +13,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 33;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
$array = [
'entropy' => ['descr' => 'entropy', 'colour' => '2B9220'],

View File

@@ -20,7 +20,6 @@
*/
require 'includes/html/graphs/common.inc.php';
$name = 'exim-stats';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'Frozen';
@@ -32,7 +31,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 33;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
$array = [
'frozen' => ['descr' => 'Frozen emails', 'colour' => 'c13a38'],

View File

@@ -20,7 +20,6 @@
*/
require 'includes/html/graphs/common.inc.php';
$name = 'exim-stats';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'Queue';
@@ -32,7 +31,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 33;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
$array = [
'queue' => ['descr' => 'Queue emails', 'colour' => 'c13a38'],

View File

@@ -12,7 +12,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', $app['app_type'], $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $app->app_type, $app->app_id]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list = [

View File

@@ -12,7 +12,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', $app['app_type'], $app['app_id'], $vars['jail']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $app->app_type, $app->app_id, $vars['jail']]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list = [
[

View File

@@ -1,7 +1,6 @@
<?php
$name = 'fbsd-nfs-client';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'per second';
@@ -13,7 +12,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list = [

View File

@@ -1,7 +1,6 @@
<?php
$name = 'fbsd-nfs-client';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'per second';
@@ -13,7 +12,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list = [

View File

@@ -1,7 +1,6 @@
<?php
$name = 'fbsd-nfs-client';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'per second';
@@ -13,7 +12,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list = [

View File

@@ -1,7 +1,6 @@
<?php
$name = 'fbsd-nfs-server';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'per second';
@@ -13,7 +12,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list = [

View File

@@ -1,7 +1,6 @@
<?php
$name = 'fbsd-nfs-server';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'per second';
@@ -13,7 +12,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list = [

View File

@@ -1,7 +1,6 @@
<?php
$name = 'fbsd-nfs-server';
$app_id = $app['app_id'];
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'per second';
@@ -13,7 +12,7 @@ $printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app_id]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list = [

View File

@@ -5,7 +5,7 @@ $i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = 'Per Sec.';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-access', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-access', $app->app_id]);
$fr_access_array = [
'requests' => 'Requests',
'accepts' => 'Accepts',

View File

@@ -5,7 +5,7 @@ $i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = 'Per Sec.';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-acct', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-acct', $app->app_id]);
$fr_acct_array = [
'requests' => 'Requests',
'responses' => 'Responses',

View File

@@ -5,7 +5,7 @@ $i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = 'Per Sec.';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-auth', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-auth', $app->app_id]);
$fr_auth_array = [
'responses' => 'Responses',
'duplicate_requests' => 'Duplicate Requests',

View File

@@ -5,7 +5,7 @@ $i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = 'Per Sec.';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-proxy_access', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-proxy_access', $app->app_id]);
$fr_proxy_access_array = [
'requests' => 'Requests',
'accepts' => 'Accepts',

View File

@@ -5,7 +5,7 @@ $i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = 'Per Sec.';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-proxy_acct', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-proxy_acct', $app->app_id]);
$fr_proxy_acct_array = [
'requests' => 'Requests',
'responses' => 'Responses',

View File

@@ -5,7 +5,7 @@ $i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = 'Per Sec.';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-proxy_auth', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-proxy_auth', $app->app_id]);
$fr_proxy_auth_array = [
'responses' => 'Responses',
'duplicate_requests' => 'Duplicate Requests',

View File

@@ -5,7 +5,7 @@ $i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = 'Per Sec.';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-queue', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeradius-queue', $app->app_id]);
$fr_queue_array = [
'len_internal' => 'Len Internal',
'len_proxy' => 'Len Proxy',

View File

@@ -9,6 +9,6 @@ $colour_line = '2EAC6D';
$colour_area_max = 'FFEE99';
$graph_max = 10000;
$unit_text = 'Calls';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app->app_id]);
require 'includes/html/graphs/generic_simplex.inc.php';

View File

@@ -6,7 +6,7 @@ $scale_min = 0;
$colours = 'blue';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Inbound Calls/sec';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app->app_id]);
$array = [
'in_okay' => [
'descr' => 'Okay',

View File

@@ -6,7 +6,7 @@ $scale_min = 0;
$colours = 'blue';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Outbound Calls/sec';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app->app_id]);
$array = [
'out_okay' => [
'descr' => 'Okay',

View File

@@ -9,6 +9,6 @@ $colour_line = '2EAC6D';
$colour_area_max = 'FFEE99';
$graph_max = 10000;
$unit_text = 'Channels';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app->app_id]);
require 'includes/html/graphs/generic_simplex.inc.php';

View File

@@ -9,6 +9,6 @@ $colour_line = '2EAC6D';
$colour_area_max = 'FFEE99';
$graph_max = 10000;
$unit_text = 'Peak Calls';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'freeswitch', 'stats', $app->app_id]);
require 'includes/html/graphs/generic_simplex.inc.php';

View File

@@ -27,7 +27,7 @@ $colours = 'mixed';
$unit_text = 'DOP';
$nototal = 1;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'gpsd', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'gpsd', $app->app_id]);
$array = [
'hdop' => ['descr' => 'Horizontal'],
'vdop' => ['descr' => 'Vertical'],

View File

@@ -30,7 +30,7 @@ $colour_area_max = 'FFCCCC';
$graph_max = 0;
$unit_text = 'Mode';
$gpsd = Rrd::name($device['hostname'], ['app', 'gpsd', $app['app_id']]);
$gpsd = Rrd::name($device['hostname'], ['app', 'gpsd', $app->app_id]);
if (Rrd::checkRrdExists($gpsd)) {
$rrd_filename = $gpsd;
} else {

View File

@@ -27,7 +27,7 @@ $colours = 'mixed';
$unit_text = 'Satellites';
$nototal = 1;
$rrd_filename = Rrd::name($device['hostname'], ['app', 'gpsd', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'gpsd', $app->app_id]);
$array = [
'satellites' => ['descr' => 'Visible', 'area' => true],
'satellites_used' => ['descr' => 'Used', 'area' => true],

View File

@@ -5,7 +5,7 @@ $scale_max = 1;
require 'includes/html/graphs/common.inc.php';
$icecast_rrd = Rrd::name($device['hostname'], ['app', 'icecast', $app['app_id']]);
$icecast_rrd = Rrd::name($device['hostname'], ['app', 'icecast', $app->app_id]);
if (Rrd::checkRrdExists($icecast_rrd)) {
$rrd_filename = $icecast_rrd;

View File

@@ -4,7 +4,7 @@ $scale_min = 1000;
require 'includes/html/graphs/common.inc.php';
$icecast_rrd = Rrd::name($device['hostname'], ['app', 'icecast', $app['app_id']]);
$icecast_rrd = Rrd::name($device['hostname'], ['app', 'icecast', $app->app_id]);
if (Rrd::checkRrdExists($icecast_rrd)) {
$rrd_filename = $icecast_rrd;

View File

@@ -4,7 +4,7 @@ $scale_min = 1000;
require 'includes/html/graphs/common.inc.php';
$icecast_rrd = Rrd::name($device['hostname'], ['app', 'icecast', $app['app_id']]);
$icecast_rrd = Rrd::name($device['hostname'], ['app', 'icecast', $app->app_id]);
if (Rrd::checkRrdExists($icecast_rrd)) {
$rrd_filename = $icecast_rrd;

View File

@@ -25,7 +25,7 @@ $dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 33;
$rrd_filename = Rrd::name($device['hostname'], ['app', $app['app_type'], $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $app->app_type, $app->app_id]);
$array = [
'senders' => ['descr' => 'Sender(s)', 'colour' => '11d3f5'],

View File

@@ -25,7 +25,7 @@ $dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 33;
$rrd_filename = Rrd::name($device['hostname'], ['app', $app['app_type'], $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $app->app_type, $app->app_id]);
$array = [
'received' => ['descr' => 'Received', 'colour' => '75a832'],

View File

@@ -25,7 +25,7 @@ $dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 33;
$rrd_filename = Rrd::name($device['hostname'], ['app', $app['app_type'], $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', $app->app_type, $app->app_id]);
$array = [
'bytesreceived' => ['descr' => 'bytes Received', 'colour' => '4CB24C'],

View File

@@ -6,7 +6,7 @@ $scale_min = 0;
$colours = 'mixed';
$nototal = (($width < 550) ? 1 : 0);
$unit_text = 'Messages/sec';
$rrd_filename = Rrd::name($device['hostname'], ['app', 'mailscannerV2', $app['app_id']]);
$rrd_filename = Rrd::name($device['hostname'], ['app', 'mailscannerV2', $app->app_id]);
$array = [
'msg_rejected' => ['descr' => 'Rejected'],
'msg_relay' => ['descr' => 'Relayed'],

View File

@@ -15,7 +15,7 @@ $colour_area_out = 'CECEFF66';
$colour_area_in_max = 'CC88CC';
$colour_area_out_max = 'FFEFAA';
$mailscanner_rrd = Rrd::name($device['hostname'], ['app', 'mailscannerV2', $app['app_id']]);
$mailscanner_rrd = Rrd::name($device['hostname'], ['app', 'mailscannerV2', $app->app_id]);
if (Rrd::checkRrdExists($mailscanner_rrd)) {
$rrd_filename = $mailscanner_rrd;

Some files were not shown because too many files have changed in this diff Show More