Http post issue

simba <[email protected]> Mon, 23 Jul 2018 21:49:54 -0700 (MST)
Newsgroups gmane.network.opennms.general
Message-ID <[email protected]>
I'm new to openNMS and am running the Windows version 22.0.1. I'm trying to
do an http post to an external server when an alarm is detected in openNMS.
I'm trying to http post to an axis io module to pulse an input when an SNMP
trap for power failure on a server triggers an alarm.

Snapshots of my configuration are as follows:

NOTIFICATIONCOMMANDS.XML

   <command binary="false">
        <name>httpPost</name>
       
<execute>org.opennms.netmgt.notifd.HttpNotificationStrategy</execute>
        <comment>Class for sending notifications with an HTTP Post</comment>
        <argument streamed="false">
                <switch>url</switch>
        </argument>
        <argument streamed="false">
                <switch>timeout</switch>
        </argument>
        <argument streamed="false">
                <switch>retries</switch>
        </argument>
        <argument streamed="false">
                <switch>-tm</switch>
        </argument>
        <argument streamed="false">
                <switch>result-match</switch>
        </argument>
        <argument streamed="false">
                <switch>sql</switch>
        </argument>
        <argument streamed="false">
                <switch>post-NodeID</switch>
        </argument>
        <argument streamed="false">
                <switch>post-event</switch>
        </argument>
        <argument streamed="false">
                <switch>post-nasid</switch>
        </argument>
        <argument streamed="false">
                <switch>post-queue</switch>
        </argument>
        <argument streamed="false">
                <switch>post-message</switch>
        </argument>
    </command>
</notification-commands>

NOTIFICATIONS.XML

   <notification name="PowerSupplyFault" status="on" writeable="yes">
     
<uei>uei.opennms.org/traps/IDRAC-MIB-SMIv2/alertPowerSupplyFailure</uei>
      <description>Power supply failure</description>
      <rule>(IPADDR IPLIKE 172.255.2.*)</rule>
      <destinationPath>PowerSupplyFault</destinationPath>
      <text-message>Power failure detected</text-message>
      <subject>Notice #%noticeid%</subject>
      <numeric-message>111-%noticeid%</numeric-message>
      <varbind>
         <vbname>url</vbname>
        
<vbvalue>http://172.255.2.17/axis-cgi/io/output.cgi?action=1:1000/300\500/300\</vbvalue>
      </varbind>
   </notification>
</notifications>

DESTINATION PATHS.XML

   </path>
   <path name="PowerSupplyFault" initial-delay="0s">
      <target>
         <name>admin</name>
         <autoNotify>on</autoNotify>
         <command>httpPost</command>
      </target>
      <target interval="0m">
         <name>Admin</name>
         <autoNotify>on</autoNotify>
         <command>httpPost</command>
      </target>

My notifd log file is showing the following:

org.opennms.netmgt.notifd.HttpNotificationStrategy.send(HttpNotificationStrategy.java:109)
[opennms-services-22.0.1.jar:?]
	at org.opennms.netmgt.notifd.ClassExecutor.execute(ClassExecutor.java:69)
[opennms-services-22.0.1.jar:?]
	at
org.opennms.netmgt.notifd.NotificationTask.run(NotificationTask.java:274)
[opennms-services-22.0.1.jar:?]
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[?:1.8.0_172]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[?:1.8.0_172]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]
Caused by: org.apache.http.ProtocolException: Target host is not specified
	at
org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:70)
~[httpclient-4.5.2.jar:4.5.2]
	at
org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:124)
~[httpclient-4.5.2.jar:4.5.2]
	at
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:183)
~[httpclient-4.5.2.jar:4.5.2]
	... 9 more
2018-07-24 13:00:50,676 ERROR [NotificationTask-10] o.o.n.n.ClassExecutor:
Throwable received while sending message
java.lang.RuntimeException: Problem with HTTP post: null
	at
org.opennms.netmgt.notifd.HttpNotificationStrategy.send(HttpNotificationStrategy.java:115)
~[opennms-services-22.0.1.jar:?]
	at org.opennms.netmgt.notifd.ClassExecutor.execute(ClassExecutor.java:69)
[opennms-services-22.0.1.jar:?]
	at
org.opennms.netmgt.notifd.NotificationTask.run(NotificationTask.java:274)
[opennms-services-22.0.1.jar:?]
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[?:1.8.0_172]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[?:1.8.0_172]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]

I can't tell where I'm getting it wrong. Can you assist?

Regards,

Simba





--
Sent from: http://opennms.530661.n2.nabble.com/OpenNMS-discuss-f529575.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-discuss mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-discuss