mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
cleanups, small fixes and remove test-*php from the root
git-svn-id: http://www.observium.org/svn/observer/trunk@1998 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -188,6 +188,4 @@ function getTotal($bill_id,$datefrom,$dateto)
|
||||
return($mtot);
|
||||
}
|
||||
|
||||
$dayofmonth = date("j"); //FIXME is this used anywhere?
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -223,4 +223,5 @@ $config['astext'][65333] = "Cymru Bogon Feed";
|
||||
|
||||
### What should we warn about?
|
||||
$config['warn']['ifdown'] = false;
|
||||
?>
|
||||
|
||||
?>
|
||||
@@ -64,7 +64,7 @@
|
||||
mysql_query($sql);
|
||||
echo(".");
|
||||
} else {
|
||||
$sql = "INSERT INTO `entPhysical` ( `device_id` , `entPhysicalIndex` , `entPhysicalDescr` , `entPhysicalClass` , `entPhysicalName` , `entPhysicalModelName` , `entPhysicalSerialNum` , `entPhysicalContainedIn`, `entPhysicalMfgName`, `entPhysicalParentRelPos`, `entPhysicalVendorType`, `entPhysicalHardwareRev`,`entPhysicalFirmwareRev`,`entPhysicalSoftwareRev`,`entPhysicalIsFRU`,`entPhysicalAlias`,`entPhysicalAssetID`, `ifIndex` ) ";
|
||||
$sql = "INSERT INTO `entPhysical` (`device_id` , `entPhysicalIndex` , `entPhysicalDescr` , `entPhysicalClass` , `entPhysicalName` , `entPhysicalModelName` , `entPhysicalSerialNum` , `entPhysicalContainedIn`, `entPhysicalMfgName`, `entPhysicalParentRelPos`, `entPhysicalVendorType`, `entPhysicalHardwareRev`,`entPhysicalFirmwareRev`,`entPhysicalSoftwareRev`,`entPhysicalIsFRU`,`entPhysicalAlias`,`entPhysicalAssetID`, `ifIndex`) ";
|
||||
$sql .= "VALUES ( '" . $device['device_id'] . "', '$entPhysicalIndex', '$entPhysicalDescr', '$entPhysicalClass', '$entPhysicalName', '$entPhysicalModelName', '$entPhysicalSerialNum', '$entPhysicalContainedIn', '$entPhysicalMfgName','$entPhysicalParentRelPos' , '$entPhysicalVendorType', '$entPhysicalHardwareRev', '$entPhysicalFirmwareRev', '$entPhysicalSoftwareRev', '$entPhysicalIsFRU', '$entPhysicalAlias', '$entPhysicalAssetID', '$ifIndex')";
|
||||
mysql_query($sql);
|
||||
echo("+");
|
||||
|
||||
@@ -79,6 +79,6 @@ while ($row = mysql_fetch_array($data))
|
||||
|
||||
unset($valid_v6);
|
||||
|
||||
echo "\n";
|
||||
echo("\n");
|
||||
|
||||
?>
|
||||
@@ -21,13 +21,13 @@ foreach (explode("\n", $ports) as $entry)
|
||||
{
|
||||
$if = trim(strtolower($ifDescr));
|
||||
$nullintf = 0;
|
||||
foreach ($config['bad_if'] as $bi)
|
||||
{
|
||||
if (strstr($if, $bi))
|
||||
{
|
||||
$nullintf = 1;
|
||||
foreach ($config['bad_if'] as $bi)
|
||||
{
|
||||
if (strstr($if, $bi))
|
||||
{
|
||||
$nullintf = 1;
|
||||
if($debug) { echo("ignored : $bi : $if"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_array($config['bad_if_regexp']))
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ if ($device['os_group'] == "unix")
|
||||
# FIXME snmp_walk
|
||||
# ObserverNMS-style temperature
|
||||
$cmd = $config['snmpwalk'] . " -M " . $config['mibdir'] . " -M " . $config['mibdir'] . " -".$device['snmpver']." -m SNMPv2-SMI -Osqn -CI -c ".$device['community']." ".$device['transport'].":".$device['hostname'].":".$device['port']." .1.3.6.1.4.1.2021.7891 | sed s/.1.3.6.1.4.1.2021.7891.// | grep '.1.1 ' | grep -v '.101.' | cut -d'.' -f 1";
|
||||
if ($debug) { echo "$cmd\n"; }
|
||||
if ($debug) { echo("$cmd\n"); }
|
||||
$oids = shell_exec($cmd);
|
||||
$oids = trim($oids);
|
||||
if ($oids) echo("Observer-Style ");
|
||||
|
||||
@@ -73,7 +73,7 @@ if ($device['os'] == "vmware")
|
||||
mysql_query("INSERT INTO vmware_vminfo (device_id, vmwVmVMID, vmwVmDisplayName, vmwVmGuestOS, vmwVmMemSize, vmwVmCpus, vmwVmState) VALUES (" . $device["device_id"] . ", " . $oid . ", '" . mres($vmwVmDisplayName) . "', '" . mres($vmwVmGuestOS) . "', " . $vmwVmMemSize . ", " . $vmwVmCpus . ", '" . mres($vmwVmState) . "')");
|
||||
echo("+");
|
||||
} else {
|
||||
echo ".";
|
||||
echo(".");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -30,7 +30,7 @@ while ($dbcurrent = mysql_fetch_array($current_data))
|
||||
# FIXME also warn when crossing WARN level!!
|
||||
if ($dbcurrent['sensor_current'] > $dbcurrent['sensor_limit_low'] && $current <= $dbcurrent['sensor_limit_low'])
|
||||
{
|
||||
$msg = "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . " is " . $current . "A (Limit " . $dbcurrent['sensor_limit'];
|
||||
$msg = "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . " is under threshold: " . $current . "A (< " . $dbcurrent['sensor_limit'];
|
||||
$msg .= "A) at " . date($config['timestamp_format']);
|
||||
notify($device, "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'], $msg);
|
||||
echo("Alerting for " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . "\n");
|
||||
@@ -38,7 +38,7 @@ while ($dbcurrent = mysql_fetch_array($current_data))
|
||||
}
|
||||
else if ($dbcurrent['sensor_current'] < $dbcurrent['sensor_limit'] && $current >= $dbcurrent['sensor_limit'])
|
||||
{
|
||||
$msg = "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . " is " . $current . "A (Limit " . $dbcurrent['sensor_limit'];
|
||||
$msg = "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . " is over threshold: " . $current . "A (> " . $dbcurrent['sensor_limit'];
|
||||
$msg .= "A) at " . date($config['timestamp_format']);
|
||||
notify($device, "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'], $msg);
|
||||
echo("Alerting for " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . "\n");
|
||||
|
||||
@@ -953,7 +953,7 @@ function array_preg_replace($array, $string)
|
||||
function rewrite_adslLineType($adslLineType)
|
||||
{
|
||||
$adslLineTypes = array ('noChannel' => 'No Channel',
|
||||
'fastOnly' => 'Fastpath',
|
||||
'fastOnly' => 'Fastpath',
|
||||
'interleavedOnly' => 'Interleaved',
|
||||
'fastOrInterleaved' => 'Fast/Interleaved',
|
||||
'fastAndInterleaved' => 'Fast+Interleaved');
|
||||
@@ -969,4 +969,4 @@ function rewrite_adslLineType($adslLineType)
|
||||
return($adslLineType);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -7,14 +7,13 @@ function rrdtool_update($rrdfile, $rrdupdate)
|
||||
|
||||
function rrdtool_create($rrdfile, $rrdupdate)
|
||||
{
|
||||
global $config; global $debug;
|
||||
global $config, $debug;
|
||||
|
||||
$command = $config['rrdtool'] . " create $rrdfile $rrdupdate";
|
||||
|
||||
if ($debug) { echo($command."\n"); }
|
||||
|
||||
return shell_exec($command);
|
||||
|
||||
}
|
||||
|
||||
function rrdtool_fetch($rrdfile, $rrdupdate)
|
||||
@@ -39,7 +38,7 @@ function rrdtool_lastupdate($rrdfile, $rrdupdate)
|
||||
|
||||
function rrdtool($command, $file, $options)
|
||||
{
|
||||
global $config; global $debug;
|
||||
global $config, $debug;
|
||||
|
||||
$command = $config['rrdtool'] . " $command $file $options";
|
||||
if ($config['rrdcached'])
|
||||
@@ -48,7 +47,8 @@ function rrdtool($command, $file, $options)
|
||||
}
|
||||
|
||||
if ($debug) { echo($command."\n"); }
|
||||
|
||||
return shell_exec($command);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -105,11 +105,10 @@ function snmp_get($device, $oid, $options = NULL, $mib = NULL, $mibdir = NULL)
|
||||
$device['transport'] = "udp";
|
||||
}
|
||||
|
||||
|
||||
if (strstr($oid,' '))
|
||||
{
|
||||
echo "BUG: snmp_get called for multiple OIDs: $oid\n";
|
||||
echo "Please report this to the Observium team.";
|
||||
echo("BUG: snmp_get called for multiple OIDs: $oid\n");
|
||||
echo("Please report this to the Observium team.");
|
||||
}
|
||||
|
||||
if ($config['snmp']['internal'] == true)
|
||||
|
||||
Reference in New Issue
Block a user