This is a short description of how to setup Nagios Message Broker to work with your local Nagios installation.
In order to enable passive checks in Nagios, you'll need to do the following:
If you want to schedule service checks through Nagios Message Broker you have to enable external commands in Nagios.
In order to have Nagios process external commands, make sure you do the following:
Nagios Message Broker uses a XML configuration file which defines the MBeans, JMX notifications, matchers and actions. See also the schema file for further information.
<?xml version="1.0" encoding="UTF-8"?> <nmb:xmlConfiguration xmlns:nmb="http://www.syabru.ch/nagios-msg-broker/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.syabru.ch/nagios-msg-broker/1.0 http://snippets.syabru.ch/nagios-msg-broker/schema/nagios-msg-broker-1_0.xsd"> <nmb:jmx> <nmb:mBeanServer> <nmb:jmxServiceUrl>service:jmx:rmi:///jndi/rmi://localhost:35001/jmxrmi</nmb:jmxServiceUrl> <nmb:notification> <nmb:objectName>ch.syabru.nagios.broker:type=TestMockMBean</nmb:objectName> <nmb:match/> <nmb:action> <nmb:processServiceCheckResult> <nmb:hostName>localhost</nmb:hostName> <nmb:serviceDescription>Test Process Service Check Result</nmb:serviceDescription> <nmb:returnCode>0</nmb:returnCode> <nmb:pluginOutput>OK - Test</nmb:pluginOutput> </nmb:processServiceCheckResult> <nmb:scheduleServiceCheck> <nmb:hostName>localhost</nmb:hostName> <nmb:serviceDescription>Test Schedule Service Check Result</nmb:serviceDescription> </nmb:scheduleServiceCheck> </nmb:action> </nmb:notification> </nmb:mBeanServer> </nmb:jmx> </nmb:xmlConfiguration>
Note: A service definition must exist in Nagios before you can submit passive check results for it! Nagios will ignore all check results for services that had not been configured before it was last (re)started.