How do I configure opennms to monitor a specific service/process that is not defined out of the box in opennms? - opennms

There is no class defined corresponding to that service in opennms. The service is running on a remote host. The current protocols supported out of the box are:
Citrix
DHCP
DNS
Domino IIOP
FTP
HTTP
HTTPS
ICMP
IMAP
JBOSS
JDBC
JDBC Stored Procedure
JSR160
K5
LDAP
Microsoft Exchange
MX4J
Notes HTTP
NSClient (Nagios Agent)
NRPE (Nagios Remote Plugin Executor)
NTP
POP3
Radius
SMB
SMTP
SNMP
SSH
TCP
Is there a way to detect a service not in this list?

Adding the detector to the provisioning group will get the port listed as a service on a nodes particular interface. But to get it "monitored" you also need to add a matching poller. Here is a sample for generic DNS port 53 test.
provision group detector within the detectors section or via UI as Pete indicated:
<detector name="TCP-DNS-53" class="org.opennms.netmgt.provision.detector.simple.TcpDetector">
<parameter key="port" value="53"/>
</detector>
Matching poller-configuration.xml to get it monitored. i.e. events if the node stops responding to the port.
<!-- within the services section -->
<service name="TCP-DNS-53" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="3"/>
<parameter key="timeout" value="3000"/>
<parameter key="port" value="53"/>
<parameter key="banner" value="*"/>
</service>
Then a monitor definition near the bottom.
<monitor service="TCP-DNS-53" class-name="org.opennms.netmgt.poller.monitors.TcpMonitor"/>
The detector, service names and monitor service all have to be identical.

"Admin" -> "Node provisioning" -> "Manage Provisioning Requisitions" -> "Edit Default Foreign Source Definition" -> "Add detector" -> give it a name, select TCP -> "add parameter" -> "key": port, "value": port_used_by_service
You can check OpenNMS documentation (there's an example adding Telnet):
http://www.opennms.org/wiki/Provisiond

Related

Issue with socket connecting protocol net.tcp via WCF

I had came across this scenario's for all the below use cases.
Except Case 3 which is normal & general and rest of the cases needs to be resolved
These below Services were running without any errors:
Net.Msmq Listener Adapter
Net.Pipe Listener Adapter
Net.Tcp Listener Adapter
Net.Tcp Port Sharing Service
Windows Process Activation Service
also Enabled Protocols: net.tcp,http
From the command line or via application when calling WCF written services:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools>svcutil net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex
Case 1:
Could not connect to
net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex. The
connection attempt lasted for a time span of 00:00:04.0935290. TCP
error code 10061: No connection could be made because the target
machine actively refused it 127.0.0.1:808.
No connection could be made because the target machine actively refused it 127.0.0.1:808
Case 2:
There was no endpoint listening at
net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex that
could accept the message. This is often caused by an incorrect address
or SOAP action. See InnerException, if present, for more details.
Case 3:
The socket connection was aborted. This could be caused by an error
processing your message or a receive timeout being exceeded by the
remote host, or an underlying network resource issue. Local socket
timeout was '00:04:59.9843875'.
An existing connection was forcibly closed by the remote host
Event Log for Case 2:
An error occurred in the Activation Service 'NetTcpActivator' of the protocol 'net.tcp' while trying to listen for the site '1', thus the protocol is disabled for the site temporarily. See the exception message for more details.
URL: WeakWildcard:net.tcp://username.domainname.com/
Status: FailedToListen
Exception: System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:808. This could happen if there is another application already listening on this endpoint or if you have multiple service endpoints in your service host with the same IP endpoint but with incompatible binding configurations. ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at System.ServiceModel.Channels.SocketConnectionListener.Listen()
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.SocketConnectionListener.Listen()
at System.ServiceModel.Activation.TransportListener.Go(IConnectionListener connectionListener)
at System.ServiceModel.Activation.TransportListener..ctor(IPEndPoint endPoint)
at System.ServiceModel.Activation.TransportListener.Listen(IPEndPoint endPoint)
at System.ServiceModel.Activation.RoutingTable.TcpStart(MessageQueue messageQueue, BaseUriWithWildcard path)
at System.ServiceModel.Activation.MessageQueue.Register(BaseUriWithWildcard path)
at System.ServiceModel.Activation.ListenerAdapter.RegisterBindings(IActivatedMessageQueue queue, Int32 siteId, String[] bindings, String path)
Process Name: SMSvcHost
Process ID: 4608
How should we need to achieve to go to case 3 by default, whenever, at times such as Booting and rebooting the system?
Case 1 and Case 2 require a Mex service endpoint in the WCF service configuration. Please add a Mex endpoint to exchange the service metadata.
<system.serviceModel>
<services>
<service name="WcfService1.Service1">
<endpoint address="service1" binding="basicHttpBinding" contract="WcfService1.IService1" ></endpoint>
<endpoint address="service2" binding="netTcpBinding" contract="WcfService1.IService1"></endpoint>
<!--for exchanging service metadata.-->
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"></endpoint>
</service>
</services>
Feel free to let me know if there is anything I can help with.

Apache Ignite cluster with a single public IP

I have deployed cluster of two Ignite 2.5.0 servers on two hosts (OpenStack cloud). They see each other using ipFinder TcpDiscoveryMulticastIpFinder (Topology snapshot [ver=14, servers=2, clients=0, CPUs=2, ...). Only one host has a public IP (floating IP), let's call it A, the other has only private IP, B, accessible from host A only. In my client (Eclipse IDE), in the config, I have set the public IP of A to connect to with TcpDiscoveryVmIpFinder.addresses. (In the config of A, public and private IPs in addressResolver and localAddress are correctly set).
When sending a broadcast() to this cluster, nothing happens for minutes. Killing B, broadcast works (on A).
How can I access "private" compute nodes of the cluster from a client outside? I saw signs of a "router" (bin/igniterouter.sh, config/router/default-router.xml) - maybe deprecated?, but not much info on how to use it, or any other way to solve this problem.
Ignite client node is a regular node, but without storage(well, it can, for example if it has near cache or local cache). So like a server node it must be able to communicate with all nodes in the cluster.
So you need to make the whole cluster to be accessible to your client or use thin client:
https://apacheignite.readme.io/docs/java-thin-client
Unfortunately, it doesn't support compute API yet, only cache operations and SQL can be used.
Not the solution but a workaround with a proxy could be to install "haproxy" on public host A with lines:
listen l47501
bind :47501
mode tcp
server worker1 192.168.0.224:47500
listen l47101
bind :47101
mode tcp
server worker1 192.168.0.224:47100
in /etc/haproxy/haproxy.cfg, where 192.168.0.224 is B's private IP (named worker1). It connects A's ports' 47501 and 47101 to B's 47500 and 47100.
In B's ignite config (config/default-config.xml) set addressResolver for both discoverySpi (47500, see below) and communicationSpi (47100, not shown):
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="localAddress" value="192.168.0.224"/>
<property name="addressResolver">
<bean class="org.apache.ignite.configuration.BasicAddressResolver">
<constructor-arg><map>
<entry key="192.168.0.224:47500" value="193.x.x.x:47501"/>
where 193.x.x.x is the public IP of A. (You have to open firewall for ingress tcp ports 47501 and 47101 on A.)
Broadcast "helloworld" worked on A and B from my IDE.

not able to make a call on extension using external sip profile

I have just installed freeswitch on my system.Right now i am able to register sample extension(s) with external sip profiles
for example :
1000#x.x.x.x:5080
1001#x.x.x.x:5080
now i am dialing 1001 from extension 1000 then freeswitch console its showing me user not registered but i am already registered with 1001 extension.
As per my knowledge when i am dial 1001 then its try to call on internal profile that's why its showing user is not registered but from which place i have to change like call goes on my 1001 extension
any suggestions ? any ideas ?
Thanks in advance.
You can configure sip gateway.
Configuring a sip gateway allows you to connect with outside carriers or other SIP machines.
Gateways are associated with SIP profiles because FreeSWITCH needs to know which IP and port to send traffic to and from in relation to the carrier.
First, you'll need to add a gateway to your SIP profile. Let's assume you're using the default FreeSWITCH configuration. In this case, we'll create a gateway that is attached to the default external profile.
Create a file in the conf/sip_profiles/external/ directory named after your gateway
Add the following content (note that even if you are not registering, a username and password is required) but replace the highlighted items with your own provider:
<gateway name="providerA">
<param name="realm" value="sip.domain.com"/>
<param name="username" value="testuser"/>
<param name="password" value="test"/>
<param name="register" value="true"/>
</gateway>
You will access the gateway by using the bridge application with sofia/gateway/
providerA/number , such as sofia/gateway/providerA/4158867999 . You
can do this in any dialplan you are using. In this example, edit your dialplan (typically
the default dialplan in conf/dialplan/default.xml ) and add code to utilize
the gateway:
action application="bridge" data="sofia/gateway/providerA/$1"
Issue a reloadxml command in your FreeSWITCH CLI after making the
mentioned changes.

Exposing Web API in Service Fabric

I'm having trouble accessing my Web Api that has been deployed to my Service Fabric cluster. I've followed the new Stateless Web Api template and have added the http endpoint seen below. I also made modifications that to the OwinCommunication as depicted here.
<Resources>
<Endpoints>
<Endpoint Name="ServiceEndpoint" Type="Input" Protocol="http" Port="8080" />
</Endpoints>
</Resources>
When creating my cluster I added a custom endpoint of 80 to my Node Type.
The client connection endpoint to my cluster is: mycluster.eastus.cloudapp.azure.com:19000
Also, I have a load balancing rule that maps port 80 to backend port 8080 over TCP. The probe associated is on port 80, and I have tried both protocols (http and tcp), but neither seem to work.
Locally, I can access an endpoint on my Web Api by calling http://localhost:8080/health/ping, and get back "pong". When I attempt to access it in service fabric cluster, a file is downloaded. The URL I use to access it in the cloud is http://mycluster.eastus.cloudapp.azure.com:19000/health/ping. I've tried other ports (19080, 80, 8080) but they either hang or give me a 400.
My questions regarding exposing a Web Api in a service fabric cluster are:
Should the probe be http or tcp?
Should the probe backend port be set to the web api port (e.g. 8080)?
Is my URL/port correct for accessing my api?
Why is a binary file being downloaded? This happens in all browsers, and the content being displayed in postman and fiddler.
Found the answer to my question after a number of heuristics. If my Web Api endpoint is set to port 8080 then I need the following:
Probe for port 8080 on TCP
A load balancing rule with port 80 and backend port 8080
Access the Web Api over the following URL: http://mycluster.eastus.cloudapp.azure.com/health/ping
As for #4, this is still a mystery.
http://mycluster.eastus.cloudapp.azure.com:19000/health/ping
This is wrong.
It should be http://mycluster.eastus.cloudapp.azure.com:8080/health/ping
At least this what the documentation says. So it should work without touching the load balancer.

Spring integration - TCP connection client side - Host/Port obtained from message

I know it is a similar problem to:
Spring Integration. Unknown host and tcp-connection-factory
However, in my particular case the tcp-connection is established based on the si message flow. I am writing a program that "fakes" a user login to a particular site through tcp/ip connection. The host/port changes weekly so I prefer to dynamically set-up the connections. Hence, those host/ip for the destination server is not static.
I am still wondering whether there is any methods other than the [dynamic ftp sample] which set-up a whole new applicationContext for each tcp/ip connection and modifying the connection-factory which is non-trivial work.
My ideal case is:
<int-ip:tcp-outbound-gateway id="outGateway"
request-channel="input"
reply-channel="clientBytes2StringChannel"
connection-factory="client"
connection-host="#{headers.dest.host}"
connection-port="#{headers.dest.port}"
request-timeout="10000"
reply-timeout="10000"/>
<int-ip:tcp-connection-factory id="client"
type="client"
host="#{headers.dest.host}"
port="#{headers.dest.port}"
single-use="true"
so-timeout="10000"/>
Where the destination host and port is inside the message header.
I know my use-case is rare but it's extremely useful in my particular business logic. My whole webapp runs based on the messages from those raw tcp-ip connections.
It's not currently possible/easy - even if you customize or extend the class for tcp-connection-factory to be able to connect to changing hosts. There is an open new feature request in JIRA to provide that functionality. Simillar question here.

Resources