Http poller not working: Unexpected exception while polling PollableService

We’re currently running OpenNMS 24.1.0, and I’ve just discovered several of our HTTP pollers are failing.

The error I’m seeing in poller.log is:

2019-06-14 15:02:42,827 ERROR [Poller-Thread-13-of-30] o.o.n.p.p.PollableServiceConfig: Unexpected exception while polling PollableService[location=Default, interface=PollableInterface [PollableNode [78]:10.2.0.12], svcName=RFINTEG-logcall_prelim]. Marking service as DOWN
java.lang.NullPointerException: null
2019-06-14 15:02:56,831 ERROR [Poller-Thread-27-of-30] o.o.n.p.p.PollableServiceConfig: Unexpected exception while polling PollableService[location=Default, interface=PollableInterface [PollableNode [78]:10.2.0.12], svcName=RFINTEG-logcall]. Marking service as DOWN
java.lang.NullPointerException: null
2019-06-14 15:02:58,831 ERROR [Poller-Thread-6-of-30] o.o.n.p.p.PollableServiceConfig: Unexpected exception while polling PollableService[location=Default, interface=PollableInterface [PollableNode [78]:10.2.0.12], svcName=RFINTEG-logcall_fqdn]. Marking service as DOWN
java.lang.NullPointerException: null

The configuration for these pollers are:

  <service name="RFINTEG-logcall" interval="300000" user-defined="false" status="on">
     <parameter key="retry" value="3"/>
     <parameter key="timeout" value="10000"/>
     <parameter key="port" value="80"/>
     <parameter key="url" value="/cgi-bin/logcall.pl"/>
     <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/>
     <parameter key="rrd-base-name" value="logcall"/>
     <parameter key="ds-name" value="logcall"/>
     <parameter key="response" value="200-200"/>
     <parameter key="reason-template" value="Failed to contact logcall.pl on ${node}"/>
  </service>
  <service name="RFINTEG-logcall_fqdn" interval="300000" user-defined="false" status="on">
     <parameter key="retry" value="3"/>
     <parameter key="timeout" value="10000"/>
     <parameter key="port" value="80"/>
     <parameter key="url" value="/cgi-bin/logcall_fqdn.pl"/>
     <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/>
     <parameter key="rrd-base-name" value="logcall_fqdn"/>
     <parameter key="ds-name" value="logcall_fqdn"/>
     <parameter key="response" value="200-200"/>
     <parameter key="reason-template" value="Failed to contact logcall_fqdn.pl on ${node}"/>
  </service>
  <service name="RFINTEG-logcall_prelim" interval="300000" user-defined="false" status="on">
     <parameter key="retry" value="3"/>
     <parameter key="timeout" value="10000"/>
     <parameter key="port" value="80"/>
     <parameter key="url" value="/cgi-bin/logcall_prelim.pl"/>
     <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/>
     <parameter key="rrd-base-name" value="logcall_prelim"/>
     <parameter key="ds-name" value="logcall_prelim"/>
     <parameter key="response" value="200-200"/>
     <parameter key="reason-template" value="Failed to contact logcall_prelim.pl on ${node}"/>
  </service>
   ...
   <monitor service="RFINTEG-logcall" class-name="org.opennms.netmgt.poller.monitors.HttpMonitor"/>
   <monitor service="RFINTEG-logcall_fqdn" class-name="org.opennms.netmgt.poller.monitors.HttpMonitor"/>
   <monitor service="RFINTEG-logcall_prelim" class-name="org.opennms.netmgt.poller.monitors.HttpMonitor"/>

Is there any known issues with the http poller in OpenNMS 24.1.0, or is this a new bug, or do I have a configuration error?

This poller was working with previous versions of OpenNMS.

Regards,
John

Can you test if you still get the error when you remove the replacement ${node} in the reason-template?

1 Like

I removed the reason-template element totally which has made the error disappear and the service shows as up now.

What benefit would I gain from defining a reason-template? I wasnt seeing anything from it in any of my notifications.

The benefit we gain: :tada: you have found a bug :smiley:

1 Like

Can you please try {nodeLabel} instead of {node}. It seems to be changed from 23 -> 24 see here: Monitors Placeholder Substitution in Parameters.

I’m away from work now until Tuesday. I’ll have a look when I’m back at work.

1 Like

I changed the ${node} to {nodeLabel} and that has made the error go away and the http service now gets monitored.

{node} and {nodelabel} also produced the error but {fred} did not produce the error.