aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/nfs.php
blob: b9bc78e58a096259bce14604ab9850e8c7ded01c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

# Collectd NFS plugin

require_once 'conf/common.inc.php';
require_once 'type/GenericStacked.class.php';
require_once 'inc/collectd.inc.php';


# Check http://github.com/octo/collectd/blob/master/src/nfs.c

## LAYOUT
# nfs-XX/nfs_procedure-YY.rrd

$obj = new Type_GenericStacked($CONFIG);
$obj->data_sources = array('value');
switch($obj->args['pinstance']) {
	case 'v2client':
		$obj->order = array('create', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'null', 'readdir', 'readlink', 'read', 'remove', 'rename', 'rmdir', 'root', 'setattr', 'symlink', 'wrcache', 'write');
	break;

	case 'v3client':
		$obj->order = array('access', 'commit', 'create', 'fsinfo', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'mknod', 'null', 'pathconf', 'read', 'readdir', 'readdirplus', 'readlink', 'remove', 'rename', 'rmdir', 'setattr', 'symlink', 'write');
	break;
}

$obj->width = $width;
$obj->heigth = $heigth;

$obj->rrd_title = sprintf('NFS-%s Procedures', $obj->args['pinstance']);
$obj->rrd_vertical = 'Procedures';
$obj->rrd_format = '%5.2lf';

collectd_flush($obj->identifiers);
$obj->rrd_graph();