M/Monit collector API

Issue #887 resolved
Gábor Hollósi created an issue


I've made an “SNMP-MMonit gateway” which is a snmptrapd and a sender script. The script evaluates the trap, constructs the XML and sends it to MMonit by curl, but the XML is not 100%.

Unfortunately I haven’t find an XSD or an any documentation from Collector API, only an old mail on mailing list from Jan-Henrik Haukeland to plan to open the collector.

Are you still planning to open it? And if so, when?



Comments (4)

  1. Tildeslash repo owner

    The collector XML API is open, but undocumented. One can investigate the Monit source code to see the format and content of the XML document. The problem with sending arbitrary data to M/Monit is that there needs to be something on the M/Monit side that can e.g. draw charts with these data and also an API for querying the data.

  2. Gábor Hollósi reporter

    Thank you for your answer. I’ve found all the necessary info in source as you pointed out.

    SNMP trap is a simple text message, not numeric value, so drawing is not needed.

    Now I’m using this template:

    <?xml version="1.0" encoding="ISO-8859-1"?>
     <monit id="$SNMP_TRAP_SENDER_HOSTNAME" incarnation="$(date "+%s")" version="5.3.2">
                    <service name="monit">
                            <collected_sec>$(date "+%s")</collected_sec>
                            <collected_usec>$(date "+%6N")</collected_usec>
                    <collected_sec>$(date "+%s")</collected_sec>
                    <collected_usec>$(date "+%6N")</collected_usec>
                    <type>7</type>         <!-- It is a “Program”... -->
                    <id>2097152</id>       <!-- “Status” value is...-->
                    <state>3</state>       <!-- 0/1/2 Failed/Succeeded/Changed...-->
                    <action>1</action>     <!-- and the action is Alert -->

  3. Log in to comment