简体   繁体   中英

Send XMPP message to LDAP group

My requirement is to notify group of people if our backup fails. We've got an OpenFire XMPP server, and I'm planning on using one of the many Python libraries for sending XMPP messages.

Is it possible to send a message to an XMPP group programmatically? I've poked around, but it's possible that I'm not asking the right questions.

I'd prefer not to enter user id's of individuals when sending the message, as that would require scripting changes if people joined/left the group. It would be convenient if I could just send to all members of an OpenFire XMPP group, which is mapped to LDAP. Any ideas?

Thanks much

Getting the list of users out of LDAP will depend on how you've stored the users and what their XMPP id's are. There are so many different options (groupOfNames, posixGroup, etc) that I would like to suggest an alternative (that we use for this exact same purpose).

Setup a chat room and then have your status broadcasts go there.

Doing this simplifies the problem immensely. Now your script that posts status can be a simple one shot call then sends to a single recipient (the chat room).

This is quite trivial with a library like xmpppy . If you'd rather use more of a framework we've built xpybot that allows you to quickly and easily write XMPP bots and I've just updated the examples folder to include a bot that announces simple messages , like described here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM