Files
Zane C. Bowers-HadleyandGitHub 75d4da325a add generic and improved NFS support with initial support for both FreeBSD and Linux (#15906)
* add nfs-shared.inc.php

* add nfs poller

* polling now works

* add nfs.inc.php page

* mount options works now

* format cleanup

* add some missing items to the stats

* commit work from last night so I can swap over to ldap

* add gauge support

* save the OS type for it

* more work on NFS stuff

* more nfs work

* display cleanup some

* more nfs work

* update docs for NFS

* add nfs_server_rpc

* style fix

* add snmprec file

* more test stuff

* data cleanup

* style cleanup

* more style fix

* another style fix

* add deleted_at

* add client_rpc_info_calls

* more test tweaks

* more tweaks

* set two items as gauges that should be gauges

* convert a few more things from counters to gauges

* a few more tweaks for NFSv4
2024-06-30 19:36:58 -05:00

69 lines
1.7 KiB
PHP

<?php
// use the default if not set
if (! isset($vars['nfs_os'])) {
$vars['nfs_os'] = '';
}
include 'includes/nfs-shared.inc.php';
$name = 'nfs';
$app_id = $app['app_id'];
if (! isset($unit_text)) {
$unit_text = 'per second';
}
if (! isset($colours)) {
if (isset($nfs_graphs_colours[$nfs_graph_name])) {
$colours = $nfs_graphs_colours[$nfs_graph_name];
} else {
$colours = 'psychedelic';
}
}
if (! isset($dostack)) {
$dostack = 0;
}
if (! isset($printtotal)) {
$printtotal = 1;
}
if (! isset($addarea)) {
$addarea = 0;
}
$transparency = 0;
if (! isset($float_precision)) {
$float_precision = 3;
}
// if we don't have a OS specific graph set, use the default
if (! isset($nfs_graphs[$nfs_graph_name][$vars['nfs_os']])) {
$vars['nfs_os'] = '';
}
if (isset($start_stat) && isset($end_stat)) {
$stat_set = [];
$stat_keys_int = $start_stat;
$stat_keys = array_keys($nfs_graphs[$nfs_graph_name][$vars['nfs_os']]);
sort($stat_keys);
while (isset($stat_keys[$stat_keys_int]) && $stat_keys_int <= $end_stat) {
$stat_set[$stat_keys[$stat_keys_int]] = $nfs_graphs[$nfs_graph_name][$vars['nfs_os']][$stat_keys[$stat_keys_int]];
$stat_keys_int++;
}
} else {
$stat_set = $nfs_graphs[$nfs_graph_name][$vars['nfs_os']];
}
$rrd_list = [];
foreach ($stat_set as $stat => $descr) {
$filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, $stat]);
if (Rrd::checkRrdExists($filename)) {
$rrd_list[] = [
'filename' => $filename,
'descr' => $descr,
'ds' => 'data',
];
}
}
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
require 'includes/html/graphs/generic_multi_line.inc.php';