Gentoo Archives: gentoo-user

From: Michal 'vorner' Vaner <vorner@×××.cz>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Sending IMs from a script
Date: Wed, 16 Jan 2008 10:23:01
Message-Id: 20080116102224.GA21408@tarantula.kolej.mff.cuni.cz
In Reply to: [gentoo-user] Sending IMs from a script by Neil Bothwick
1 Hello
2
3 On Wed, Jan 16, 2008 at 10:04:31AM +0000, Neil Bothwick wrote:
4 > I would have thought this was easy, but I've looked around and can't find
5 > a program that will send IMs from a script. I need to be able to send
6 > alerts to people from a monitoring program.
7
8 I have a solution for you (thought I do not know how this is related to
9 gentoo). Look at http://vorner.pretel.cz/en/projects.html#jelnet -- it's
10 a jabber telnet, you can let it connect to server and pipe some raw
11 protocol into it.
12
13 So you need something like:
14
15 jeltet bot@address --password=password <<END
16 <message to='recipient@server' type='headline'>
17 <subject>Notification</subject>
18 <body>This is your notification</body>
19 </message>
20 END
21
22 It has a disadvantage -- it logs in, sends a message and logs out every
23 time you send a notification. If you want to send from time to time, it
24 is no problem, but with a notification every minute or so, it can be an
25 issue. (Then you might need some fifo, cat, & and tricks like that)
26
27 I hope this helps.
28
29 --
30 I left the ssh key under the doormat
31
32 Michal 'vorner' Vaner