The main default port for non-SSL jabber is 5222. You could spit some xml at it using telnet and see if you get an XML response:
telnet suspectedServer 5222
<?xml version="1.0"?> <stream:stream to="foo.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
This can of course be scripted for multiple servers and multiple ports, probably easier to script with nc (netcat).
For XMPP servers which require TLS connections, test with : -
openssl s_client -starttls xmpp -connect suspectedserver:5222
If you are logging trough syslog, Metalog has support to execute a command whenever a message matching some criterion gets logged. Otherwise, you can use tailf
to watch for new lines in a log file.
sendxmpp is a small perl script to send XMPP messages (possibly already available as a package for your favorite distribution)
You could stitch those two together with a shell script without too much difficulty. For the metalog case, create a script like this one:
#!/bin/sh
echo $* |sendxmpp your-xmpp-id@gmail.com
And add command = /path/to/script.sh
to the relevant section of metalog.conf
For the tailf case, you could try something like this, run in a persistent way:
tailf /var/log/file-to-watch.log |(while true; do read M; echo $M | sendxmpp recipient@gmail.com; done)
sendxmpp needs a valid XMPP account, see the man page for how to configure the account to be used.
(from my experience, XMPP-delivered error messages tend to become quite annoying if they're too frequent...)
Best Answer
Openfire works for me: http://www.igniterealtime.org/projects/openfire/