Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFS-server #6320

Merged
merged 16 commits into from Apr 28, 2017
13 changes: 12 additions & 1 deletion doc/Extensions/Applications.md
Expand Up @@ -18,6 +18,7 @@ Different applications support a variety of ways collect data: by direct connect
1. [Munin](#munin) - Agent
1. [MySQL](#mysql) - SNMP extend, Agent
1. [NGINX](#nginx) - Agent
1. [NFS-server](#nfs-server) - SNMP extend
1. [NTP Client](#ntp-client) - SNMP extend
1. [NTP Server](#ntp-server) - SNMP extend
1. [Nvidia GPU](#nvidia-gpu) - SNMP extend
Expand All @@ -36,7 +37,6 @@ Different applications support a variety of ways collect data: by direct connect
1. [UPS-nut](#ups-nut) - SNMP extend
1. [UPS-apcups](#ups-apcups) - SNMP extend


### Apache
Either use SNMP extend or use the agent.
##### SNMP Extend
Expand Down Expand Up @@ -333,6 +333,17 @@ extend nginx /etc/snmp/nginx-stats
##### Agent
[Install the agent](Agent-Setup.md) on this device if it isn't already and copy the `nginx` script to `/usr/lib/check_mk_agent/local/`

##### NFS-server
Export the NFS stats from as server.

##### SNMP Extend
1. Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add :
```
extend nfs-server /bin/cat /proc/net/rpc/nfsd
```
note : find out where cat is located using : `which cat`

2. reload snmpd service to activate the configuration

### NTP Client
A shell script that gets stats from ntp client.
Expand Down
3 changes: 3 additions & 0 deletions html/includes/functions.inc.php
Expand Up @@ -72,6 +72,9 @@ function nicecase($item)

case 'nfs-v3-stats':
return 'NFS v3 Stats';

case 'nfs-server':
return 'NFS Server';

case 'ntp':
return 'NTP';
Expand Down
52 changes: 52 additions & 0 deletions html/includes/graphs/application/nfs-server_fh.inc.php
@@ -0,0 +1,52 @@
<?php
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*
* @package LibreNMS
* @subpackage nfs-server
* @link http://librenms.org
* @copyright 2017 LibreNMS
* @author SvennD <svennd@svennd.be>
*/

require 'includes/graphs/common.inc.php';
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'File Handle Stats';
$unitlen = 15;
$bigdescrlen = 15;
$smalldescrlen = 15;
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 33;

$rrd_filename = rrd_name($device['hostname'], array('app', 'nfs-server-default', $app['app_id']));

$array = array(
'fh_lookup' => array('descr' => 'fh_lookup'),
'fh_anon' => array('descr' => 'fh_anon'),
'fh_ncachedir' => array('descr' => 'fh_ncachedir'),
'fh_ncachenondir' => array('descr' => 'fh_ncachenondir'),
'fh_stale' => array('descr' => 'fh_stale'), // only var that should show something
);

$i = 0;

if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $var) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $var['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
} else {
echo "file missing: $rrd_filename";
}

require 'includes/graphs/generic_v3_multiline.inc.php';
64 changes: 64 additions & 0 deletions html/includes/graphs/application/nfs-server_io.inc.php
@@ -0,0 +1,64 @@
<?php
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*
* @package LibreNMS
* @subpackage nfs-server
* @link http://librenms.org
* @copyright 2017 LibreNMS
* @author SvennD <svennd@svennd.be>
*/

require 'includes/graphs/common.inc.php';
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'Operations';
$unitlen = 10;
$bigdescrlen = 15;
$smalldescrlen = 15;
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 33;

$rrd_filename = rrd_name($device['hostname'], array('app', 'nfs-server-default', $app['app_id']));

$array = array(
'io_read' => array('descr' => 'read','colour' => '2B9220',),
'io_write' => array('descr' => 'write','colour' => 'B0262D',),
);

$i = 0;

if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $var) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $var['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $var['colour'];
$i++;
}
} else {
echo "file missing: $rrd_filename";
}

require 'includes/graphs/generic_v3_multiline.inc.php';


/*
This would create a graph with reads above and write belows;
I can't find out how to adapt the legend. If you wish to swap graphs,
uncomment all the above untill <?php and uncomment below this note

$rrd_filename = rrd_name($device['hostname'], array('app', 'nfs-server-default', $app['app_id']));

$ds_in = 'io_read';
$ds_out = 'io_write';

require 'includes/graphs/generic_data.inc.php';

*/
49 changes: 49 additions & 0 deletions html/includes/graphs/application/nfs-server_net.inc.php
@@ -0,0 +1,49 @@
<?php
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*
* @package LibreNMS
* @subpackage nfs-server
* @link http://librenms.org
* @copyright 2017 LibreNMS
* @author SvennD <svennd@svennd.be>
*/

require 'includes/graphs/common.inc.php';
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'net stats packets';
$unitlen = 15;
$bigdescrlen = 15;
$smalldescrlen = 15;
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 33;

$rrd_filename = rrd_name($device['hostname'], array('app', 'nfs-server-default', $app['app_id']));

$array = array(
'net_udp' => array('descr' => 'udp','colour' => 'AA3F39',),
'net_tcp' => array('descr' => 'tcp','colour' => '2C8437',),
);

$i = 0;

if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $var) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $var['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $var['colour'];
$i++;
}
} else {
echo "file missing: $rrd_filename";
}

require 'includes/graphs/generic_v3_multiline.inc.php';
28 changes: 28 additions & 0 deletions html/includes/graphs/application/nfs-server_net_tcp_conns.inc.php
@@ -0,0 +1,28 @@
<?php
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*
* @package LibreNMS
* @subpackage nfs-server
* @link http://librenms.org
* @copyright 2017 LibreNMS
* @author SvennD <svennd@svennd.be>
*/

require 'includes/graphs/common.inc.php';

$scale_min = 0;
$ds = 'net_tcpconn';
$colour_area = '9DDA52';
$colour_line = '2EAC6D';
$colour_area_max = 'FFEE99';
$graph_max = 10000;
$unit_text = 'net tcp connections';

$rrd_filename = rrd_name($device['hostname'], array('app', 'nfs-server-default', $app['app_id']));

require 'includes/graphs/generic_simplex.inc.php';
58 changes: 58 additions & 0 deletions html/includes/graphs/application/nfs-server_ra.inc.php
@@ -0,0 +1,58 @@
<?php
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*
* @package LibreNMS
* @subpackage nfs-server
* @link http://librenms.org
* @copyright 2017 LibreNMS
* @author SvennD <svennd@svennd.be>
*/

require 'includes/graphs/common.inc.php';
$scale_min = 0;
$colours = 'mixed';
$unit_text = 'cache depth';
$unitlen = 15;
$bigdescrlen = 15;
$smalldescrlen = 15;
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 33;

$rrd_filename = rrd_name($device['hostname'], array('app', 'nfs-server-default', $app['app_id']));

$array = array(
'ra_range01' => array('descr' => '0%-10%'),
'ra_range02' => array('descr' => '10%-20%'),
'ra_range03' => array('descr' => '20%-30%'),
'ra_range04' => array('descr' => '30%-40%'),
'ra_range05' => array('descr' => '40%-50%'),
'ra_range06' => array('descr' => '50%-60%'),
'ra_range07' => array('descr' => '60%-70%'),
'ra_range08' => array('descr' => '70%-80%'),
'ra_range09' => array('descr' => '80%-90%'),
'ra_range10' => array('descr' => '90%-100%'),
'ra_notfound' => array('descr' => 'not found'),
);

$i = 0;

if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $var) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $var['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
} else {
echo "file missing: $rrd_filename";
}

require 'includes/graphs/generic_v3_multiline.inc.php';
49 changes: 49 additions & 0 deletions html/includes/graphs/application/nfs-server_rc.inc.php
@@ -0,0 +1,49 @@
<?php
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*
* @package LibreNMS
* @subpackage nfs-server
* @link http://librenms.org
* @copyright 2017 LibreNMS
* @author SvennD <svennd@svennd.be>
*/

require 'includes/graphs/common.inc.php';
$scale_min = 0;
$unit_text = 'Reply cache';
$unitlen = 15;
$bigdescrlen = 15;
$smalldescrlen = 15;
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 33;

$rrd_filename = rrd_name($device['hostname'], array('app', 'nfs-server-default', $app['app_id']));

$array = array(
'rc_hits' => array('descr' => 'hits','colour' => 'B0262D'), // this is bad : retransmitting (red)
'rc_misses' => array('descr' => 'misses','colour' => 'B36326'), // requires caching
'rc_nocache' => array('descr' => 'nocache','colour' => '2B9220'), // no caching needed
);

$i = 0;

if (rrdtool_check_rrd_exists($rrd_filename)) {
foreach ($array as $ds => $var) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $var['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $var['colour'];
$i++;
}
} else {
echo "file missing: $rrd_filename";
}

require 'includes/graphs/generic_v3_multiline.inc.php';