aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/processes.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/processes.php')
-rw-r--r--plugin/processes.php183
1 files changed, 0 insertions, 183 deletions
diff --git a/plugin/processes.php b/plugin/processes.php
deleted file mode 100644
index 27819cc..0000000
--- a/plugin/processes.php
+++ /dev/null
@@ -1,183 +0,0 @@
1<?php
2
3# Collectd CPU plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/GenericStacked.class.php';
7
8## LAYOUT
9# processes/
10# processes/ps_state-paging.rrd
11# processes/ps_state-blocked.rrd
12# processes/ps_state-zombies.rrd
13# processes/ps_state-stopped.rrd
14# processes/ps_state-running.rrd
15# processes/ps_state-sleeping.rrd
16
17$obj = new Type_GenericStacked($CONFIG, $_GET);
18$obj->rrd_format = '%5.1lf%s';
19
20switch($obj->args['type'])
21{
22 case 'ps_state':
23 $obj->legend = array(
24 'paging' => 'Paging',
25 'blocked' => 'Blocked',
26 'zombies' => 'Zombies',
27 'stopped' => 'Stopped',
28 'running' => 'Running',
29 'sleeping' => 'Sleeping',
30 );
31 $obj->colors = array(
32 'paging' => 'ffb000',
33 'blocked' => 'ff00ff',
34 'zombies' => 'ff0000',
35 'stopped' => 'a000a0',
36 'running' => '00e000',
37 'sleeping' => '0000ff',
38 'value' => 'f0a000',
39 );
40 $obj->rrd_title = 'Processes';
41 $obj->rrd_vertical = 'Processes';
42 break;
43
44 case 'fork_rate':
45 $obj->legend = array(
46 'value' => 'Forks',
47 );
48 $obj->colors = array(
49 'value' => 'f0a000',
50 );
51 $obj->rrd_title = 'Fork rate';
52 $obj->rrd_vertical = 'forks/s';
53 break;
54
55 case 'ps_code':
56 $obj->legend = array(
57 'value' => 'TRS',
58 );
59 $obj->colors = array(
60 'value' => '0000ff',
61 );
62 $obj->rrd_title = sprintf('Text Resident Set (%s)', $obj->args['pinstance']);
63 $obj->rrd_vertical = 'Bytes';
64 break;
65
66 case 'ps_count':
67 $obj->data_sources = array('processes', 'threads');
68 $obj->legend = array(
69 'processes' => 'Processes',
70 'threads' => 'Threads',
71 );
72 $obj->colors = array(
73 'processes' => '0000ff',
74 'threads' => 'ff0000',
75 );
76 $obj->rrd_title = sprintf('Number of Processes/Threads (%s)', $obj->args['pinstance']);
77 $obj->rrd_vertical = 'Amount';
78 break;
79
80 case 'ps_cputime':
81 $obj->data_sources = array('user', 'syst');
82 $obj->legend = array(
83 'user' => 'User',
84 'syst' => 'System',
85 );
86 $obj->colors = array(
87 'user' => '0000ff',
88 'syst' => 'ff0000',
89 );
90 $obj->rrd_title = sprintf('CPU time (%s)', $obj->args['pinstance']);
91 $obj->rrd_vertical = 'CPU time [s]';
92 break;
93
94 case 'ps_disk_octets':
95 $obj->data_sources = array('read', 'write');
96 $obj->legend = array(
97 'read' => 'Read',
98 'write' => 'Write',
99 );
100 $obj->colors = array(
101 'read' => '0000ff',
102 'write' => '00b000',
103 );
104 $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['pinstance']);
105 $obj->rrd_vertical = 'Bytes per second';
106 break;
107
108 case 'ps_disk_ops':
109 $obj->data_sources = array('read', 'write');
110 $obj->legend = array(
111 'read' => 'Read',
112 'write' => 'Write',
113 );
114 $obj->colors = array(
115 'read' => '0000ff',
116 'write' => '00b000',
117 );
118 $obj->rrd_title = sprintf('Disk Operations (%s)', $obj->args['pinstance']);
119 $obj->rrd_vertical = 'Ops per second';
120 break;
121
122 case 'ps_data':
123 $obj->legend = array(
124 'value' => 'DRS',
125 );
126 $obj->colors = array(
127 'value' => '0000ff',
128 );
129 $obj->rrd_title = sprintf('Data Resident Set (%s)', $obj->args['pinstance']);
130 $obj->rrd_vertical = 'Bytes';
131 break;
132
133 case 'ps_pagefaults':
134 $obj->data_sources = array('minflt', 'majflt');
135 $obj->legend = array(
136 'minflt' => 'Minor',
137 'majflt' => 'Major',
138 );
139 $obj->colors = array(
140 'minflt' => 'ff0000',
141 'majflt' => '0000ff',
142 );
143 $obj->rrd_title = sprintf('PageFaults (%s)', $obj->args['pinstance']);
144 $obj->rrd_vertical = 'Pagefaults';
145 break;
146
147 case 'ps_rss':
148 $obj->legend = array(
149 'value' => 'RSS',
150 );
151 $obj->colors = array(
152 'value' => '0000ff',
153 );
154 $obj->rrd_title = sprintf('Resident Segment Size (%s)', $obj->args['pinstance']);
155 $obj->rrd_vertical = 'Bytes';
156 break;
157
158 case 'ps_stacksize':
159 $obj->legend = array(
160 'value' => 'Stacksize',
161 );
162 $obj->colors = array(
163 'value' => '0000ff',
164 );
165 $obj->rrd_title = sprintf('Stacksize (%s)', $obj->args['pinstance']);
166 $obj->rrd_vertical = 'Bytes';
167 break;
168
169 case 'ps_vm':
170 $obj->legend = array(
171 'value' => 'Memory',
172 );
173 $obj->colors = array(
174 'value' => '0000ff',
175 );
176 $obj->rrd_title = sprintf('Virtual Memory (%s)', $obj->args['pinstance']);
177 $obj->rrd_vertical = 'Bytes';
178 break;
179
180}
181
182
183$obj->rrd_graph();