diff options
-rw-r--r-- | plugin/apache.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/plugin/apache.php b/plugin/apache.php new file mode 100644 index 0000000..1dc3540 --- /dev/null +++ b/plugin/apache.php | |||
@@ -0,0 +1,51 @@ | |||
1 | <?php | ||
2 | |||
3 | # Collectd Apache plugin | ||
4 | |||
5 | require_once 'conf/common.inc.php'; | ||
6 | require_once 'type/GenericStacked.class.php'; | ||
7 | require_once 'inc/collectd.inc.php'; | ||
8 | |||
9 | ## LAYOUT | ||
10 | # apache-X/apache_scoreboard-X.rrd | ||
11 | |||
12 | $obj = new Type_GenericStacked($CONFIG); | ||
13 | $obj->data_sources = array('count'); | ||
14 | $obj->order = array('open', 'idle_cleanup', 'finishing', 'logging', 'closing', 'dnslookup', 'keepalive', 'sending', 'reading', 'starting', 'waiting'); | ||
15 | $obj->ds_names = array( | ||
16 | 'open' => 'Open (empty) ', | ||
17 | 'waiting' => 'Waiting ', | ||
18 | 'starting' => 'Starting up ', | ||
19 | 'reading' => 'Reading request', | ||
20 | 'sending' => 'Sending reply ', | ||
21 | 'keepalive' => 'Keepalive ', | ||
22 | 'dnslookup' => 'DNS Lookup ', | ||
23 | 'closing' => 'Closing ', | ||
24 | 'logging' => 'Logging ', | ||
25 | 'finishing' => 'Finishing ', | ||
26 | 'idle_cleanup' => 'Idle cleanup ', | ||
27 | ); | ||
28 | $obj->colors = array( | ||
29 | 'open' => 'e0e0e0', | ||
30 | 'waiting' => 'ffb000', | ||
31 | 'starting' => 'ff00ff', | ||
32 | 'reading' => '0000ff', | ||
33 | 'sending' => '00e000', | ||
34 | 'keepalive' => '0080ff', | ||
35 | 'dnslookup' => 'ff0000', | ||
36 | 'closing' => '000080', | ||
37 | 'logging' => 'a000a0', | ||
38 | 'finishing' => '008080', | ||
39 | 'idle_cleanup' => 'ffff00', | ||
40 | ); | ||
41 | $obj->width = $width; | ||
42 | $obj->heigth = $heigth; | ||
43 | |||
44 | $obj->rrd_title = sprintf('Scoreboard of %s', $obj->args['pinstance']); | ||
45 | $obj->rrd_vertical = 'Slots'; | ||
46 | $obj->rrd_format = '%5.1lf'; | ||
47 | |||
48 | collectd_flush($obj->identifiers); | ||
49 | $obj->rrd_graph(); | ||
50 | |||
51 | ?> | ||