aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/nfs.php
blob: d38996369c42594ed6c620eacf8797355f3466ee (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?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');
        $obj->ds_names = array(
            'create'   => 'Create   ',
            'fsstat'   => 'FSStat   ',
            'getattr'  => 'GetAttr  ',
            'link'     => 'Link     ',
            'lookup'   => 'Lookup   ',
            'mkdir'    => 'MkDir    ',
            'null'     => 'Null     ',
            'readdir'  => 'ReadDir  ',
            'readlink' => 'ReadLink ',
            'read'     => 'Read     ',   
            'remove'   => 'Remove   ',
            'rename'   => 'Rename   ',
            'rmdir'    => 'RmDir    ',
            'root'     => 'Root     ',
            'setattr'  => 'SetAttr  ',
            'symlink'  => 'SymLink  ',
            'wrcache'  => 'WrCache  ',
            'write'    => 'Write    ',
        );
        $obj->generate_colors();
    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');
        $obj->ds_names = array(
            'getattr'     => 'GetAttr     ',
            'setattr'     => 'SetAttr     ',
            'lookup'      => 'Lookup      ',
            'access'      => 'Access      ',
            'readlink'    => 'ReadLink    ',
            'read'        => 'Read        ',
            'write'       => 'Write       ',
            'create'      => 'Create      ',
            'mkdir'       => 'MkDir       ',
            'symlink'     => 'Symlink     ',
            'mknod'       => 'MkNode      ',
            'remove'      => 'Remove      ',
            'rmdir'       => 'RmDir       ',
            'rename'      => 'Rename      ',
            'link'        => 'Link        ',
            'readdir'     => 'ReadDir     ',
            'readdirplus' => 'ReadDirPlus ',
            'fsstat'      => 'FsStat      ',
            'fsinfo'      => 'FsInfo      ',
            'pathconf'    => 'PathConf    ',
            'commit'      => 'Commit      ',
            'null'        => 'Null        ',
        );
        $obj->generate_colors();

    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();

?>