aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin
diff options
context:
space:
mode:
authorJulien Rottenberg2010-09-14 15:50:10 -0700
committerPim van den Berg2010-09-15 19:01:07 +0200
commit3f9e0d74ff0c4db6d64051171b7aec1f8e3dcc3c (patch)
tree7855779681d8816d3b81e36e1e28214ac6dd7681 /plugin
parentplugin/swap: better alignment of graph legend (diff)
downloadapt-panopticon_cgp-3f9e0d74ff0c4db6d64051171b7aec1f8e3dcc3c.zip
apt-panopticon_cgp-3f9e0d74ff0c4db6d64051171b7aec1f8e3dcc3c.tar.gz
apt-panopticon_cgp-3f9e0d74ff0c4db6d64051171b7aec1f8e3dcc3c.tar.bz2
apt-panopticon_cgp-3f9e0d74ff0c4db6d64051171b7aec1f8e3dcc3c.tar.xz
plugin: add nfs plugin
Diffstat (limited to 'plugin')
-rw-r--r--plugin/nfs.php85
1 files changed, 85 insertions, 0 deletions
diff --git a/plugin/nfs.php b/plugin/nfs.php
new file mode 100644
index 0000000..d389963
--- /dev/null
+++ b/plugin/nfs.php
@@ -0,0 +1,85 @@
1<?php
2
3# Collectd NFS plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/GenericStacked.class.php';
7require_once 'inc/collectd.inc.php';
8
9
10# Check http://github.com/octo/collectd/blob/master/src/nfs.c
11
12## LAYOUT
13# nfs-XX/nfs_procedure-YY.rrd
14
15$obj = new Type_GenericStacked($CONFIG);
16$obj->data_sources = array('value');
17switch($obj->args['pinstance']) {
18 case 'v2client':
19 $obj->order = array('create', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'null', 'readdir', 'readlink', 'read', 'remove', 'rename', 'rmdir', 'root', 'setattr', 'symlink', 'wrcache', 'write');
20 $obj->ds_names = array(
21 'create' => 'Create ',
22 'fsstat' => 'FSStat ',
23 'getattr' => 'GetAttr ',
24 'link' => 'Link ',
25 'lookup' => 'Lookup ',
26 'mkdir' => 'MkDir ',
27 'null' => 'Null ',
28 'readdir' => 'ReadDir ',
29 'readlink' => 'ReadLink ',
30 'read' => 'Read ',
31 'remove' => 'Remove ',
32 'rename' => 'Rename ',
33 'rmdir' => 'RmDir ',
34 'root' => 'Root ',
35 'setattr' => 'SetAttr ',
36 'symlink' => 'SymLink ',
37 'wrcache' => 'WrCache ',
38 'write' => 'Write ',
39 );
40 $obj->generate_colors();
41 break;
42
43 case 'v3client':
44 $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');
45 $obj->ds_names = array(
46 'getattr' => 'GetAttr ',
47 'setattr' => 'SetAttr ',
48 'lookup' => 'Lookup ',
49 'access' => 'Access ',
50 'readlink' => 'ReadLink ',
51 'read' => 'Read ',
52 'write' => 'Write ',
53 'create' => 'Create ',
54 'mkdir' => 'MkDir ',
55 'symlink' => 'Symlink ',
56 'mknod' => 'MkNode ',
57 'remove' => 'Remove ',
58 'rmdir' => 'RmDir ',
59 'rename' => 'Rename ',
60 'link' => 'Link ',
61 'readdir' => 'ReadDir ',
62 'readdirplus' => 'ReadDirPlus ',
63 'fsstat' => 'FsStat ',
64 'fsinfo' => 'FsInfo ',
65 'pathconf' => 'PathConf ',
66 'commit' => 'Commit ',
67 'null' => 'Null ',
68 );
69 $obj->generate_colors();
70
71 break;
72
73
74}
75$obj->width = $width;
76$obj->heigth = $heigth;
77
78$obj->rrd_title = sprintf('NFS-%s Procedures', $obj->args['pinstance']);
79$obj->rrd_vertical = 'Procedures';
80$obj->rrd_format = '%5.2lf';
81
82collectd_flush($obj->identifiers);
83$obj->rrd_graph();
84
85?>