mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
small fixes and updates
git-svn-id: http://www.observium.org/svn/observer/trunk@541 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -52,6 +52,9 @@ while ($device = mysql_fetch_array($device_query)) {
|
||||
if($os_groups[$device[os]]) {$device['os_group'] = $os_groups[$device[os]]; echo "(".$device['os_group'].")";}
|
||||
echo("\n");
|
||||
|
||||
## Discover OS Changes
|
||||
include("includes/discovery/os.inc.php");
|
||||
|
||||
## Discover Interfaces
|
||||
include("includes/discovery/interfaces.php");
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
echo("AS$bgpLocalAs ");
|
||||
|
||||
if($bgpLocalAs != $device['bgpLocalAs']) { mysql_query("UPDATE devices SET bgpLocalAs = '$bgpLocalAs' WHERE device_id = '".$device['device_id']."'"); echo("Updated AS\n"); }
|
||||
if($bgpLocalAs != $device['bgpLocalAs']) { mysql_query("UPDATE devices SET bgpLocalAs = '$bgpLocalAs' WHERE device_id = '".$device['device_id']."'"); echo("Updated AS "); }
|
||||
|
||||
$peers_cmd = $config['snmpwalk'] . " -m BGP4-MIB -CI -Oq -" . $device['snmpver'] . " -c" . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
|
||||
$peers_cmd .= "BGP4-MIB::bgpPeerRemoteAs";
|
||||
@@ -67,7 +67,7 @@
|
||||
} else {
|
||||
echo("No BGP on host");
|
||||
if($device['bgpLocalAs']) {
|
||||
mysql_query("UPDATE devices SET bgpLocalAs = NULL WHERE device_id = '".$device['device_id']."'"); echo(" (Removed ASN)\n");
|
||||
mysql_query("UPDATE devices SET bgpLocalAs = NULL WHERE device_id = '".$device['device_id']."'"); echo(" (Removed ASN) ");
|
||||
} # End if
|
||||
} # End if
|
||||
|
||||
|
||||
12
includes/discovery/os.inc.php
Normal file
12
includes/discovery/os.inc.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
$os = getHostOS($device);
|
||||
|
||||
if($os != $device['os']) {
|
||||
$sql = mysql_query("UPDATE `devices` SET `os` = '$os' WHERE `device_id` = '".$device['device_id']."'");
|
||||
echo("Changed OS! : $os\n");
|
||||
$eventlog = mysql_query("INSERT INTO eventlog (host, interface, datetime, message) VALUES ('" . $device['device_id'] . "', NULL, NOW(), 'Device OS changed ".$device['os']." => $os')");
|
||||
$device['os'] = $os;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -17,7 +17,7 @@
|
||||
list($units) = explode(" ", $units);
|
||||
$allow = 1;
|
||||
foreach($config['ignore_mount'] as $bi) { if($bi == $descr) { $allow = 0; } }
|
||||
foreach($config['ignore_mount_string'] as $bi) { if(strpos($descr, $bi) !== FALSE) { $allow = 0; } else { echo("$descr -> $bi \n"); } }
|
||||
foreach($config['ignore_mount_string'] as $bi) { if(strpos($descr, $bi) !== FALSE) { $allow = 0; } }
|
||||
foreach($config['ignore_mount_regexp'] as $bi) { if(preg_match($bi, $descr)) { $allow = 0; } }
|
||||
$descr = str_replace("mounted on: ", "", $descr);
|
||||
$descr = str_replace(": var file system", "", $descr);
|
||||
|
||||
Reference in New Issue
Block a user