blob: b6723fc634aa15261d657c32e72c81ce116071d7 (
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
|
<?php
# Collectd nginx plugin
require_once 'conf/common.inc.php';
require_once 'type/Default.class.php';
require_once 'inc/collectd.inc.php';
## LAYOUT
# nginx/
# nginx/nginx_connections-active.rrd
# nginx/nginx_connections-reading.rrd
# nginx/nginx_connections-waiting.rrd
# nginx/nginx_connections-writing.rrd
# nginx/nginx_requests.rrd
$obj = new Type_Default($CONFIG);
switch($obj->args['type'])
{
case 'nginx_connections':
$obj->order = array('active', 'reading', 'waiting', 'writing');
$obj->ds_names = array(
'active' => 'Active',
'reading' => 'Reading',
'waiting' => 'Waiting',
'writing' => 'Writing',
);
$obj->colors = array(
'active' => '005d57',
'reading' => '4444ff',
'waiting' => 'f24ac8',
'writing' => '00cf00',
);
$obj->rrd_title = sprintf('nginx connections');
$obj->rrd_vertical = 'Connections/s';
break;
case 'nginx_requests':
$obj->ds_names = array(
'value' => 'Requests',
);
$obj->colors = array(
'value' => '00aa00',
);
$obj->rrd_title = sprintf('nginx requests');
$obj->rrd_vertical = 'Requests per second';
break;
}
$obj->rrd_format = '%5.1lf%s';
collectd_flush($obj->identifiers);
$obj->rrd_graph();
|