diff options
author | Manuel CISSÉ | 2010-02-23 17:41:00 +0100 |
---|---|---|
committer | Pim van den Berg | 2010-03-01 21:03:44 +0100 |
commit | a387193f4f18d872d45db4fa7d9261f50aebbc73 (patch) | |
tree | 2e568843bbbdc40486945c5db656d546e6ab0c70 /plugin | |
parent | automatically generate colors for graphs (sensor plugin) (diff) | |
download | apt-panopticon_cgp-a387193f4f18d872d45db4fa7d9261f50aebbc73.zip apt-panopticon_cgp-a387193f4f18d872d45db4fa7d9261f50aebbc73.tar.gz apt-panopticon_cgp-a387193f4f18d872d45db4fa7d9261f50aebbc73.tar.bz2 apt-panopticon_cgp-a387193f4f18d872d45db4fa7d9261f50aebbc73.tar.xz |
add ping plugin
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/ping.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/plugin/ping.php b/plugin/ping.php new file mode 100644 index 0000000..088cf03 --- /dev/null +++ b/plugin/ping.php | |||
@@ -0,0 +1,45 @@ | |||
1 | <?php | ||
2 | |||
3 | # Collectd Ping plugin | ||
4 | |||
5 | require_once 'conf/common.inc.php'; | ||
6 | require_once 'type/Default.class.php'; | ||
7 | require_once 'inc/collectd.inc.php'; | ||
8 | |||
9 | ## LAYOUT | ||
10 | # ping/ | ||
11 | # ping/ping-<host>.rrd | ||
12 | # ping/ping_stddev-<host>.rrd | ||
13 | # ping/ping_droprate-<host>.rrd | ||
14 | |||
15 | $obj = new Type_Default($CONFIG); | ||
16 | $obj->data_sources = array('value'); | ||
17 | $obj->ds_names = array('ping' => 'Ping time', | ||
18 | 'ping_stddev' => 'Ping stddev', | ||
19 | 'ping_droprate' => 'Ping droprate'); | ||
20 | $obj->width = $width; | ||
21 | $obj->heigth = $heigth; | ||
22 | $obj->generate_colors(); | ||
23 | switch($obj->args['type']) { | ||
24 | case 'ping': | ||
25 | $obj->data_sources = array('ping'); | ||
26 | $obj->rrd_title = 'Ping latency'; | ||
27 | $obj->rrd_vertical = 'Milliseconds'; | ||
28 | $obj->rrd_format = '%5.1lf'; | ||
29 | break; | ||
30 | case 'ping_stddev': | ||
31 | $obj->rrd_title = 'Ping stddev'; | ||
32 | $obj->rrd_vertical = ''; | ||
33 | $obj->rrd_format = '%5.1lf'; | ||
34 | break; | ||
35 | case 'ping_droprate': | ||
36 | $obj->rrd_title = 'Ping droprate'; | ||
37 | $obj->rrd_vertical = ''; | ||
38 | $obj->rrd_format = '%5.1lf'; | ||
39 | break; | ||
40 | } | ||
41 | |||
42 | collectd_flush($obj->identifiers); | ||
43 | $obj->rrd_graph(); | ||
44 | |||
45 | ?> | ||