aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/rrdtool.class.php
blob: e1a7b4b00d8b9d0a928c7d3acdd0655ccce89ef5 (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
<?php

class RRDTool {
	var $width = 175;
	var $height = 125;

	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;
		}
	}
}

?>