View Full Version : jabber message
amcorreia
04-10-2006, 15:33
Hi,
I write a simple client to send jabber message.
this can be used with zabbix, with a simple shell script or a little patch for zabbix (I write, but...)
need lib iksemel
http://iksemel.jabberstudio.org
James Wells
04-10-2006, 20:16
Greetings,
I write a simple client to send jabber message.
this can be used with zabbix, with a simple shell script or a little patch for zabbix (I write, but...)
Alessandro, do you mind if I try to make a Zabbix Server patch to add this as a media type? I can't promise I will make it work any time soon, but looking at your code, I should be able to make it work.
amcorreia
04-10-2006, 20:37
Hi,
no, (excuse me, my english is very poor)
I have wrote a patch for this.
I guess with a little shell code this can work fine.
I sending my patch (this patch is for version 1.1.1)
James Wells
04-10-2006, 20:43
Sweet. Thank you.
Now to go add it to my server. ;)
Wouldn't it be better to fully integrate it into ZABBIX code? I do not think it is a good idea to fork new processes for each Jabber message being sent.
James Wells
05-10-2006, 17:17
Okay, so I had a chance to play with this on my server and as Alexei says, it forks a new process each time the server attempts to send a notification. Not sure about others, but I would prefer to keep a single process / thread connected at all times.
I am going to spend some time this weekend and try to get it fully integrated into the Zabbix Server. The way I would like to use it is that when the Zabbix Server starts up, it spawns an extra thread, which connects to Jabber server / Google Talk server, and sits quietly until it needs to send a notification. This will help cut down on the latency, and eventually allow for more capabilities in the future, such as getting latest data, via Jabber / Google Talk.
I would implement it in exaclty the same way as email/SMS notifications are. Is there something special about sending jabber messages? If not, then a single function (not a thread or an extra process) might take care of this provided it will time out after some time (5 seconds normally).
James Wells
05-10-2006, 17:31
I would implement it in exaclty the same way as email/SMS notifications are. Is there something special about sending jabber messages? If not, then a single function (not a thread or an extra process) might take care of this provided it will time out after some time (5 seconds normally).
Yes and no. To send a Jabber / Google Talk message, you must first log into the IM system, craft an XML which contains the message and destination, and then submit it to the server. The problem though is the log in process can take anywhere from .2ms to 15s, depending on the login auth mechanisms. For example, to log into Google Talk (Which uses the Jabber protocol), you must first connect in clear text to initiate a TLS connection. Once the TLS is initialized, you send an XML message to the server requesting login, the server then sends back another XML message telling you what authentication mechanisms are supported. You then craft a new XML with userid / password along with the service you wish to connect to. Once that completes, you are finally able to send an IM, Google Email (If using Google Talk), voice message, etc.
It's a very powerful system, but almost painfully slow to initiate a connection. Of course, if you are using your own internal Jabber server, the connection time can be reduced, but many people I talk to tend to lock their Jabber down even more than Google Talk does.
amcorreia
06-10-2006, 19:19
I have make any change in source code o zabbix and have full integrated jabber with zabbix.
This don't make fork (improved alexei?), this is a 'persistent' conection, but the roster don't is online, (well, he just send message ;)
I didnt tested this patch yet, i prefer wait till it becomes an "official" patch or plugin.
But Zabbix sending alerts using jabber is a great idea. nice job amcorreia :)
James Wells
07-02-2007, 20:15
Alexei, please tell me this feature is going into 1.4. We are not using Jabber yet, but it was just added to my list of things and this feature will be a requirement shortly after we migrate to Zabbix 1.4.
I do confirm that the feature is going into 1.4. Actually it is already developed though we are doing serious testing tomorrow :)
I do confirm that the feature is going into 1.4. Actually it is already developed though we are doing serious testing tomorrow :)
This sounds so good :)