clean, clean, clean, all i have to do is clean

git-svn-id: http://www.observium.org/svn/observer/trunk@1855 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-15 15:27:14 +00:00
parent 6b0c5c183f
commit a8d60662d2
6 changed files with 151 additions and 119 deletions

20
irc.php
View File

@@ -16,9 +16,9 @@ class observiumbot
$device = mysql_fetch_array(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*"; }
if($device['disabled']) { $status = "*Disabled*"; }
if ($device['status'] == 1) { $status = "Up " . formatUptime($device['uptime'] . " "); } else { $status = "Down "; }
if ($device['ignore']) { $status = "*Ignored*"; }
if ($device['disabled']) { $status = "*Disabled*"; }
$irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, 'id'.$device['device_id'] . " " . $device['os'] . " " . $device['version'] . " " .
$device['features'] . " " . $status);
@@ -47,17 +47,17 @@ $port = 6667;
$nick = "Observium";
$chan = "#observium";
$bot = &new observiumbot( );
$irc = &new Net_SmartIRC( );
$bot = &new observiumbot();
$irc = &new Net_SmartIRC();
$irc->setUseSockets( TRUE );
$irc->registerActionhandler( SMARTIRC_TYPE_CHANNEL, '!device', $bot, 'device_info' );
$irc->registerActionhandler( SMARTIRC_TYPE_CHANNEL, '!port', $bot, 'port_info' );
$irc->connect( $host, $port );
$irc->login( $nick, 'Observium Bot', 0, $nick );
$irc->join( array( $chan ) );
$irc->listen( );
$irc->disconnect( );
$irc->connect($host, $port));
$irc->login($nick, 'Observium Bot', 0, $nick );
$irc->join(array($chan))));
$irc->listen();
$irc->disconnect();
?>