<br><font size=2><tt>Hello,</tt></font>
<br>
<br><font size=2><tt>is there a way to send hobbit's alerts to a jabber's
client ? I've done a script but it doesn't seem to work ("Cannot connect(
)") and I don't know why ! So, I will try to use rss and forward the
threads to jabber via rrs2jabber. If someone got a working script or a
better idea, you're welcome !</tt></font>
<br>
<br><font size=2><tt>Thomas</tt></font>
<br>
<br><font size=2><tt>Here is my perl script alertjabber.pl. You can use
it by adding the following line to hobbit-alerts.cfg :</tt></font>
<br>
<br><font size=2><tt>SCRIPT /Soft/HOBBIT-4.1.2p1/server/bin/alertjabber.pl
hobbit@myjabber.server.org REPEAT=10</tt></font>
<br>
<br><font size=2><tt>#!/usr/bin/perl</tt></font>
<br><font size=2><tt>#</tt></font>
<br><font size=2><tt>#######################################################</tt></font>
<br><font size=2><tt>#</tt></font>
<br><font size=2><tt># Author Thomas Seglard</tt></font>
<br><font size=2><tt># Created from various code examples found on the
web</tt></font>
<br><font size=2><tt># Feel free to use or modify as needed to suit your
needs</tt></font>
<br><font size=2><tt># Description :</tt></font>
<br><font size=2><tt># Get hobbit's variables and send them to jabber's
server</tt></font>
<br><font size=2><tt>#</tt></font>
<br><font size=2><tt>#######################################################</tt></font>
<br>
<br><font size=2><tt>use strict;</tt></font>
<br><font size=2><tt>use Net::Jabber qw(Client) ;</tt></font>
<br><font size=2><tt>use Net::Jabber qw(Message) ;</tt></font>
<br><font size=2><tt>use Net::Jabber qw(Protocol) ;</tt></font>
<br><font size=2><tt>use Net::Jabber qw(Presence) ;</tt></font>
<br>
<br><font size=2><tt>use constant SERVER    => 'myjabber.server.org';</tt></font>
<br><font size=2><tt>use constant PORT      => 5222;</tt></font>
<br><font size=2><tt>use constant USER      => 'hobbit';</tt></font>
<br><font size=2><tt>use constant PASSWORD  => 'hobbit';</tt></font>
<br><font size=2><tt>use constant RESOURCE  => 'Psi';</tt></font>
<br><font size=2><tt>use constant MAXWAIT   => 2 ;</tt></font>
<br><font size=2><tt>my $MSG  = $ENV{'BBALPHAMSG'};</tt></font>
<br><font size=2><tt>my $DST  = $ENV{'RCPT'};</tt></font>
<br><font size=2><tt>my $HST  = $ENV{'BBHOSTSVC'};</tt></font>
<br>
<br><font size=2><tt>my $connection = Net::Jabber::Client->new();</tt></font>
<br><font size=2><tt>$connection->Connect( "hostname" =>
SERVER,"port" => PORT )  or die</tt></font>
<br><font size=2><tt>"Cannot connect ($!)\n";</tt></font>
<br>
<br><font size=2><tt>my @result = $connection->AuthSend( "username"
=> USER,"password" =></tt></font>
<br><font size=2><tt>PASSWORD,"resource" => RESOURCE );</tt></font>
<br><font size=2><tt>if ($result[0] ne "ok") {</tt></font>
<br><font size=2><tt> die "Ident/Auth with server failed: $result[0]
- $result[1]\n";</tt></font>
<br><font size=2><tt>}</tt></font>
<br><font size=2><tt>my $message = Net::Jabber::Message->new();</tt></font>
<br><font size=2><tt> $message->SetMessage( "to"  
                => $DST,</tt></font>
<br><font size=2><tt>               
         "subject"      =>
"Alerte $HST",</tt></font>
<br><font size=2><tt>               
         "type"      
  => "chat",</tt></font>
<br><font size=2><tt>               
         "body"      
  => $MSG);</tt></font>
<br>
<br><font size=2><tt>   $connection->Send($message);</tt></font>
<br><font size=2><tt>   sleep(MAXWAIT);</tt></font>
<br><font size=2><tt>$connection->Disconnect();</tt></font>
<br><font size=2><tt>exit;</tt></font><FONT SIZE=3><BR>
<BR>
Ce message (et toutes ses pieces jointes eventuelles) est confidentiel et etabli a l'intention exclusive de ses destinataires.<BR>
Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est<BR>
interdite, sauf autorisation expresse.<BR>
L'internet ne permettant pas d'assurer l'integrite de ce message, CNP Assurances et ses filiales declinent toute responsabilite<BR>
au titre de ce message, s'il a ete altere, deforme ou falsifie.<BR>
<BR>
*****<BR>
<BR>
This message and any attachments (the "message") are confidential and intended solely for the addressees.<BR>
Any unauthorised use or dissemination is prohibited.<BR>
E-mails are susceptible to alteration.<BR>
Neither CNP Assurances nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified.<BR>
</FONT>