mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
updates et al
git-svn-id: http://www.observium.org/svn/observer/trunk@503 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
unset( $storage_exists );
|
||||
|
||||
echo("Storage : ");
|
||||
echo("hrStorage : ");
|
||||
|
||||
$oids = shell_exec($config['snmpwalk'] . " -m HOST-RESOURCES-MIB -Osq -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " hrStorageIndex");
|
||||
$oids = trim(str_replace("hrStorageIndex.","",$oids));
|
||||
@@ -17,14 +17,11 @@
|
||||
|
||||
$allow = 1;
|
||||
foreach($config['ignore_mount'] as $bi) {
|
||||
# echo("$descr == $bi\n");
|
||||
if($descr == $bi) {
|
||||
$allow = 0;
|
||||
}
|
||||
}
|
||||
|
||||
# echo("$fstype\n");
|
||||
|
||||
if(strstr($fstype, "FixedDisk") && $size > '0' && $allow) {
|
||||
if(mysql_result(mysql_query("SELECT count(storage_id) FROM `storage` WHERE hrStorageIndex = '$hrStorageIndex' AND host_id = '".$device['device_id']."'"),0) == '0') {
|
||||
$query = "INSERT INTO storage (`host_id`, `hrStorageIndex`, `hrStorageDescr`,`hrStorageSize`,`hrStorageAllocationUnits`) ";
|
||||
@@ -49,22 +46,17 @@ $sql = "SELECT * FROM storage AS S, devices AS D where S.host_id = D.device_id A
|
||||
$query = mysql_query($sql);
|
||||
|
||||
while ($store = mysql_fetch_array($query)) {
|
||||
|
||||
unset($exists);
|
||||
|
||||
$i = 0;
|
||||
while ($i < count($storage_exists) && !$exists) {
|
||||
$thisstore = $store['host_id'] . " " . $store['hrStorageIndex'];
|
||||
if ($storage_exists[$i] == $thisstore) { $exists = 1; }
|
||||
$i++;
|
||||
}
|
||||
|
||||
if(!$exists) {
|
||||
echo("-");
|
||||
mysql_query("DELETE FROM storage WHERE storage_id = '" . $store['storage_id'] . "'");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
echo("\n");
|
||||
|
||||
Reference in New Issue
Block a user