git-svn-id: http://www.observium.org/svn/observer/trunk@118 61d68cd4-352d-0410-923a-c4978735b2b8

This commit is contained in:
Adam Amstrong
2007-11-23 11:37:28 +00:00
parent 9a6d196f32
commit 89b6a9bf1a
28 changed files with 1275 additions and 1379 deletions
+11 -9
View File
@@ -4,7 +4,10 @@ function pollDeviceIOS() {
global $device;
global $community;
global $config;
$rrdtool = &$config['rrdtool'];
$id = $device['device_id'];
$hostname = $device['hostname'];
$hardware = $device['hardware'];
$version = $device['version'];
@@ -13,12 +16,11 @@ function pollDeviceIOS() {
$os = $device['location'];
$temprrd = "rrd/" . $hostname . "-temp.rrd";
$tempgraph = "public_html/graphs/" . $hostname . "-temp.png";
$cpurrd = "rrd/" . $hostname . "-cpu.rrd";
$cpugraph = "public_html/graphs/" . $hostname . "-cpu.png";
$memrrd = "rrd/" . $hostname . "-mem.rrd";
$memgraph = "public_html/graphs/" . $hostname . "-mem.png";
list ($cpu5m, $cpu5s) = explode("\n", `snmpget -O qv -v2c -c $community $hostname 1.3.6.1.4.1.9.2.1.58.0 1.3.6.1.4.1.9.2.1.56.0`);
$cpu5m = $cpu5m + 0;
$cpu5s = $cpu5s + 0;
list ($tempin1, $tempout1) = explode("\n", `snmpget -O qv -v2c -c $community $hostname .1.3.6.1.4.1.9.9.13.1.3.1.3.1 .1.3.6.1.4.1.9.9.13.1.3.1.3.2`);
@@ -38,7 +40,7 @@ function pollDeviceIOS() {
$memusedproc = $memusedproc + 0;
$memtotal = $memfreeio + $memfreeproc + $memusedio + $memusedproc;
if (!is_file($cpurrd)) {
$rrdcreate = `rrdtool create $cpurrd --step 300 \
$rrdcreate = `$rrdtool create $cpurrd --step 300 \
DS:LOAD5S:GAUGE:600:-1:100 \
DS:LOAD5M:GAUGE:600:-1:100 \
RRA:AVERAGE:0.5:1:2000 \
@@ -51,7 +53,7 @@ function pollDeviceIOS() {
RRA:MAX:0.5:288:2000`;
}
if (!is_file($temprrd)) {
$rrdcreate = `rrdtool create $temprrd --step 300 \
$rrdcreate = `$rrdtool create $temprrd --step 300 \
DS:TEMPIN1:GAUGE:600:-25:100 \
DS:TEMPOUT1:GAUGE:600:-25:100 \
RRA:AVERAGE:0.5:1:2000 \
@@ -64,7 +66,7 @@ function pollDeviceIOS() {
RRA:MAX:0.5:288:2000`;
}
if (!is_file($memrrd)) {
$rrdcreate = `rrdtool create $memrrd --step 300 \
$rrdcreate = `$rrdtool create $memrrd --step 300 \
DS:IOFREE:GAUGE:600:0:U \
DS:IOUSED:GAUGE:600:-1:U \
DS:PROCFREE:GAUGE:600:0:U \
@@ -80,9 +82,9 @@ function pollDeviceIOS() {
RRA:MAX:0.5:288:2000`;
}
`rrdtool update $temprrd N:$tempin1:$tempout1`;
`rrdtool update $cpurrd N:$cpu5s:$cpu5m`;
`rrdtool update $memrrd N:$memfreeio:$memusedio:$memfreeproc:$memusedproc:$memtotal`;
`$rrdtool update $temprrd N:$tempin1:$tempout1`;
`$rrdtool update $cpurrd N:$cpu5s:$cpu5m`;
`$rrdtool update $memrrd N:$memfreeio:$memusedio:$memfreeproc:$memusedproc:$memtotal`;
}
?>