blob: 7dcbc2ad7f03228a2539a50c895497f8e122f494 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<?php
class RRDTool {
function rrd_info($rrdfile) {
if (file_exists($rrdfile)) {
$raw_info = shell_exec('/usr/bin/rrdtool info '.$rrdfile);
$raw_array = explode("\n", $raw_info);
foreach ($raw_array as $key => $info) {
if ($info != "") {
$item_info = explode(" = ", $info);
$item_info[1] = preg_replace('/"/', '', $item_info[1]);
$info_array[$item_info[0]] = $item_info[1];
}
}
return($info_array);
} else {
return false;
}
}
}
?>
|