IM notification
Wojciech Kocjan
wojciech at kocjan.org
Wed Mar 19 16:04:21 CET 2008
Dnia 19-03-2008 o 15:00:06 Alex Dehaini <alexdehaini at gmail.com> napisał(a):
> Excellent, it worked. How can I get this to work using googletalk. I
> passed
> the same parameters but this is the error I got.
> /usr/local/bin/notify_via_jabber emailaddress at gmail.com "I am alive"
> Cannot connect (Invalid argument).
>
> These were the settings in my notify_via_jabber file
>
> use constant RECIPIENT => $ARGV[0];
> use constant SERVER => 'talk.gmail.com';
> use constant PORT => 5222;
> use constant USER => emailaddress';
> use constant PASSWORD => 'password';
> use constant RESOURCE => 'resource';
> use constant MESSAGE => $ARGV[1];
> use constant MAXWAIT => 2 ;
>
> Am I doing anything wrong?
my $username = "wojciech.kocjan";
my $password = "xxxxxxxxx";
my $resource = "APUD";
The only thing I got confused is that the script I gave you as a link adds
@gmail.com to the address.
I modified it to be:
# Send messages
sleep(2);
foreach ( @field ) {
$Connection->MessageSend(
to => "$_",
resource => $resource,
subject => "Notification",
type => "chat",
body => $ARGV[1]);
}
sleep(2);
$Connection->Disconnect();
exit;
And run notify_via_jabber mysecondid at gmail.com "Test message"
Worked like a charm.
--
Wojciech Kocjan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list