Without a place to send messages to, eventbus will just trigger and shut down. There are two different methods that eventbus can deliver alarm messages and relevant data; XMPP messages and using the mailer extension.
In order to retrieve notifications, a subscription to the eventbus@tigase.org
user must be made.
Keep in mind that subscriptions are not persistent across server restarts, or triggers.
The eventbus schema is very similar to most XMPP subscription requests but with a few tweaks to differentiate it if you wanted
to subscribe to a certain task or all of them. Each task is considered a node, and each node has the following pattern: eventName|eventXMLNS
. Since each monitoring task has the tigase:monitor:event
event XMLNS, we just need to pick the event name from the list of tasks.
So like the above example, our event node for the disk task will be disk-task|tigase:monitor:event
.
Applied to an XMPP stanza, it will look something like this:
<iq type='set' to='eventbus@tigase.org' id='sub1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <subscribe node='disk-taskEvent|tigase:monitor:event' jid='$USER_JID'/> </pubsub> </iq>
Don’t forget to replace $USER_JID
with the bare JID of the user you want to receive those messages. You can even have them sent to a MUC or any component with
a JID.
Available events are as follows:
- disk-taskEvent for
disk-task
- LoggerMonitorEvent for
logger-task
- HeapMemoryMonitorEvent for
memory-checker-task
- LoadAverageMonitorEvent for
load-checker-task
- CPUTempMonitorEvent for
cpu-temp-task
- UsersDisconnected for
connections-task
Alternatively, you can also subscribe to all events within the eventbus by using a wildcard * in place of the event XMLNS like this example:
<iq type='set' to='eventbus@tigase.org' id='sub1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <subscribe node='*|tigase:monitor:event' jid='$USER_JID'/> </pubsub> </iq>
<message from='eventbus.shakespeare.lit' to='francisco@denmark.lit' id='foo'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='EventName|tigase:demo'> <item> <EventName xmlns="tigase:demo" eventSource="samplecomponent.shakespeare.lit'" eventTimestamp="1444216850"> <sample_value>1</sample_value> </EventName> </item> </items> </event> </message>