Commit version 24.12.13800
This commit is contained in:
@ -5,65 +5,61 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
if (!empty($agent_data['app']['nfsd']))
|
||||
{
|
||||
$app_id = discover_app($device, 'nfsd');
|
||||
if (!empty($agent_data['app']['nfsd'])) {
|
||||
$app_id = discover_app($device, 'nfsd');
|
||||
|
||||
$rrd_filename = "app-nfsd-$app_id.rrd";
|
||||
$rrd_filename = "app-nfsd-$app_id.rrd";
|
||||
|
||||
$nfsLabel = array();
|
||||
$nfsLabel = [];
|
||||
|
||||
$nfsLabel['rc'] = array(
|
||||
"retrans", "miss", "nocache"
|
||||
);
|
||||
$nfsLabel['rc'] = [
|
||||
"retrans", "miss", "nocache"
|
||||
];
|
||||
|
||||
$nfsLabel['io'] = array(
|
||||
"r_bytes", "w_bytes"
|
||||
);
|
||||
$nfsLabel['io'] = [
|
||||
"r_bytes", "w_bytes"
|
||||
];
|
||||
|
||||
$nfsLabel['net'] = array(
|
||||
"n_count", "u_count", "t_data", "t_conn"
|
||||
);
|
||||
$nfsLabel['net'] = [
|
||||
"n_count", "u_count", "t_data", "t_conn"
|
||||
];
|
||||
|
||||
$nfsLabel['rpc'] = array(
|
||||
"calls", "badcalls", "badclnt", "xdrcall"
|
||||
);
|
||||
$nfsLabel['rpc'] = [
|
||||
"calls", "badcalls", "badclnt", "xdrcall"
|
||||
];
|
||||
|
||||
$nfsLabel['proc3'] = array(
|
||||
"null", "getattr", "setattr", "lookup", "access", "readlink",
|
||||
"read", "write", "create", "mkdir", "symlink", "mknod",
|
||||
"remove", "rmdir", "rename", "link", "readdr", "readdirplus",
|
||||
"fsstat", "fsinfo", "pathconf", "commit"
|
||||
);
|
||||
$nfsLabel['proc3'] = [
|
||||
"null", "getattr", "setattr", "lookup", "access", "readlink",
|
||||
"read", "write", "create", "mkdir", "symlink", "mknod",
|
||||
"remove", "rmdir", "rename", "link", "readdr", "readdirplus",
|
||||
"fsstat", "fsinfo", "pathconf", "commit"
|
||||
];
|
||||
|
||||
$datas = array();
|
||||
$datas = [];
|
||||
|
||||
foreach (explode("\n", $agent_data['app']['nfsd']) as $line)
|
||||
{
|
||||
$tokens = explode(" ", $line);
|
||||
if (isset($tokens[0]) && isset($nfsLabel[strtolower($tokens[0])]))
|
||||
{
|
||||
$base = strtolower($tokens[0]);
|
||||
array_shift($tokens);
|
||||
array_shift($tokens);
|
||||
foreach ($tokens as $k => $v)
|
||||
{
|
||||
$datas[$base.($nfsLabel[$base][$k])] = $v;
|
||||
}
|
||||
foreach (explode("\n", $agent_data['app']['nfsd']) as $line) {
|
||||
$tokens = explode(" ", $line);
|
||||
if (isset($tokens[0]) && isset($nfsLabel[strtolower($tokens[0])])) {
|
||||
$base = strtolower($tokens[0]);
|
||||
array_shift($tokens);
|
||||
array_shift($tokens);
|
||||
foreach ($tokens as $k => $v) {
|
||||
$datas[$base . ($nfsLabel[$base][$k])] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
update_application($app_id, $datas);
|
||||
rrdtool_update_ng($device, 'nfsd', $datas, $app_id);
|
||||
update_application($app_id, $datas);
|
||||
rrdtool_update_ng($device, 'nfsd', $datas, $app_id);
|
||||
|
||||
unset($app_id, $nfsLabel, $datas, $tokens, $base, $k, $v);
|
||||
unset($app_id, $nfsLabel, $datas, $tokens, $base, $k, $v);
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
Reference in New Issue
Block a user