Page 1 of 1

check_jmx error: JMX CRITICAL com.sun.enterprise.admin.util.

Posted: Tue Aug 08, 2017 6:13 am
by rohithroki
Dear Team,
I am trying to configure nagios monitroring for one of my java application and when i try to run the check_jmx plugin from the nagios server i am getting the below error.
Kindly let me know if i am missing anything here.Please find the command which i am executing from the nagios server.

I have copied the check_jmx and jmxquery.jar in the path /usr/local/nagios/libexec

./check_jmx -U service:jmx:rmi:///jndi/rmi://x.x.x.x:8686/jmxrmi -O com.itac.management:type=Servers,host=*,process=* -A UsedHeapSize -w 18000000000 -c 20000000000 -p B -username xxxx-password xxxx

regards,
RKJ

Re: check_jmx error: JMX CRITICAL com.sun.enterprise.admin.u

Posted: Tue Aug 08, 2017 8:21 am
by mcapra
Can you show us the specific error your are getting? A copy+paste of the command executed and it's corresponding output would be useful.

Can you also describe how JMX is configured in the remote application you are trying to monitor?

Re: check_jmx error: JMX CRITICAL com.sun.enterprise.admin.u

Posted: Tue Aug 08, 2017 4:16 pm
by dwhitfield
Thanks @mcapra!
rohithroki wrote:i am getting the below error.
Looks like it didn't come through.

Re: check_jmx error: JMX CRITICAL com.sun.enterprise.admin.u

Posted: Wed Aug 09, 2017 12:30 am
by rohithroki
apologies please find the error screenshot below

JMX CRITICAL com.sun.enterprise.admin.util.AdminLoginModule$PrincipalCallback

I have executed the below command
./check_jmx -U service:jmx:rmi:///jndi/rmi://x.x.x.x:8686/jmxrmi -O com.itac.management:type=Servers,host=*,process=* -A UsedHeapSize -w 18000000000 -c 20000000000 -p B -username xxxx-password xxxx

Also when i am executing below command getting the below error

./check_jmx -U service:jmx:rmi:///jndi/rmi://x.x.x.x:8686/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 4248302272 -c 5498760192 -username xxx -password xxxx
JMX CRITICAL Error unmarshaling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.sun.enterprise.admin.util.AdminLoginModule$PrincipalCallback connecting to java.lang:type=Memory by URL service:jmx:rmi:///jndi/rmi://10.179.83.80:8686/jmxrmijava.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.sun.enterprise.admin.util.AdminLoginModule$PrincipalCallback
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:245)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2366)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:310)
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.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.sun.enterprise.admin.util.AdminLoginModule$PrincipalCallback
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1357)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2016)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1940)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1806)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2016)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1940)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1806)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2016)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1940)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1806)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:243)
... 8 more
Caused by: java.io.NotSerializableException: com.sun.enterprise.admin.util.AdminLoginModule$PrincipalCallback
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)
at java.lang.Throwable.writeObject(Throwable.java:985)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)
at java.lang.Throwable.writeObject(Throwable.java:985)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:384)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Re: check_jmx error: JMX CRITICAL com.sun.enterprise.admin.u

Posted: Wed Aug 09, 2017 8:44 am
by mcapra
mcapra wrote: Can you also describe how JMX is configured in the remote application you are trying to monitor?
Please address the above.

This article might be useful:
https://blogs.oracle.com/quinn/jmx-moni ... sh-servers

Re: check_jmx error: JMX CRITICAL com.sun.enterprise.admin.u

Posted: Wed Aug 09, 2017 4:04 pm
by dwhitfield
rohithroki wrote:apologies please find the error screenshot below
Did you mean to attach a screenshot or is that just a typo regarding the error?

Also, please see @mcapra's question above.

Re: check_jmx error: JMX CRITICAL com.sun.enterprise.admin.u

Posted: Thu Aug 10, 2017 12:29 am
by rohithroki
@dwhitefield yes it was a a typo. i have pasted the error logs in the previous reply.
@mcapara i will check with application team on the same and update you the status.

Regards,

RKJ

Re: check_jmx error: JMX CRITICAL com.sun.enterprise.admin.u

Posted: Thu Aug 10, 2017 9:03 am
by mcapra
It's worth mentioning that if you're using the Glassfish JMX server rather than Java's native RMI, you may need to do some tinkering within the jmxquery.jar package. I don't have a Glassfish server to test against unfortunately; Perhaps I'll add one to my lab environment.

Can you also share where you got check_jmx from? There's many different iterations of that plugin from different maintainers.

Re: check_jmx error: JMX CRITICAL com.sun.enterprise.admin.u

Posted: Thu Aug 10, 2017 4:44 pm
by tmcdonald
Thanks for the assist, @mcapra! OP, let us know if you need further assistance.