mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add a tiny bit of debugging :>
git-svn-id: http://www.observium.org/svn/observer/trunk@1045 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -285,35 +285,25 @@ if ($device['os'] == "ios")
|
||||
$data = trim($data);
|
||||
if ($data)
|
||||
{
|
||||
list($oid) = explode(" ", $data);
|
||||
$temp_oid = ".1.3.6.1.4.1.9.9.13.1.3.1.3.$oid";
|
||||
$descr_oid = ".1.3.6.1.4.1.9.9.13.1.3.1.2.$oid";
|
||||
$descr = trim(shell_exec($config['snmpget'] . " -m CISCO-ENVMON-MIB -O qv -$snmpver -c $community $hostname:$port $descr_oid"));
|
||||
$temp = trim(shell_exec($config['snmpget'] . " -m CISCO-ENVMON-MIB -O qv -$snmpver -c $community $hostname:$port $temp_oid"));
|
||||
list($index) = explode(" ", $data);
|
||||
$oid = ".1.3.6.1.4.1.9.9.13.1.3.1.3.$index";
|
||||
$descr_oid = ".1.3.6.1.4.1.9.9.13.1.3.1.2.$index";
|
||||
$descr = snmp_get($device, $descr_oid, "-Oqv", "CISCO-ENVMON-MIB");
|
||||
$temp = snmp_get($device, $oid, "-Oqv", "CISCO-ENVMON-MIB");
|
||||
if (!strstr($descr, "No") && !strstr($temp, "No") && $descr != "" )
|
||||
{
|
||||
$descr = str_replace("\"", "", $descr);
|
||||
$descr = str_replace("temperature", "", $descr);
|
||||
$descr = str_replace("temp", "", $descr);
|
||||
$descr = trim($descr);
|
||||
if (mysql_result(mysql_query("SELECT count(temp_id) FROM `temperature` WHERE temp_oid = '$temp_oid' AND device_id = '$id'"),0) == '0')
|
||||
{
|
||||
$query = "INSERT INTO temperature (`device_id`, `temp_oid`, `temp_descr`, `temp_limit`, `temp_current`) values ('$id', '$temp_oid', '$descr', " . ($config['defaults']['temp_limit'] ? $config['defaults']['temp_limit'] : '60') . ", '$temp')";
|
||||
mysql_query($query);
|
||||
echo("+");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo(".");
|
||||
}
|
||||
$temp_exists[] = "$id $temp_oid";
|
||||
|
||||
discover_temperature($valid_temp, $device, $oid, $index, "cisco", $descr, "1", NULL, NULL, $temp);
|
||||
$temp_exists[] = $device['device_id'] . " $oid";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Delete removed sensors
|
||||
|
||||
$sql = "SELECT * FROM temperature AS T, devices AS D WHERE T.device_id = D.device_id AND D.device_id = '".$device['device_id']."'";
|
||||
|
||||
if ($query = mysql_query($sql))
|
||||
|
||||
@@ -97,8 +97,7 @@ if ($device['os'] == "junos")
|
||||
|
||||
$peerrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("bgp-" . $peer['bgpPeerIdentifier'] . ".rrd");
|
||||
if(!is_file($peerrrd)) {
|
||||
$woo = shell_exec($config['rrdtool'] . " create $peerrrd \
|
||||
DS:bgpPeerOutUpdates:COUNTER:600:U:100000000000 \
|
||||
$create_rrd = "DS:bgpPeerOutUpdates:COUNTER:600:U:100000000000 \
|
||||
DS:bgpPeerInUpdates:COUNTER:600:U:100000000000 \
|
||||
DS:bgpPeerOutTotal:COUNTER:600:U:100000000000 \
|
||||
DS:bgpPeerInTotal:COUNTER:600:U:100000000000 \
|
||||
@@ -110,7 +109,9 @@ if ($device['os'] == "junos")
|
||||
RRA:MAX:0.5:1:600 \
|
||||
RRA:MAX:0.5:6:700 \
|
||||
RRA:MAX:0.5:24:775 \
|
||||
RRA:MAX:0.5:288:797");
|
||||
RRA:MAX:0.5:288:797";
|
||||
|
||||
rrdtool_create($peerrrd, $create_rrd);
|
||||
|
||||
}
|
||||
rrdtool_update("$peerrrd", "N:$bgpPeerOutUpdates:$bgpPeerInUpdates:$bgpPeerOutTotalMessages:$bgpPeerInTotalMesages:$bgpPeerFsmEstablishedTime");
|
||||
@@ -159,8 +160,7 @@ if ($device['os'] == "junos")
|
||||
|
||||
$cbgp_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("cbgp-" . $peer['bgpPeerIdentifier'] . ".$afi.$safi.rrd");
|
||||
if(!is_file($cbgp_rrd)) {
|
||||
$woo = shell_exec($config['rrdtool'] . " create $cbgp_rrd \
|
||||
DS:AcceptedPrefixes:GAUGE:600:U:100000000000 \
|
||||
$rrd_create = "DS:AcceptedPrefixes:GAUGE:600:U:100000000000 \
|
||||
DS:DeniedPrefixes:GAUGE:600:U:100000000000 \
|
||||
DS:AdvertisedPrefixes:GAUGE:600:U:100000000000 \
|
||||
DS:SuppressedPrefixes:GAUGE:600:U:100000000000 \
|
||||
@@ -172,7 +172,8 @@ if ($device['os'] == "junos")
|
||||
RRA:MAX:0.5:1:600 \
|
||||
RRA:MAX:0.5:6:700 \
|
||||
RRA:MAX:0.5:24:775 \
|
||||
RRA:MAX:0.5:288:797");
|
||||
RRA:MAX:0.5:288:797";
|
||||
rrdtool_create($cbgp_rrd, $rrd_create);
|
||||
}
|
||||
rrdtool_update("$cbgp_rrd", "N:$cbgpPeerAcceptedPrefixes:$cbgpPeerDeniedPrefixes:$cbgpPeerAdvertisedPrefixes:$cbgpPeerSuppressedPrefixes:$cbgpPeerWithdrawnPrefixes");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user