Monitoring JBOSS EAP 6.1 with JMX - plugins

im trying to monitoring a jboss server with Nagios Plugin . This plugin is working to me with another versions of Jboss, but no with this.
I think that the problem is in the JMX connection and im trying to configure JMX to connect remotly by jconsole. My jboss version is Jboss-eap-6.1 and java version "1.7.0_79". I configured the next option:
-Djboss.bind.address.management=YOURSERVERIP
If i connect via http with my firefox, i can acces to the console by port 8080 with success.
Im reading that the jmx port is configured by default, but im not able to connect by Jconsole. I have try to connect by 2 ways:
service:jmx:rmi:///jndi/rmi://$hostname:9999/jmxrmi
service:jmx:remoting-jmx://:9999
I receive the same error with both ways.
Meanwhile, i read that i have to configure some parameters in the standalone.conf. I put some parameters like below:
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=<PORT>"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=<IP_ADDRESS>"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:../modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar -Xbootclasspath/p:../modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar -Xbootclasspath/p:../modules/org/apache/log4j/main/log4j-1.2.16.jar"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.logmanager"
With these configurations i received an error of logmanager. Im searching how to fix this error but all tests that i tried have been unsuccesfull..
The aim of all this is check a Jboss server with a nagios plugin. I try to use this plugin with other jboss versions and works right.. Im desesperate... Any ideas?
Im getting this error:
https://i.stack.imgur.com/9gJ0x.jpg

Related

How to connect to influxDB in version 2.0

After running influxd daemon when I try to start influx as in older version I'm not able to connect any CLI interface for DB.
Instead it is showing help commands.
Can anyone please help here
Connect to port 8086 of the machine you installed influx on, to communicate via the web based interface and play with queries in the Explore section.
Alternatively, you can interact via the CLI using the influx command only if you're on the same machine as the installation - those are the help commands you're seeing - there's no REPL style interaction in v2.
(Well, unless you build and install the Flux REPL available here - everything you do here you can also do via the Influx UI I mentioned above via a web session on port 8086.)

Stopping Wildfly Windows Service failed

as mentioned from the title i have a problem stopping the wildfly windows service.
When i tried to stop the wildfly service via the server manager - services window the status of the wildfly service doens't change to stop from stop pending. But wildfly isn't running anymore (my web service is not reachable and also the server log says that wildfly was successfully stopped). to start the service again i have to restart the windows server.
i've tested this with different scenarios:
Windows Server 2008 R2 Datacenter + Wildfly 9
Windwos Server 2012 Datacenter + Wildfly 10
Windows 7 + Wildfly 10
I also tried to make changes in the service.bat like Chris French mentioned on https://developer.jboss.org/thread/238135?tstart=0 but there is no change.
Interessting is that the problem doens't exists on any of the scenarios when i added the service without adding any deployments to wildfly (so just the blank server). What means that i am able to start and stop the wildfly service successfully from the server manager services window when the wildfly server is "blank" and without any changes (for e.g. in standalone.xml).
So i think the problem must be my java ee project which contains a web service and a simple persistent project to access different my sql databases. In the standalone.xml i just added the mysql driver and the databases and i do some edits in the interface section (ip adress changes).
Any Ideas? Do i have to made changes in different config files (for e.g. the service.bat) when im deploying something to wildfly?
Sorry for my english and thanks a lot!
When installing the WildFly service, make sure you have the following parameters specified:
In WildFly 8: /user <username> /password <password>
in WildFly 10: /jbossuser <username> /jbosspass <password>
In the services.bat the documentation reads:
/user: username for the shutdown command
/password: password for the shutdown command
According to my experience, without these parameters, WildFly will move to status "stopping", but will not stop.
That works for me:
1. Always run the CMD as admin first.
2. If your JBOSS_HOME environment is not set, get sure that you navigate to WildFly home directory before you execute the script.
For example: cd "C:\Program Files\wildfly
It's matter, because the service.bat takes your current dir (%CD%) as JBOSS_HOME, if it's not set.
3. You’ve to install the service with a special parameter. /controller
It’s important that you tell wildfly service on which port your wildfly admin console is running.
Take a look in standalone.xml, search for “management-http”, get sure that you use the same port in parameter.
Example: (Default port is 9990)
./bin/service/service.bat install /controller localhost:9990
Done. Now start the service and wait until you can reach the wildfly console page.
After try to stop or restart the service in service.msc or with service.bat (service.bat start/stop/restart).
I had similar issue but it turned out I needed a JAVA_HOME in standalone.conf.bat under bin folder. Simply uncomment the line that sets the JAVA_HOME variable and update its value with the desired path.
set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121"
Above solution worked for me.
I had the "stopping" problem, when JAVA_HOME was set directly in jboss_cli.bat, pointing to the older jdk version previously installed on my machine. Check jboss_cli.bat for correct path of JAVA_HOME or simply use the JAVA_HOME environment variable (you might have to delete set JAVA_HOME line in jboss_cli.bat).

Spring batch admin sample web app with command line arguments

I am trying to monitor the Spring Batch using Batch Admin Mbeans, by either jconsole or 'JBoss operations network'.
The sample application 'spring-batch-admin-sample-1.2.1.RELEASE.war' is deployed in Jboss EAP6.
But I don't know how to start the sample application with the usual command line options to expose the MBeanServer, as mentioned in reference doc' http://docs.spring.io/spring-batch-a...rence/jmx.html ' .
JBoss EAP 6 does not declare com.sun.management.jmxremote system properties by default, and according to the issue below, I can't start JBoss with com.sun.management.jmxremote properties in my standalone.conf file
https://issues.jboss.org/browse/AS7-1859
Any suggestions much appreciated.
I get around with it by the following,
The Mbeans are enabled in spring batch admin according to spring batch admin doc. So after deploying the 'spring-batch-admin-sample-1.2.1.RELEASE.war' in JBoss, we can get the details of MBeans as mentioned in here
And now i have extended the RHQ's generic JMX plugin to discover and list the spring batch admin metrics.

FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

Can you explain what this error is (and secondly why I am getting it)?
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
P.S. It may be related to Known Tomcat 6.0 and JDK 1.7.0_02 issues?, as I only started getting it after upgrading from JDK 1.7.0 to 1.7.0 update 2, with no other upgrades to other software.
I am running:
Eclipse Indigo 3.7
JDK 1.7.0_0u2 (JDK 7 update 2)
Tomcat 6.0
Windows 7
Apache HTTP Server (although not using it yet)
When I start Tomcat I started getting this error, but not all the time. Rebooting just now fixed it. Some mornings I come to work without a reboot and it fixes it even though it failed the day before. It's sporadic. To debug this I need to understand. Can you help explain it?
EDIT : I have two Tomcat servers, for two different projects, on the same port. The other (first) server is "stopped" but remains "synchronized", in case this matters. I've quickly tried changing all the ports up one (8080 to 8081) and the error reproduces. This may not be a proper test of changing ports, however.
EDIT 2: I just had this problem, and rebooting "fixed" the issue. The workstation was on all weekend and Tomcat worked on Friday and Eclipse was shutdown at the end of the day. I will keep taking notes like this as I run into it to remove guesswork.
EDIT 3: Today it gave me this error from an unrebooted system that worked yesterday, programs shut down yesterday and restarted today. I rebooted, and the error is gone. Most notably is that the error always occurs at 23% compilation. It hits 23%, waits a bit and this is when I know it won't succeed, and then popups a window. I'll capture what the window says next time. Then it gives the above error to the Console.
EDIT 4: I am running Windows 7 and Apache HTTP Server (although not using it yet). I'll add these to the list above.
EDIT 5: The popup window mentioned in edit #3 is (and note my Tomcat is named Server Tomcat v6.0 Server at localhost):
Problem Occurred
'Server Tomcat v6.0 Server at localhost' has encountered a problem.
Server Tomcat v6.0 Server at localhost failed to start.
OK << Details
Server Tomcat v6.0 Server at localhost failed to start.
EDIT 6: I just got a new problem, which is Cannot connect to VM com.sun.jdi.connect.TransportTimeoutException popup window error and the same main error that this question asks about in the Console window.
EDIT 7: Just restarting Eclipse, not rebooting the whole computer, solved the error this morning.
This error typically comes up when the necessary port is taken by another program.
You said that you have changed the HTTP connector port from 8080 to 8081 so the two Tomcats do not clash, but have you also changed the <Server port="..." in tomcat/conf/server.xml to be different between your Tomcats?
Are there any other connectors ports which may possibly clash?
Does your HOSTS file have an entry for localhost? Some other situations this error is seen in seem to have this as a problem resolution.
Make sure you have 127.0.0.1 localhost set in it...
(from this and this)
Encountered this. all I did was to kill all the java process(Task Manager) and run again. It worked!
Check whether your config string is okay:
Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
I just had this issue today, and in my case it was because there was an invisible character in the jpda config parameter.
To be precise, I had dos line endings in my setenv.sh file on tomcat, causing a carriage-return character right after 'dt_socket'
EDIT these lines in host file and it should work.
Host file usually located in C:\Windows\System32\drivers\etc\hosts
::1 localhost.localdomain localhost
127.0.0.1 localhost
I had the same problem because I set the following in Catalina.sh of my tomcat:
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999"
After removing it, my tomcat worked well.
Hope help you.
Encountered this issue and changing the debug port helped. For some reason, the debug port had to be greater than the app port.
Change control panel Java's option about proxy to "direct", change window's internet option to not use proxy and reboot. It worked for me.
This error mostly comes when we forcefully kill the weblogic server ("kill -9 process id"), so before restart kindly check all the ports status which weblogic using e.g. http port , DEBUG_PORT etc by using this command to see which whether this port is active or not.
netstat –an | grep
(Admin: 7001 or something, Managed server- 7002, 7003 etc)
eg: netstat –an | grep 7001
If it returns value then,
option 1: wait for some time, so that background process can release the port
option 2: execute stopweblogic.sh
Option 3: Bounce the server/host or restart the system.
My issue was resolved by option 2.
if your JVM Cli is: -agentlib:jdwp=transport=dt_socket,address=60000,server=n,suspend=n and JDK version is 7, change "server=n" to "server=y" will be OK.
In my project I had the same error, I restarted Tomcat and it worked, withtout killing the java process.
I set 127.0.0.1 localhost, and solve this problem.
I had the same problem in Catalina.sh of my tomcat for JPDA Options:
JPDA_OPTS="-agentlib:jdwp=transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND"
After removing JPDA option from my command to start the Tomcat server, I was able to start the server on local environment.
I was getting the same error when i switched to STS version 3.8.3
And imported my entire workspace to the new STS.
Apparently the "Boot Spring App" instance was defective. (i run from STS)
If this is your problem,
Simply create the Boot run configuration again.
In case you are working with environments or docker images you can really change /etc/host I recommend just changing the binding from star to 0.0.0.0.
So (basing on my case for instance) instead of:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
You would define it as:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005"

Connecting websphere 7 Using JConsole

Can someone help me for resolving the below issue with JConsole & Websphere&7
I was trying to connect to Websphere 7 using JConsole. However JConsole wasn't able to connect to Websphere 7.
I did following changes -
1) management.properties
com.sun.management.jmxremote.port=9999
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
2) set the management.properties file path in JVM generic arguments.
Regards,
SR
If you want the WebSphere MBeans this one works for me:
The key is to configure the classpath and the security properly.
in one line:
jconsole -J-Dwas.install.root=C:/was61 -J-Djava.ext.dirs=C:/was61/plugins;C:/was61/plugins/com.ibm.ws.security.crypto_6.1.0;C:/was61/lib;C:/was61/java/jre/lib/ext -J-Dcom.ibm.SSL.ConfigURL="file:../../properties/ssl.client.props" -J-Dcom.ibm.CORBA.ConfigURL="file:../../properties/sas.client.props" service:jmx:iiop://host:port/jndi/JMXConnector
where port = bootstrap port ex: (2809)
Be careful when setting the sas and the ssl props.
Robert
This answer in another question worked for me: How do you enable JMX in Websphere?
However, that only allows access to the Platform MBeans, not the WebSphere MBeans.