HTTP Service is not getting discovered in OpenNms for tomcat8.5 without SendResonPharse - opennms

HttpMonitor Config was working fine with tomcat7 and http service was getting detected however as we have updated to tomcat 8.5 http service is not getting discovered unless we set connector properties as sendReasonPhrase=true, the difference in the curl response is like below in compare to tomcat7 and tomcat 8.5 (withoutsend Reson Phrase parameter set)
tomcat7 gives ok in its header and tomcat8.5 does not.
however option for sendreson phase will be deprecated and removed from tomcat9 and even this option will not be available (https://tomcat.apache.org/tomcat-8.5-doc/config/http.html)
I am not sure why httpMonitor in openNms is not able to detect the http service even the snmpwalk output see port 80 available (both with and without send reason phrase)
in poller-configuration.xml looks like below for http
<service name="HTTP" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="1"/>
<parameter key="timeout" value="3000"/>
<parameter key="port" value="80"/>
<parameter key="url" value="/"/>
<parameter key="rrd-repository" value="/var/lib/opennms/rrd/response"/>
<parameter key="rrd-base-name" value="http"/>
<parameter key="ds-name" value="http"/>
</service>
even we tried setting
<parameter key="response-text" value="~\bOK\b"/>
and
<parameter key="response" value="200"/>
however it did not help, i guess above parameter play its role once service got discovered however the problem here the service is not getting discovered (unless SendReson pharse is turn on ) it will only detect http service in tomcat 8.5 if we have sendreson phase turn on in connector definition inside server.xml
Kindly help to understand this behaviour here and possible solution for this without any change on client side.
openNms version info:

Related

Why i can not to check my ftp connection in wso2

I have a proxy service in wso2. This service uses the ftp settings with which I download files. But sometimes it doesn't work as I expect it to. How can I check the ftp connection in wso2 and, if I get a timeout or connection refused, make a reconnection?
It is parameters of my proxy service in wso2
<parameter name="transport.vfs.ContentType">text/plain;charset=UTF-8</parameter>
<parameter name="transport.vfs.FileURI">vfs:ftp://login:password#host/outgoing</parameter>
<parameter name="transport.vfs.ActionAfterProcess">DELETE</parameter>
<parameter name="transport.vfs.MoveAfterFailure">vfs:ftp://login:password#host/outgoing/error</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.FileNamePattern">.*\.csv</parameter>
<parameter name="transport.vfs.Locking">disable</parameter>```
You can set the following parameter.
transport.vfs.MaxRetryCount

OpenNMS implement script to get status of any service

I am trying to implement script(sh, py..) that will get mi True(Up) of False(Down) status if my installed app on nodes is up-to-date.
Before that, i tried to implement simple script found on net (https://wiki.opennms.org/wiki/SystemExecuteMonitor) just to see if script works.
OpenNMS is installed on Windows 10.
This is what i did so far:
In poller-configuration.xml
`<service name="Test" interval="300000" user-defined="false" status="on">
<parameter key="script" value="/etc/scripts/test.sh"/>
<parameter key="banner" value="OK"/>
<parameter key="retry" value="3"/>
<parameter key="timeout" value="3000"/>
<parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/>
<parameter key="ds-name" value="test"/>
</service>`
AND
`<monitor service="Test" class-name="org.opennms.netmgt.poller.monitors.SystemExecuteMonitor"/>`
In default-foreign-source.xml
`<detector name="Test" class="org.opennms.netmgt.poller.monitors.SystemExecuteMonitor">
<parameter key="script" value="/etc/scripts/test.sh"/>
<parameter key="banner" value="OK"/>
<parameter key="retry" value="3"/>
<parameter key="timeout" value="3000"/>
<parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/>
<parameter key="ds-name" value="test"/>
</detector>`
And this is what i am missing: snmpd.conf
I don't have that file in OpenNMS, so my question is where should i call that script to be executed and do i miss anything else to get this working?
Thnx!
In the meantime, i've implemented groovy script like this:
In poller-configuration.xml
<service name="MinGroovy" interval="300000" user-defined="true" status="on">
<parameter key="file-name" value="C:/OpenNMS/etc/scripts/MinimalGroovy.groovy"/>
<parameter key="bsf-engine" value="org.codehaus.groovy.bsf.GroovyEngine"/>
<parameter key="rrd-repository" value="/opt/opennms/share/rrd/response" />
</service>
AND
<monitor service="MinGroovy" class-name="org.opennms.netmgt.poller.monitors.BSFMonitor"/>
this is my groovy script:
#!/usr/bin/env groovy\
bsf_monitor.log("ERROR", "Starting MinimalGroovy.groovy", null);
filePath = "//netpath/output/temp.txt"
file = new File(filePath)
if (file.exists()){
return "OK";
}else{
return "NOK";
}
In groovy-starter.conf i added:
enter #lib for opennms
load ${opennms.home}/lib/*.jar
If i run script in groovy console, it works OK!
And this is the error i get in poller.log in OpenNMS:
ERROR [pool-9-thread-27] o.o.n.p.m.BSFMonitor: Starting MinimalGroovy.groovy
Any help?
Your service definition in the poller-configuration.xml looks suspicious to me:
<service name="MinGroovy" interval="300000" user-defined="true" status="on">
<parameter key="file-name" value="C:/OpenNMS/etc/scripts/MinimalGroovy.groovy"/>
<parameter key="bsf-engine" value="org.codehaus.groovy.bsf.GroovyEngine"/>
<parameter key="rrd-repository" value="/opt/opennms/share/rrd/response" />
</service>
The file name is located on "C:/..." whereas your rrd-repository is in "/opt/opennms". Do you have installed OpenNMS on Windows or Linux? The path to your groovy script in the service definition is from the OpenNMS process perspective.

Using OpenNMS to monitor SNMP, can't see MIB data

I have a MIB with oids and events. The device the MIB relates to is online. OpenNMS sees and gathers information about the interfaces on the appliance, as well as the linux variant it is running.
but it doesn't see the other oids (or I can't find/chart them).
The gui reports Polling Status (Managed) and Package (uti_p). The uti_p package is
<package name="uti_p">
<filter>IPADDR != '0.0.0.0'</filter>
<include-range begin="10.19.0.200" end="10.19.0.210" />
<rrd step="300">
<rra>RRA:AVERAGE:0.5:1:2016</rra>
<rra>RRA:AVERAGE:0.5:12:1488</rra>
<rra>RRA:AVERAGE:0.5:288:366</rra>
<rra>RRA:MAX:0.5:288:366</rra>
<rra>RRA:MIN:0.5:288:366</rra>
</rrd>
<service name="ICMP" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="2" />
<parameter key="timeout" value="3000" />
<parameter key="rrd-repository" value="/var/lib/opennms/rrd/response" />
<parameter key="rrd-base-name" value="icmp" />
<parameter key="ds-name" value="icmp" />
</service>
<service name="SNMP" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="2"/>
<parameter key="timeout" value="3000"/>
<parameter key="port" value="161"/>
<parameter key="oid" value=".1.3.6.1.4.1.nnnn"/>
</service>
<downtime interval="30000" begin="0" end="300000" />
<downtime interval="300000" begin="300000" end="43200000" />
<downtime interval="600000" begin="43200000" end="432000000" />
<downtime begin="432000000" delete="true" />
</package>
I have a collectd-configuration
<package name="uti_p">
<filter>IPADDR != '0.0.0.0'</filter>
<include-range begin="10.19.0.200" end="10.19.0.210"/>
<service name="SNMP" interval="30000" user-defined="false" status="on">
<parameter key="collection" value="HsmLan"/>
<parameter key="port" value="161"/>
<parameter key="retry" value="3"/>
<parameter key="timeout" value="3000"/>
<parameter key="thresholding-enabled" value="true"/>
</service>
</package>
The .../rrd/snmp/{node} directory does not show any collection of data for the various oids that I am looking for.
In response to comments:
$ snmpwalk -v 2c -c FIPS14023 10.19.0.204 iso.3.6.1.4.1.nnnn
...
iso.3.6.1.4.1.nnnn.1.1.10.0 = INTEGER: 29
iso.3.6.1.4.1.nnnn.1.1.11.0 = STRING: "29.0"
...
i.e., it returns the expected data from the MIB.
The Community set in OpenNMS is FIPS14023, and the automatic discovery process finds the node.
Node Hsm.204
Interface 10.19.0.204
Polling Status Managed
Polling Package uti_p
Monitor Class org.opennms.netmgt.poller.monitors.SnmpMonitor
Service Parameters
oid .1.3.6.1.4.1.nnnn
The Requisition name for the class of appliance is correct.
I just can find where the above String "29.0" is supposed to appear. As I understand it, the data should be collected into RRD db files, but the node Database IDs never show up in the /etc/opennms/rrdsnmp directory.
riw#riw-ubuntu-vbox:/etc/opennms/rrdsnmp$ ls
riw#riw-ubuntu-vbox:/etc/opennms/rrdsnmp$
Thank you!
I would debug the SNMP access as the following with assuming you have SNMP v2 setup:
Test access to SNMP agent from your OpenNMS server with snmpwalk -v 2c -c
OpenNMS associates SNMP community strings with the IP address. You can verify this in the Web UI in "Admin -> Configure OpenNMS -> Configure OpenNMS Community Names by IP Address" and use the "Lookup" field. It will show you which SNMP community is configured for your device and fix this if necessary.
Go to the node page and rescan the server and see if the "SNMP Attributes" fields with IP and physical interfaces get filled.
If Step 1 does not give you the full SNMP tree you have to fix your surrounding configuration, IP tables or SNMP agent configuration for views and community.
Is there a reason you are defining a different collection set "HsmLan" over the default collection for SNMP in collectd?
Be sure to include the collection service at the bottom of collectd-configuration.xml for HsmLan, ala:
<collector service="HsmLan" class-name="org.opennms.netmgt.collectd.SnmpCollector"/>
If there is, you need to define this "snmp-collection" in datacollection-config.xml and include collections via the tag which references collections named in xml files (that have OIDs, etc) in etc/datacollection/
The poller-configuration.xml you listed at the top has no bearing on data collection. It is for service polling.

Business Objects w/ Impala JDBC Driver

I am attempting to use the Impala JDBC driver when creating a new Universe. When I test the connection I am receiving the following error:
CS: Java Exception : java.lang.UnsupportedClassVersionError: Bad version number in .class file
I have modified the sbo file as follows:
<DataBase Active="Yes" Name="Generic JDBC datasource">
<JDBCDriver>
<!-- Uncomment and edit the following lines
to define java classes required by JDBC driver
<ClassPath>
<Path>your jar or class files directory</Path>
</ClassPath>
-->
<ClassPath><Path>C:\impala-jdbc-0.5-2\hive-jdbc-0.10.0-cdh4.2.0.jar</Path></ClassPath>
<Parameter Name="JDBC Class">org.apache.hive.jdbc.HiveDriver</Parameter>
<Parameter Name="URL Format">jdbc:hive2://$DATASOURCE$/;auth=noSasl</Parameter>
</JDBCDriver>
<Parameter Name="Family">Generic</Parameter>
<Parameter Name="SQL External File">jdbc</Parameter>
<Parameter Name="SQL Parameter File">jdbc</Parameter>
<Parameter Name="Description File">generic_jdbc</Parameter>
<Parameter Name="Driver Capabilities">Query</Parameter>
<Parameter Name="Transactional Available">No</Parameter>
<Parameter Name="Max Rows Available">No</Parameter>
<Parameter Name="Query TimeOut Available">No</Parameter>
<Parameter Name="Array Fetch Size">10</Parameter>
</DataBase>
The error message sounds like the class being used in the driver was compiled with a newer version of java than you are currently executing under (example, running Java 5, but driver was compiled with Java 6). Since you are creating the Universe, the version difference is most likely local to your machine.
To resolve this you have 2 options:
Upgrade the version of Java to at least the version used to compile
the driver
Use a previous version of the JDBC driver to match the version of java you are executing as.

H2 database console, how the setting -webAllowOthers works?

I'm starting H2 console from spring:
<spring:bean id="H2WebServer" class="org.h2.tools.Server"
scope="singleton" factory-method="createWebServer" init-method="start"
destroy-method="stop">
<spring:constructor-arg value="-web,-webAllowOthers,true,-webPort,8082" />
</spring:bean>
H2 version is 1.3.160
I do not want the console to be accesible from other computers in my network.
The documentation says to use setting webAllowOthers to allow/or not to other computers.
But if i set "-webAllowOthers,false", the console is still available in my local network.
I also checked .h2.server.properties file.
How should the setting work?
If you don't want to allow other computers, then remove the -webAllowOthers:
Like:
<spring:constructor-arg value="-web,-webPort,8082" />
else keep just the -webAllowOthers
<spring:constructor-arg value="-web,-webAllowOthers,-webPort,8082" />
If setting removed,
then it respondes with "Sorry, remote connections are disabled on this server".
You can always use firewall rules ;) iptables on linux and such.

Resources