mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
fix status setting for down also add new storage image :>
git-svn-id: http://www.observium.org/svn/observer/trunk@1010 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 644 B |
@@ -18,6 +18,7 @@ if(is_array($storage_array)) {
|
|||||||
if (isset($config['ignore_mount_removable']) && $config['ignore_mount_removable'] && $fstype == "hrStorageRemovableDisk") { $deny = 1; if ($debug) echo("skip(removable)\n"); }
|
if (isset($config['ignore_mount_removable']) && $config['ignore_mount_removable'] && $fstype == "hrStorageRemovableDisk") { $deny = 1; if ($debug) echo("skip(removable)\n"); }
|
||||||
if (isset($config['ignore_mount_network']) && $config['ignore_mount_network'] && $fstype == "hrStorageNetworkDisk") { $deny = 1; if ($debug) echo("skip(network)\n"); }
|
if (isset($config['ignore_mount_network']) && $config['ignore_mount_network'] && $fstype == "hrStorageNetworkDisk") { $deny = 1; if ($debug) echo("skip(network)\n"); }
|
||||||
if (isset($config['ignore_mount_optical']) && $config['ignore_mount_optical'] && $fstype == "hrStorageCompactDisc") { $deny = 1; if ($debug) echo("skip(cd)\n"); }
|
if (isset($config['ignore_mount_optical']) && $config['ignore_mount_optical'] && $fstype == "hrStorageCompactDisc") { $deny = 1; if ($debug) echo("skip(cd)\n"); }
|
||||||
|
if ($fstype == "hrStorageVirtualMemory" || $fstype == "hrStorageRam" || $fstype == "hrStorageOther") { $deny = 1; }
|
||||||
|
|
||||||
if(!$deny && is_numeric($index)) {
|
if(!$deny && is_numeric($index)) {
|
||||||
discover_storage($valid_storage, $device, $index, $fstype, "hrstorage", $descr, $size , $units, $used);
|
discover_storage($valid_storage, $device, $index, $fstype, "hrstorage", $descr, $size , $units, $used);
|
||||||
|
|||||||
+10
-10
@@ -71,7 +71,16 @@ while ($device = mysql_fetch_array($device_query)) {
|
|||||||
$status = "0";
|
$status = "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($status) {
|
if ( $device['status'] != $status )
|
||||||
|
{
|
||||||
|
$poll_update .= $poll_separator . "`status` = '$status'";
|
||||||
|
$poll_separator = ", ";
|
||||||
|
mysql_query("UPDATE `devices` SET `status` = '".$status."' WHERE `device_id` = '".$device['device_id']."'");
|
||||||
|
mysql_query("INSERT INTO alerts (importance, device_id, message) VALUES ('0', '" . $device['device_id'] . "', 'Device is " .($status == '1' ? 'up' : 'down') . "')");
|
||||||
|
eventlog('Device status changed to ' . ($status == '1' ? 'Up' : 'Down'), $device['device_id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($status == "1") {
|
||||||
$snmp_cmd = $config['snmpget'] . " -m SNMPv2-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
|
$snmp_cmd = $config['snmpget'] . " -m SNMPv2-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
|
||||||
$snmp_cmd .= " sysUpTime.0 sysLocation.0 sysContact.0 sysName.0 HOST-RESOURCES-MIB::hrSystemUptime.0";
|
$snmp_cmd .= " sysUpTime.0 sysLocation.0 sysContact.0 sysName.0 HOST-RESOURCES-MIB::hrSystemUptime.0";
|
||||||
$snmpdata = shell_exec($snmp_cmd);
|
$snmpdata = shell_exec($snmp_cmd);
|
||||||
@@ -132,15 +141,6 @@ while ($device = mysql_fetch_array($device_query)) {
|
|||||||
$poll_separator = ", ";
|
$poll_separator = ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $device['status'] != $status )
|
|
||||||
{
|
|
||||||
$poll_update .= $poll_separator . "`status` = '$status'";
|
|
||||||
$poll_separator = ", ";
|
|
||||||
mysql_query("UPDATE `devices` SET `status` = '".$status."' WHERE `device_id` = '".$device['device_id']."'");
|
|
||||||
mysql_query("INSERT INTO alerts (importance, device_id, message) VALUES ('0', '" . $device['device_id'] . "', 'Device is " . ($status == '1' ? 'up' : 'down') . "')");
|
|
||||||
eventlog('Device status changed to ' . ($status == '1' ? 'Up' : 'Down'), $device['device_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_file($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php")) {
|
if (is_file($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php")) {
|
||||||
/// OS Specific
|
/// OS Specific
|
||||||
include($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php");
|
include($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php");
|
||||||
|
|||||||
Reference in New Issue
Block a user