mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
some formatting cleanups, introduce some more FIXMEs to look at, plus replace mysql_fetch_array by mysql_fetch_assoc, for great justice
git-svn-id: http://www.observium.org/svn/observer/trunk@2029 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
6
irc.php
6
irc.php
@@ -14,7 +14,7 @@ class observiumbot
|
||||
{
|
||||
$hostname = $data->messageex[1];
|
||||
|
||||
$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE `hostname` = '".mres($hostname)."'"));
|
||||
$device = mysql_fetch_assoc(mysql_query("SELECT * FROM `devices` WHERE `hostname` = '".mres($hostname)."'"));
|
||||
|
||||
if ($device['status'] == 1) { $status = "Up " . formatUptime($device['uptime'] . " "); } else { $status = "Down "; }
|
||||
if ($device['ignore']) { $status = "*Ignored*"; }
|
||||
@@ -29,8 +29,8 @@ class observiumbot
|
||||
$hostname = $data->messageex[1];
|
||||
$ifname = $data->messageex[2];
|
||||
|
||||
$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE `hostname` = '".mres($hostname)."'"));
|
||||
$port = mysql_fetch_Array(mysql_query("SELECT * FROM `ports` WHERE `ifName` = '".$ifname."' OR `ifDescr` = '".$ifname."' AND device_id = '".$device['device_id']."'"));
|
||||
$device = mysql_fetch_assoc(mysql_query("SELECT * FROM `devices` WHERE `hostname` = '".mres($hostname)."'"));
|
||||
$port = mysql_fetch_assoc(mysql_query("SELECT * FROM `ports` WHERE `ifName` = '".$ifname."' OR `ifDescr` = '".$ifname."' AND device_id = '".$device['device_id']."'"));
|
||||
|
||||
$bps_in = formatRates($port['ifInOctets_rate']);
|
||||
$bps_out = formatRates($port['ifOutOctets_rate']);
|
||||
|
Reference in New Issue
Block a user