mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
per-port SNMP polling. thanks to jonathan@studenteninternet.be
git-svn-id: http://www.observium.org/svn/observer/trunk@340 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
$community = $device['community'];
|
||||
$id = $device['device_id'];
|
||||
$hostname = $device['hostname'];
|
||||
$port = $device['port'];
|
||||
|
||||
$Otemprrd = "rrd/" . $hostname . "-temp.rrd";
|
||||
$Ocpurrd = "rrd/" . $hostname . "-cpu.rrd";
|
||||
@@ -48,15 +49,15 @@
|
||||
}
|
||||
|
||||
|
||||
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`);
|
||||
list ($cpu5m, $cpu5s) = explode("\n", `snmpget -O qv -v2c -c $community $hostname:$port 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`);
|
||||
list ($tempin1, $tempout1) = explode("\n", `snmpget -O qv -v2c -c $community $hostname:$port .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`);
|
||||
$tempin1 = $tempin1 +0;
|
||||
$tempout1 = $tempout1 + 0;
|
||||
$mem_get = ".1.3.6.1.4.1.9.9.48.1.1.1.6.2 .1.3.6.1.4.1.9.9.48.1.1.1.6.1 .1.3.6.1.4.1.9.9.48.1.1.1.6.3";
|
||||
$mem_get .= ".1.3.6.1.4.1.9.9.48.1.1.1.5.2 .1.3.6.1.4.1.9.9.48.1.1.1.5.1 .1.3.6.1.4.1.9.9.48.1.1.1.5.3";
|
||||
$mem_raw = `snmpget -O qv -v2c -c $community $hostname $mem_get`;
|
||||
$mem_raw = `snmpget -O qv -v2c -c $community $hostname:$port $mem_get`;
|
||||
$mem_raw = str_replace("No Such Instance currently exists at this OID", "0", $mem_raw);
|
||||
list ($memfreeio, $memfreeproc, $memfreeprocb, $memusedio, $memusedproc, $memusedprocb) = explode("\n", $mem_raw);
|
||||
echo("$hostname\n");
|
||||
|
||||
Reference in New Issue
Block a user