LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-15-2016, 06:03 AM   #1
archie_tolentino
LQ Newbie
 
Registered: Jan 2016
Posts: 1

Rep: Reputation: Disabled
check_jmx Connection refused error


Hi,

I'm adding check_jmx plugin in icinga2, but I'm not sure if my configurations are correct because I'm getting an error


root@cfe7a2eab147:/usr/lib/nagios/plugins# ./check_jmx -U service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 731847066 -c 1045495808 -username "username -password "passwd
JMX CRITICAL Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused connecting to java.lang:type=Memory by URL service:jmx:rmi:///jndi/rmi://lee:9999/jmxrmijava.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2404)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:308)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:268)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:227)
at org.nagios.JMXQuery.connect(JMXQuery.java:53)
at org.nagios.JMXQuery.main(JMXQuery.java:75)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:147)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 10 more

Here's my configurations for check_jmx

commands.conf


object CheckCommand "check_jmx" {
import "plugin-check-command"
command = [ PluginDir + "/check_jmx" ]
arguments = {
"-U" = "$service_url$"
"-O" = "$object_name$"
"-A" = "$attrib_name$"
"-K" = "$comp_key$"
"-w" = "$warn$"
"-c" = "$crit$"
"--username" = "username"
"--password" = "passwd"
}
}

service_jmx.conf


#apply service for jmx

apply Service "jmx" to Host {
import "generic-service"
check_command = "check_jmx"
vars.service_url = "service:jmx:rmi:///jndi/rmi://" + host.name + ":9999/jmxrmi"
vars.object_name = "java.lang:type=Memory"
vars.attrib_name = "HeapMemoryUsage"
vars.comp_key = "used"
vars.warn = "731847066"
vars.crit = "1045495808"

assign where host.vars.os == "Linux"
}

can someone help me to fix this error.

thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Oracle 11G error: listener refused the connection with the following error ora-12505 apss_evaluator Linux - Server 3 05-16-2012 05:34 AM
Connection refused error pgscannell Linux - Networking 1 01-05-2011 08:48 AM
Putty fatal error: Network error: connection refused (ubunty server 6.06.1) gerardnijboer Ubuntu 2 03-18-2010 03:46 PM
Connection refused error sweetyedwin Linux - Networking 1 07-15-2004 03:11 AM
Connection refused error robs4linux Linux - Networking 2 03-19-2002 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration