aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/rrdtool.class.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--inc/rrdtool.class.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/inc/rrdtool.class.php b/inc/rrdtool.class.php
new file mode 100644
index 0000000..e1a7b4b
--- /dev/null
+++ b/inc/rrdtool.class.php
@@ -0,0 +1,25 @@
1<?php
2
3class RRDTool {
4 var $width = 175;
5 var $height = 125;
6
7 function rrd_info($rrdfile) {
8 if (file_exists($rrdfile)) {
9 $raw_info = shell_exec('/usr/bin/rrdtool info '.$rrdfile);
10 $raw_array = explode("\n", $raw_info);
11 foreach ($raw_array as $key => $info) {
12 if ($info != "") {
13 $item_info = explode(" = ", $info);
14 $item_info[1] = preg_replace('/"/', '', $item_info[1]);
15 $info_array[$item_info[0]] = $item_info[1];
16 }
17 }
18 return($info_array);
19 } else {
20 return false;
21 }
22 }
23}
24
25?>