Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-9581

Document JDBCQueryMonitor "compare_string" Action

    XMLWordPrintable

    Details

      Description

      There's no example of how to use the "compare_string" action of JDBCQueryMonitor, so I just followed the example for "row_count". However, when using the compare mode, you need an additional parameter, "column".

      Adding a short example monitor, like this, would be useful for other users:

            <service name="MariaDB-Galera" interval="300000" user-defined="false" status="on">
               <parameter key="retry" value="1"/>
               <parameter key="timeout" value="3000"/>
               <parameter key="driver" value="org.mariadb.jdbc.Driver"/>
               <parameter key="user" value="opennms"/>
               <parameter key="password" value="********"/>
               <parameter key="url" value="jdbc:mysql://OPENNMS_JDBC_HOSTNAME"/>
               <parameter key="query" value="SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'"/>
               <parameter key="column" value="VARIABLE_VALUE"/>
               <parameter key="action" value="compare_string"/>
               <parameter key="operator" value="="/>
               <parameter key="operand" value="Primary"/>
               <parameter key="message" value="Galera Node is not in primary component"/>
            </service>
      

        Attachments

          Activity

            People

            Assignee:
            fuhrmann Marcel Fuhrmann
            Reporter:
            pioto Mike Kelly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: