mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 16:08:55 +02:00
remove dead map.php code, rename some .inc to .inc.php files, general trailing space cleanup part 1, some reindent. No expected functionality change whatsoever ;)
git-svn-id: http://www.observium.org/svn/observer/trunk@1824 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -15,10 +15,10 @@ while ($device = mysql_fetch_array($device_query)) {
|
||||
if( isPingable($device['hostname']) ) {
|
||||
$pos = snmp_get($device, "sysDescr.0", "-Oqv", "SNMPv2-MIB");
|
||||
echo($device['protocol'].":".$device['hostname'].":".$device['port']." - ".$device['community']." ".$device['snmpver'].": ");
|
||||
if($pos == '') {
|
||||
if($pos == '') {
|
||||
$status='0';
|
||||
} else {
|
||||
$status='1';
|
||||
} else {
|
||||
$status='1';
|
||||
}
|
||||
} else {
|
||||
$status='0';
|
||||
@@ -34,15 +34,15 @@ while ($device = mysql_fetch_array($device_query)) {
|
||||
if($status != $device['status']) {
|
||||
|
||||
mysql_query("UPDATE `devices` SET `status`= '$status' WHERE `device_id` = '" . $device['device_id'] . "'");
|
||||
if ($status == '1') {
|
||||
$stat = "Up";
|
||||
if ($status == '1') {
|
||||
$stat = "Up";
|
||||
mysql_query("INSERT INTO alerts (importance, device_id, message) VALUES ('0', '" . $device['device_id'] . "', 'Device is up\n')");
|
||||
if($config['alerts']['email']['enable'])
|
||||
{
|
||||
notify($device, "Device Up: " . $device['hostname'], "Device Up: " . $device['hostname'] . " at " . date($config['timestamp_format']));
|
||||
}
|
||||
} else {
|
||||
$stat = "Down";
|
||||
$stat = "Down";
|
||||
mysql_query("INSERT INTO alerts (importance, device_id, message) VALUES ('9', '" . $device['device_id'] . "', 'Device is down\n')");
|
||||
if($config['alerts']['email']['enable'])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user