diff options
| author | Pim van den Berg | 2012-08-10 19:02:29 +0200 |
|---|---|---|
| committer | Pim van den Berg | 2012-08-10 19:07:45 +0200 |
| commit | dae438c070bb02e50c231a9ac6f7ea4b9b90fd2c (patch) | |
| tree | ce45e515b343f236e8cb66c0ed2c55ec70c95ec8 /plugin | |
| parent | introduce config option datasize to show graphs in bits or bytes (diff) | |
| download | apt-panopticon_cgp-dae438c070bb02e50c231a9ac6f7ea4b9b90fd2c.zip apt-panopticon_cgp-dae438c070bb02e50c231a9ac6f7ea4b9b90fd2c.tar.gz apt-panopticon_cgp-dae438c070bb02e50c231a9ac6f7ea4b9b90fd2c.tar.bz2 apt-panopticon_cgp-dae438c070bb02e50c231a9ac6f7ea4b9b90fd2c.tar.xz | |
plugin: convert spaces to tabs
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/memcached.php | 94 | ||||
| -rw-r--r-- | plugin/nfs.php | 12 | ||||
| -rw-r--r-- | plugin/vmem.php | 2 | ||||
| -rw-r--r-- | plugin/vserver.php | 187 |
4 files changed, 147 insertions, 148 deletions
diff --git a/plugin/memcached.php b/plugin/memcached.php index accf6b3..2230f3f 100644 --- a/plugin/memcached.php +++ b/plugin/memcached.php | |||
| @@ -24,9 +24,9 @@ require_once 'inc/collectd.inc.php'; | |||
| 24 | switch(GET('t')) { | 24 | switch(GET('t')) { |
| 25 | # df-cache.rrd | 25 | # df-cache.rrd |
| 26 | case 'df': | 26 | case 'df': |
| 27 | require_once 'type/Default.class.php'; | 27 | require_once 'type/Default.class.php'; |
| 28 | $obj = new Type_Default($CONFIG); | 28 | $obj = new Type_Default($CONFIG); |
| 29 | $obj->data_sources = array('used', 'free'); | 29 | $obj->data_sources = array('used', 'free'); |
| 30 | $obj->order = array('used', 'free'); | 30 | $obj->order = array('used', 'free'); |
| 31 | $obj->ds_names = array( | 31 | $obj->ds_names = array( |
| 32 | 'used' => 'Used', | 32 | 'used' => 'Used', |
| @@ -54,7 +54,7 @@ switch(GET('t')) { | |||
| 54 | $obj->colors = array( | 54 | $obj->colors = array( |
| 55 | 'flush' => '00e000', | 55 | 'flush' => '00e000', |
| 56 | 'get' => '0000ff', | 56 | 'get' => '0000ff', |
| 57 | 'set' => 'ffb000', | 57 | 'set' => 'ffb000', |
| 58 | ); | 58 | ); |
| 59 | $obj->rrd_title = 'Memcached Commands'; | 59 | $obj->rrd_title = 'Memcached Commands'; |
| 60 | $obj->rrd_vertical = 'Commands'; | 60 | $obj->rrd_vertical = 'Commands'; |
| @@ -62,39 +62,39 @@ switch(GET('t')) { | |||
| 62 | 62 | ||
| 63 | # memcached_connections-current.rrd | 63 | # memcached_connections-current.rrd |
| 64 | case 'memcached_connections': | 64 | case 'memcached_connections': |
| 65 | require_once 'type/Default.class.php'; | 65 | require_once 'type/Default.class.php'; |
| 66 | $obj = new Type_Default($CONFIG); | 66 | $obj = new Type_Default($CONFIG); |
| 67 | $obj->data_sources = array('value'); | 67 | $obj->data_sources = array('value'); |
| 68 | $obj->ds_names = array( | 68 | $obj->ds_names = array( |
| 69 | 'value' => 'Connections', | 69 | 'value' => 'Connections', |
| 70 | ); | 70 | ); |
| 71 | $obj->colors = array( | 71 | $obj->colors = array( |
| 72 | 'percent' => '00b000', | 72 | 'percent' => '00b000', |
| 73 | ); | 73 | ); |
| 74 | $obj->rrd_title = 'Memcached Number of Connections'; | 74 | $obj->rrd_title = 'Memcached Number of Connections'; |
| 75 | $obj->rrd_vertical = 'Connections'; | 75 | $obj->rrd_vertical = 'Connections'; |
| 76 | break; | 76 | break; |
| 77 | 77 | ||
| 78 | # memcached_items-current.rrd | 78 | # memcached_items-current.rrd |
| 79 | case 'memcached_items': | 79 | case 'memcached_items': |
| 80 | require_once 'type/Default.class.php'; | 80 | require_once 'type/Default.class.php'; |
| 81 | $obj = new Type_Default($CONFIG); | 81 | $obj = new Type_Default($CONFIG); |
| 82 | $obj->data_sources = array('value'); | 82 | $obj->data_sources = array('value'); |
| 83 | $obj->ds_names = array( | 83 | $obj->ds_names = array( |
| 84 | 'value ' => 'Items', | 84 | 'value ' => 'Items', |
| 85 | ); | 85 | ); |
| 86 | $obj->colors = array( | 86 | $obj->colors = array( |
| 87 | 'value' => '00b000', | 87 | 'value' => '00b000', |
| 88 | ); | 88 | ); |
| 89 | $obj->rrd_title = 'Number of Items in Memcached'; | 89 | $obj->rrd_title = 'Number of Items in Memcached'; |
| 90 | $obj->rrd_vertical = 'Items'; | 90 | $obj->rrd_vertical = 'Items'; |
| 91 | break; | 91 | break; |
| 92 | 92 | ||
| 93 | # memcached_octets.rrd | 93 | # memcached_octets.rrd |
| 94 | case 'memcached_octets': | 94 | case 'memcached_octets': |
| 95 | require_once 'type/Default.class.php'; | 95 | require_once 'type/Default.class.php'; |
| 96 | $obj = new Type_Default($CONFIG); | 96 | $obj = new Type_Default($CONFIG); |
| 97 | $obj->data_sources = array('rx', 'tx'); | 97 | $obj->data_sources = array('rx', 'tx'); |
| 98 | $obj->order = array('rx', 'tx'); | 98 | $obj->order = array('rx', 'tx'); |
| 99 | $obj->ds_names = array( | 99 | $obj->ds_names = array( |
| 100 | 'rx' => 'Receive', | 100 | 'rx' => 'Receive', |
| @@ -115,13 +115,13 @@ switch(GET('t')) { | |||
| 115 | $obj->order = array('evictions', 'hits', 'misses'); | 115 | $obj->order = array('evictions', 'hits', 'misses'); |
| 116 | $obj->ds_names = array( | 116 | $obj->ds_names = array( |
| 117 | 'evictions' => 'Evictions', | 117 | 'evictions' => 'Evictions', |
| 118 | 'hits' => 'Hits', | 118 | 'hits' => 'Hits', |
| 119 | 'misses' => 'Misses', | 119 | 'misses' => 'Misses', |
| 120 | ); | 120 | ); |
| 121 | $obj->colors = array( | 121 | $obj->colors = array( |
| 122 | 'evictions' => '00e000', | 122 | 'evictions' => '00e000', |
| 123 | 'hits' => '0000ff', | 123 | 'hits' => '0000ff', |
| 124 | 'misses' => 'ffb000', | 124 | 'misses' => 'ffb000', |
| 125 | ); | 125 | ); |
| 126 | $obj->rrd_title = 'Memcached Operations'; | 126 | $obj->rrd_title = 'Memcached Operations'; |
| 127 | $obj->rrd_vertical = 'Commands'; | 127 | $obj->rrd_vertical = 'Commands'; |
| @@ -129,23 +129,23 @@ switch(GET('t')) { | |||
| 129 | 129 | ||
| 130 | # percent-hitratio.rrd | 130 | # percent-hitratio.rrd |
| 131 | case 'percent': | 131 | case 'percent': |
| 132 | require_once 'type/Default.class.php'; | 132 | require_once 'type/Default.class.php'; |
| 133 | $obj = new Type_Default($CONFIG); | 133 | $obj = new Type_Default($CONFIG); |
| 134 | $obj->data_sources = array('percent'); | 134 | $obj->data_sources = array('percent'); |
| 135 | $obj->ds_names = array( | 135 | $obj->ds_names = array( |
| 136 | 'percent ' => 'Percentage', | 136 | 'percent ' => 'Percentage', |
| 137 | ); | 137 | ); |
| 138 | $obj->colors = array( | 138 | $obj->colors = array( |
| 139 | 'percent' => '00e000', | 139 | 'percent' => '00e000', |
| 140 | ); | 140 | ); |
| 141 | $obj->rrd_title = 'Memcached Hits/Gets Ratio'; | 141 | $obj->rrd_title = 'Memcached Hits/Gets Ratio'; |
| 142 | $obj->rrd_vertical = 'Percent'; | 142 | $obj->rrd_vertical = 'Percent'; |
| 143 | break; | 143 | break; |
| 144 | # ps_count.rrd | 144 | # ps_count.rrd |
| 145 | case 'ps_count': | 145 | case 'ps_count': |
| 146 | require_once 'type/Default.class.php'; | 146 | require_once 'type/Default.class.php'; |
| 147 | $obj = new Type_Default($CONFIG); | 147 | $obj = new Type_Default($CONFIG); |
| 148 | $obj->data_sources = array('threads'); | 148 | $obj->data_sources = array('threads'); |
| 149 | $obj->order = array('threads'); | 149 | $obj->order = array('threads'); |
| 150 | $obj->ds_names = array( | 150 | $obj->ds_names = array( |
| 151 | 'threads' => 'Threads', | 151 | 'threads' => 'Threads', |
| @@ -159,9 +159,9 @@ switch(GET('t')) { | |||
| 159 | 159 | ||
| 160 | # ps_cputime.rrd | 160 | # ps_cputime.rrd |
| 161 | case 'ps_cputime': | 161 | case 'ps_cputime': |
| 162 | require_once 'type/Default.class.php'; | 162 | require_once 'type/Default.class.php'; |
| 163 | $obj = new Type_Default($CONFIG); | 163 | $obj = new Type_Default($CONFIG); |
| 164 | $obj->data_sources = array('user', 'syst'); | 164 | $obj->data_sources = array('user', 'syst'); |
| 165 | $obj->order = array('user', 'syst'); | 165 | $obj->order = array('user', 'syst'); |
| 166 | $obj->ds_names = array( | 166 | $obj->ds_names = array( |
| 167 | 'user' => 'User', | 167 | 'user' => 'User', |
diff --git a/plugin/nfs.php b/plugin/nfs.php index ca69b06..b9bc78e 100644 --- a/plugin/nfs.php +++ b/plugin/nfs.php | |||
| @@ -15,13 +15,13 @@ require_once 'inc/collectd.inc.php'; | |||
| 15 | $obj = new Type_GenericStacked($CONFIG); | 15 | $obj = new Type_GenericStacked($CONFIG); |
| 16 | $obj->data_sources = array('value'); | 16 | $obj->data_sources = array('value'); |
| 17 | switch($obj->args['pinstance']) { | 17 | switch($obj->args['pinstance']) { |
| 18 | case 'v2client': | 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'); | 19 | $obj->order = array('create', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'null', 'readdir', 'readlink', 'read', 'remove', 'rename', 'rmdir', 'root', 'setattr', 'symlink', 'wrcache', 'write'); |
| 20 | break; | 20 | break; |
| 21 | 21 | ||
| 22 | case 'v3client': | 22 | case 'v3client': |
| 23 | $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'); | 23 | $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'); |
| 24 | break; | 24 | break; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | $obj->width = $width; | 27 | $obj->width = $width; |
diff --git a/plugin/vmem.php b/plugin/vmem.php index 2fae536..fae94f8 100644 --- a/plugin/vmem.php +++ b/plugin/vmem.php | |||
| @@ -46,7 +46,7 @@ switch($obj->args['type']) { | |||
| 46 | $obj->order = array('active_anon', 'active_file', | 46 | $obj->order = array('active_anon', 'active_file', |
| 47 | 'anon_pages', 'bounce', | 47 | 'anon_pages', 'bounce', |
| 48 | 'dirty', 'file_pages', | 48 | 'dirty', 'file_pages', |
| 49 | 'free_pages', 'inactive_anon', | 49 | 'free_pages', 'inactive_anon', |
| 50 | 'inactive_file', 'mapped', | 50 | 'inactive_file', 'mapped', |
| 51 | 'mlock', 'page_table_pages', | 51 | 'mlock', 'page_table_pages', |
| 52 | 'slab_reclaimable', 'slab_unreclaimable', | 52 | 'slab_reclaimable', 'slab_unreclaimable', |
diff --git a/plugin/vserver.php b/plugin/vserver.php index e51d97d..204134e 100644 --- a/plugin/vserver.php +++ b/plugin/vserver.php | |||
| @@ -28,110 +28,109 @@ require_once 'inc/collectd.inc.php'; | |||
| 28 | $obj = new Type_Default($CONFIG); | 28 | $obj = new Type_Default($CONFIG); |
| 29 | 29 | ||
| 30 | switch($obj->args['type']) { | 30 | switch($obj->args['type']) { |
| 31 | case 'load': | 31 | case 'load': |
| 32 | require_once "plugin/load.php"; | 32 | require_once "plugin/load.php"; |
| 33 | break; | 33 | break; |
| 34 | case 'vs_memory': | 34 | case 'vs_memory': |
| 35 | $obj = new Type_GenericStacked($CONFIG); | 35 | $obj = new Type_GenericStacked($CONFIG); |
| 36 | $obj->order = array('vm', 'vml', 'rss', 'anon'); | 36 | $obj->order = array('vm', 'vml', 'rss', 'anon'); |
| 37 | # http://oldwiki.linux-vserver.org/Memory+Allocation | 37 | # http://oldwiki.linux-vserver.org/Memory+Allocation |
| 38 | $obj->ds_names = array( | 38 | $obj->ds_names = array( |
| 39 | 'vm' => "Virtual memory pages", | 39 | 'vm' => "Virtual memory pages", |
| 40 | 'vml' => "Pages locked into memory", | 40 | 'vml' => "Pages locked into memory", |
| 41 | 'rss' => "Resident set size", | 41 | 'rss' => "Resident set size", |
| 42 | 'anon' => "Anonymous memory pages", | 42 | 'anon' => "Anonymous memory pages", |
| 43 | ); | 43 | ); |
| 44 | $obj->colors = array( | 44 | $obj->colors = array( |
| 45 | 'vm' => '00e000', | 45 | 'vm' => '00e000', |
| 46 | 'vml' => '0000ff', | 46 | 'vml' => '0000ff', |
| 47 | 'rss' => 'ffb000', | 47 | 'rss' => 'ffb000', |
| 48 | 'anon' => 'ff00ff', | 48 | 'anon' => 'ff00ff', |
| 49 | ); | 49 | ); |
| 50 | $obj->width = $width; | 50 | $obj->width = $width; |
| 51 | $obj->heigth = $heigth; | 51 | $obj->heigth = $heigth; |
| 52 | 52 | ||
| 53 | $obj->rrd_title = sprintf('Memory utilization on Vserver %s', $obj->args['pinstance']); | 53 | $obj->rrd_title = sprintf('Memory utilization on Vserver %s', $obj->args['pinstance']); |
| 54 | $obj->rrd_vertical = ucfirst($CONFIG['datasize']); | 54 | $obj->rrd_vertical = ucfirst($CONFIG['datasize']); |
| 55 | $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; | 55 | $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; |
| 56 | $obj->rrd_format = '%5.1lf%s'; | 56 | $obj->rrd_format = '%5.1lf%s'; |
| 57 | 57 | ||
| 58 | collectd_flush($obj->identifiers); | 58 | collectd_flush($obj->identifiers); |
| 59 | $obj->rrd_graph(); | 59 | $obj->rrd_graph(); |
| 60 | break; | 60 | break; |
| 61 | case 'vs_threads': | 61 | case 'vs_threads': |
| 62 | $obj = new Type_GenericStacked($CONFIG); | 62 | $obj = new Type_GenericStacked($CONFIG); |
| 63 | $obj->order = array('running', 'uninterruptable', 'onhold', 'total'); | 63 | $obj->order = array('running', 'uninterruptable', 'onhold', 'total'); |
| 64 | # http://linux-vserver.org/ProcFS | 64 | # http://linux-vserver.org/ProcFS |
| 65 | $obj->ds_names = array( | 65 | $obj->ds_names = array( |
| 66 | 'onhold' => "Number of threads on hold", | 66 | 'onhold' => "Number of threads on hold", |
| 67 | 'running' => "Number of running threads", | 67 | 'running' => "Number of running threads", |
| 68 | 'total' => "Total number of threads", | 68 | 'total' => "Total number of threads", |
| 69 | 'uninterruptable' => "Number of uninterruptible threads", | 69 | 'uninterruptable' => "Number of uninterruptible threads", |
| 70 | ); | 70 | ); |
| 71 | $obj->colors = array( | 71 | $obj->colors = array( |
| 72 | 'onhold' => '00e000', | 72 | 'onhold' => '00e000', |
| 73 | 'running' => '0000ff', | 73 | 'running' => '0000ff', |
| 74 | 'total' => 'ffb000', | 74 | 'total' => 'ffb000', |
| 75 | 'uninterruptable' => 'ff00ff', | 75 | 'uninterruptable' => 'ff00ff', |
| 76 | ); | 76 | ); |
| 77 | $obj->width = $width; | 77 | $obj->width = $width; |
| 78 | $obj->heigth = $heigth; | 78 | $obj->heigth = $heigth; |
| 79 | 79 | ||
| 80 | $obj->rrd_title = sprintf('Threads on Vserver %s', $obj->args['pinstance']); | 80 | $obj->rrd_title = sprintf('Threads on Vserver %s', $obj->args['pinstance']); |
| 81 | $obj->rrd_vertical = 'Numbers'; | 81 | $obj->rrd_vertical = 'Numbers'; |
| 82 | $obj->rrd_format = '%5.1lf%s'; | 82 | $obj->rrd_format = '%5.1lf%s'; |
| 83 | 83 | ||
| 84 | collectd_flush($obj->identifiers); | 84 | collectd_flush($obj->identifiers); |
| 85 | $obj->rrd_graph(); | 85 | $obj->rrd_graph(); |
| 86 | break; | 86 | break; |
| 87 | case 'if_octets': | 87 | case 'if_octets': |
| 88 | $obj->data_sources = array('rx', 'tx'); | 88 | $obj->data_sources = array('rx', 'tx'); |
| 89 | $obj->ds_names = array( | 89 | $obj->ds_names = array( |
| 90 | 'inet-rx' => 'IPv4 Receive', | 90 | 'inet-rx' => 'IPv4 Receive', |
| 91 | 'inet-tx' => 'IPv4 Transmit', | 91 | 'inet-tx' => 'IPv4 Transmit', |
| 92 | 'inet6-rx' => 'IPv6 Receive', | 92 | 'inet6-rx' => 'IPv6 Receive', |
| 93 | 'inet6-tx' => 'IPv6 Transmit', | 93 | 'inet6-tx' => 'IPv6 Transmit', |
| 94 | ); | 94 | ); |
| 95 | $obj->colors = array( | 95 | $obj->colors = array( |
| 96 | 'inet-rx' => '0000ff', | 96 | 'inet-rx' => '0000ff', |
| 97 | 'inet-tx' => '00b000', | 97 | 'inet-tx' => '00b000', |
| 98 | 'inet6-rx' => 'e0e0e0', | 98 | 'inet6-rx' => 'e0e0e0', |
| 99 | 'inet6-tx' => 'ffb000', | 99 | 'inet6-tx' => 'ffb000', |
| 100 | 'other-rx' => 'ff00ff', | 100 | 'other-rx' => 'ff00ff', |
| 101 | 'other-tx' => 'a000a0', | 101 | 'other-tx' => 'a000a0', |
| 102 | 'unix-rx' => '00e000', | 102 | 'unix-rx' => '00e000', |
| 103 | 'unix-tx' => '0080ff', | 103 | 'unix-tx' => '0080ff', |
| 104 | 'unspec-rx' => 'ff0000', | 104 | 'unspec-rx' => 'ff0000', |
| 105 | 'unspec-tx' => '000080', | 105 | 'unspec-tx' => '000080', |
| 106 | ); | 106 | ); |
| 107 | $obj->rrd_title = sprintf('Traffic on Vserver %s', $obj->args['pinstance']); | 107 | $obj->rrd_title = sprintf('Traffic on Vserver %s', $obj->args['pinstance']); |
| 108 | $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize'])); | 108 | $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize'])); |
| 109 | $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; | 109 | $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; |
| 110 | $obj->width = $width; | 110 | $obj->width = $width; |
| 111 | $obj->heigth = $heigth; | 111 | $obj->heigth = $heigth; |
| 112 | $obj->rrd_format = '%5.1lf%s'; | 112 | $obj->rrd_format = '%5.1lf%s'; |
| 113 | 113 | ||
| 114 | collectd_flush($obj->identifiers); | 114 | collectd_flush($obj->identifiers); |
| 115 | $obj->rrd_graph(); | 115 | $obj->rrd_graph(); |
| 116 | break; | 116 | break; |
| 117 | case 'vs_processes': | 117 | case 'vs_processes': |
| 118 | $obj->data_sources = array('value'); | 118 | $obj->data_sources = array('value'); |
| 119 | $obj->ds_names = array( | 119 | $obj->ds_names = array( |
| 120 | 'value' => 'Processes', | 120 | 'value' => 'Processes', |
| 121 | ); | 121 | ); |
| 122 | $obj->rrd_title = sprintf('Processes on Vserver %s', $obj->args['pinstance']); | 122 | $obj->rrd_title = sprintf('Processes on Vserver %s', $obj->args['pinstance']); |
| 123 | $obj->rrd_vertical = 'Processes'; | 123 | $obj->rrd_vertical = 'Processes'; |
| 124 | 124 | ||
| 125 | $obj->width = $width; | 125 | $obj->width = $width; |
| 126 | $obj->heigth = $heigth; | 126 | $obj->heigth = $heigth; |
| 127 | $obj->rrd_format = '%5.1lf%s'; | 127 | $obj->rrd_format = '%5.1lf%s'; |
| 128 | 128 | ||
| 129 | collectd_flush($obj->identifiers); | 129 | collectd_flush($obj->identifiers); |
| 130 | $obj->rrd_graph(); | 130 | $obj->rrd_graph(); |
| 131 | break; | 131 | break; |
| 132 | 132 | ||
| 133 | default: | 133 | default: |
| 134 | die('Not implemented yet.'); | 134 | die('Not implemented yet.'); |
| 135 | break; | 135 | break; |
| 136 | } | 136 | } |
| 137 | ?> | ||
