diff options
Diffstat (limited to 'plugin/load.php')
-rw-r--r-- | plugin/load.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/plugin/load.php b/plugin/load.php new file mode 100644 index 0000000..d7db740 --- /dev/null +++ b/plugin/load.php | |||
@@ -0,0 +1,41 @@ | |||
1 | <?php | ||
2 | |||
3 | # Collectd Load plugin | ||
4 | |||
5 | require_once $CONFIG['webdir'].'/conf/config.php'; | ||
6 | require_once $CONFIG['webdir'].'/type/Default.class.php'; | ||
7 | |||
8 | ## LAYOUT | ||
9 | # load/load.rrd | ||
10 | |||
11 | $obj = new Type_Default; | ||
12 | $obj->datadir = $CONFIG['datadir']; | ||
13 | $obj->path_format = '{host}/{plugin}/{type}.rrd'; | ||
14 | $obj->args = array( | ||
15 | 'host' => $host, | ||
16 | 'plugin' => $plugin, | ||
17 | 'pinstance' => $pinstance, | ||
18 | 'type' => $type, | ||
19 | 'tinstance' => $tinstance, | ||
20 | ); | ||
21 | $obj->data_sources = array('shortterm', 'midterm', 'longterm'); | ||
22 | $obj->ds_names = array( | ||
23 | 'shortterm' => ' 1 min', | ||
24 | 'midterm' => ' 5 min', | ||
25 | 'longterm' => '15 min', | ||
26 | ); | ||
27 | $obj->colors = array( | ||
28 | 'shortterm' => '00ff00', | ||
29 | 'midterm' => '0000ff', | ||
30 | 'longterm' => 'ff0000', | ||
31 | ); | ||
32 | $obj->width = $width; | ||
33 | $obj->heigth = $heigth; | ||
34 | $obj->seconds = $seconds; | ||
35 | $obj->rrd_title = "System load on $host"; | ||
36 | $obj->rrd_vertical = 'System load'; | ||
37 | $obj->rrd_format = '%.2lf'; | ||
38 | |||
39 | $obj->rrd_graph(); | ||
40 | |||
41 | ?> | ||