Jdbc Query Monitor fails with nullPointerExecption

Description

I've tried this monitor and I always get an outage with reason:
Err: java.lang.NullPointerException

<service name="ReportSchedulerQueue" interval="60000" user-defined="true" status="off"> <parameter key="driver" value="org.postgresql.Driver"/> <parameter key="url" value="jdbc:postgresql://10.10.6.41:5432/database"/> <parameter key="user" value="USER"/> <parameter key="password" value="PASSWORD"/> <parameter key="query" value="select count(1) from report_schedules where active = true and next_execution &lt; (now() at time zone 'utc' - INTERVAL '4 HOUR');"/> <parameter key="action" value="compare_int"/> <parameter key="operand" value="0"/> <parameter key="operator" value="="/> <parameter key="message" value="Unusual amount of unprocessed reports."/> </service>

Is does not matter if I change the operator like this:

<service name="ReportSchedulerQueue" interval="60000" user-defined="true" status="off"> <parameter key="driver" value="org.postgresql.Driver"/> <parameter key="url" value="jdbc:postgresql://10.10.6.41:5432/database"/> <parameter key="user" value="USER"/> <parameter key="password" value="PASSWORD"/> <parameter key="query" value="select count(1) from report_schedules where active = true and next_execution &lt; (now() at time zone 'utc' - INTERVAL '4 HOUR');"/> <parameter key="action" value="compare_int"/> <parameter key="operand" value="10"/> <parameter key="operator" value="&gt;"/> <parameter key="message" value="Unusual amount of unprocessed reports."/> </service>

I've attached the debug logs and it seems that pollerd doesn't get the exception. But you can see it in the event (also in the log for event creation).

I've tried the example from docs.opennms.org (which I can't access atm to link it here) and it worked without any problems.

So my guess is, that something in my SQL statement breaks the functionality.

Acceptance / Success Criteria

None

Attachments

1
  • 14 Sep 2018, 07:00 PM

Lucidchart Diagrams

Activity

Show:

Marcel Fuhrmann September 17, 2018 at 8:42 AM

Found the issue in my config.
The column parameter was missing.

Fixed

Details

Assignee

Reporter

Labels

Affects versions

Priority

PagerDuty

Created September 14, 2018 at 7:06 PM
Updated September 17, 2018 at 8:42 AM
Resolved September 17, 2018 at 8:42 AM

Flag notifications