[jdev] xmppping - simple XEP-0199 pinging script

Maciek Niedzielski machekku at uaznia.net
Thu Jan 4 21:26:27 CST 2007

I wrote a simple script that can be used for xmpp-pinging.

(requires python and PyXMPP)

It tries to mimic ping command, so should be not so hard to use ;)

To have some practical use cases, it returns 0 if there was at least one
pong received, or non-zero if there was no reply or something else bad
happened. This should make it easy to monitor your bots, etc.

BTW: Some things that I noticed while writing this.

A nice thing in the XEP is that even if other entity does not support
the XEP, it will return an error, which serves for a pong. However, it
is important to notice that not every error response is a pong. The XEP
suggest using cancel/service-unavailable. cancel/feature-not-implemented
(sent by jabberd2) sounds fine, too. However, there are errors like
wait/recipient-unavailable which are definitely not pongs. So
implementors should be careful about what they accept as pongs.

Other thing: when pinging new jabberd14 on amessage.de, I noticed that
it sends a pong when I pinging a (most probably) unexisting account (I
used a random node and resource). I'm not sure if this is the right
thing to do. I think the rule is that server should not respond for Iq
sent to a full JID.

Maciek                       A: It's against natural order of reading.
 xmpp:machekku at uaznia.net   Q: Why is that?
 xmpp:machekku at chrome.pl   A: People answering above quoted text.
                          Q: What's the most annoying on newsgroups?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20070105/39232175/attachment-0002.pgp>

More information about the JDev mailing list