0 Replies Latest reply on Jun 27, 2006 3:27 PM by sbz

    Trouble whith twiddle, using ckeck_jbossjmx ( jBoss check pl

    sbz

      Hello everyone

      I am a newb in jBoss, so i will try explain my trouble. And please, take easy whith me. I am not a deployer, i am a monitoring analist ;)

      i tryng to monitoring some MNeans, whith the jBoss nagios plugin, and it is ok.

      But one specific jBoss, i cant do it.

      Frist, i look at the script, and see the command line whith twiddle.

      I Learn some twiddle, annd get the follow error, in the LOCAL machine:




      [root@srv-m4u-l03 bin]# ./twiddle.sh -s localhost get "jboss.jca:name=NAME,service=ManagedConnectionPool" InUseConnectionCount
      15:54:43,574 ERROR [Twiddle] Exec failed
      org.jboss.util.NestedRuntimeException: Can't find property: java.naming.factory.initial; - nested throwable: (javax.naming.NoInitialContextException: Can't find property: java.naming.factory.initial)
       at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:137)
       at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:47)
       at org.jboss.console.twiddle.command.GetCommand.execute(GetCommand.java:137)
       at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:297)
      Caused by: javax.naming.NoInitialContextException: Can't find property: java.naming.factory.initial
       at javax.naming.spi.NamingManager.getInitialContext(libgcj.so.7)
       at javax.naming.InitialContext.getDefaultInitCtx(libgcj.so.7)
       at javax.naming.InitialContext.getURLOrDefaultInitCtx(libgcj.so.7)
       at javax.naming.InitialContext.lookup(libgcj.so.7)
       at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:244)
       at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:262)
       at org.jboss.console.twiddle.Twiddle.access$300(Twiddle.java:56)
       at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:138)
       ...3 more
      




      I read the Twiddle help, and fixed it , whith the command line:
      
      [root@srv-m4u-l03 bin]# ./twiddle.sh -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -s localhost get "jboss.jca:name=NAME,service=ManagedConnectionPool" InUseConnectionCount



      Everthingworks fine here.


      I get the insuconnection number

      But, when i do it in the remote nagios computer, i get the follow error:



      [root@inglaterra bin]# ./twiddle.sh -s IP HOST -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces get "jboss.jca:name=InfoServicesDS,service=ManagedConnectionPool" InUseConnectionCount
      16:17:42,907 ERROR [Twiddle] Exec failed
      org.jboss.util.NestedRuntimeException: - nested throwable: (javax.naming.CommunicationException [Root exception is java.rmi.NoSuchObjectException: no such object in table])
       at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:128)
       at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:47)
       at org.jboss.console.twiddle.command.GetCommand.execute(GetCommand.java:137)
       at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:290)
      Caused by: javax.naming.CommunicationException [Root exception is java.rmi.NoSuchObjectException: no such object in table]
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:235)
       at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:253)
       at org.jboss.console.twiddle.Twiddle.access$300(Twiddle.java:47)
       at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:124)
       ... 3 more
      Caused by: java.rmi.NoSuchObjectException: no such object in table
       at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
       at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
       at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
       at org.jnp.server.NamingServer_Stub.lookup(Ljavax.naming.Name;)Ljava.lang.Object;(Unknown Source)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
       ... 9 more
      


      Any hints?

      this is a 4.0.2 jboss.
      i ahve others monitors like this ones in 4.01 4.02 and 4.03RC1 Jboss
      Justin that i have trouble =(

      sorry about the bad english.

      The script of nagios plugins IS:

      #!/bin/sh
      ## JBoss Nagios Plugin
      ##
      export JBOSS_SERVER=$1
      export JBOSS_VERSION=$2
      export JBOSS_MBEAN=$3
      export JMX_ATTR=$4
      export WARN=$5
      export CRITICAL=$6

      #####################################################
      ## Configure these for your environment
      #####################################################
      export JBOSS4_HOME=/home/java/jboss-4.0.3SP1
      export JBOSS3_HOME=/home/jboss/jboss-3.2.7
      export JAVA_HOME=/home/java/jrockit-R26.3.0-jdk1.5.0_06
      #####################################################




      if [[ $1 = "--help" || $1 = "--h" || $1 = "-help" || $1 = "-h" ]]; then
      echo check_jbossjmx Usage
      echo "jbossJMX_plugin <JBoss Server URL> <JBoss Version 3|4> <JBoss MBean Object Name> <JBoss MBean Attribute> <Warn Threshhold> <Critical Threshhold>"
      exit 3
      fi

      if [ "$JBOSS_VERSION" = "3" ]; then
      export TWIDDLE=$JBOSS3_HOME/bin/twiddle.sh
      else
      if [ "$JBOSS_VERSION" = "4" ]; then
      export TWIDDLE=$JBOSS4_HOME/bin/twiddle.sh
      else
      echo "Unrecognized JBoss Version:" $JBOSS_VERSION
      exit 3
      fi
      fi

      export READING=`$TWIDDLE -s $JBOSS_SERVER get $JBOSS_MBEAN $JMX_ATTR | awk '{split($1,names,"="); print names[2]; }' `

      if [ $READING -ge $CRITICAL ]; then
      echo "JMX ATTRIBUTE CRITICAL" - $JBOSS_MBEAN-$JMX_ATTR:$READING
      exit 2
      else
      if [ $READING -ge $WARN ]; then
      echo "JMX ATTRIBUTE WARNING" - $JBOSS_MBEAN-$JMX_ATTR:$READING
      exit 1
      else
      echo "JMX ATTRIBUTE OK" - $JBOSS_MBEAN-$JMX_ATTR:$READING
      exit 0
      fi
      fi