mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
fix junos temperatures + add papouch tme
git-svn-id: http://www.observium.org/svn/observer/trunk@685 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
echo("Temperatures : ");
|
||||
|
||||
## JunOS Temperatures
|
||||
if($device['os'] == "JunOS") {
|
||||
if($device['os'] == "junos") {
|
||||
echo("JunOS ");
|
||||
$oids = shell_exec($config['snmpwalk'] . " -m JUNIPER-MIB -$snmpver -CI -Osqn -c $community $hostname:$port 1.3.6.1.4.1.2636.3.1.13.1.7");
|
||||
$oids = trim($oids);
|
||||
@@ -22,7 +22,6 @@
|
||||
$descr = trim(shell_exec($config['snmpget'] . " -m JUNIPER-MIB -O qv -$snmpver -c $community $hostname:$port $descr_oid"));
|
||||
$temp = trim(shell_exec($config['snmpget'] . " -m JUNIPER-MIB -O qv -$snmpver -c $community $hostname:$port $temp_oid"));
|
||||
if(!strstr($descr, "No") && !strstr($temp, "No") && $descr != "" && $temp != "0") {
|
||||
$descr = shell_exec($config['snmpget'] . " -m JUNIPER-MIB -O qv -$snmpver -c $community $hostname:$port $descr_oid");
|
||||
$descr = str_replace("\"", "", $descr);
|
||||
$descr = str_replace("temperature", "", $descr);
|
||||
$descr = str_replace("temp", "", $descr);
|
||||
@@ -38,6 +37,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
## Papouch TME Temperatures
|
||||
if($device['os'] == "papouch-tme") {
|
||||
echo("Papouch TME ");
|
||||
$descr = trim(shell_exec($config['snmpget'] . " -m TMESNMP2-MIB -O qv -$snmpver -c $community $hostname:$port SNMPv2-SMI::enterprises.18248.1.1.3.0"));
|
||||
$temp = trim(shell_exec($config['snmpget'] . " -m TMESNMP2-MIB -O qv -$snmpver -c $community $hostname:$port SNMPv2-SMI::enterprises.18248.1.1.2.0"));
|
||||
if(!strstr($descr, "No") && !strstr($temp, "No") && $descr != "" && $temp != "0")
|
||||
{
|
||||
$descr = trim(str_replace("\"", "", $descr));
|
||||
if(mysql_result(mysql_query("SELECT count(temp_id) FROM `temperature` WHERE temp_oid = '$temp_oid' AND temp_host = '$id'"),0) == '0')
|
||||
{
|
||||
$query = "INSERT INTO temperature (`temp_host`, `temp_oid`, `temp_descr`) values ('$id', '$temp_oid', '$descr')";
|
||||
mysql_query($query);
|
||||
echo("+");
|
||||
} else { echo("."); }
|
||||
$temp_exists[] = "$id $temp_oid";
|
||||
}
|
||||
}
|
||||
|
||||
## Begin Observer-Style
|
||||
if($device['os'] == "Linux") {
|
||||
echo("Observer-Style ");
|
||||
|
||||
Reference in New Issue
Block a user