mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
20
irc.php
20
irc.php
@@ -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();
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user