I haven’'t seen nagios for quite some time, however I kindof recall it being written in php… could be wrong, anyway have a look at Flyspray http://flyspray.org/ (more great open source) they have a php class in their bugtracker which I was able to pull out and use to do exactly what you are trying to do.
The class itself didn’'t do MUC, however given php is easy and XMPP is well documented it was easy enough to extend it so it could MUC,
It logs into the chat, sends the message and leaves the chat. Takes about 5 lines of code and the class to do it - log in - speak - logout.
I use it in a web app I built for work that sends outage notifications to chatroom(s) as soon they get entered into our db. I extended it to do xhtml chat too so it can color code the event info based on severity and status, the message is a basic abstract of the outage with a hyperlink to the web interface with the details. A simple 1 line notice that doesn’‘t disturb the chat, yet doesn’'t go unnoticed either.
There is plenty of great perl and python support for xmpp too, if you are using open source you must have someone to hack a bit of code for you too.
Open source rules