1 Reply Latest reply on Jan 28, 2013 7:15 AM by ssilvert

    Is it possible to read a child attribute via CLI ?

    markboletti

      Dear JBoss users,

      I'm writing a small script which gets some KPI from the application server. I'd need to pickup some memory usage info which is contained in the heap-memory-usage attribute of the platform-mbean.

       

      [standalone@localhost:9999 /] /core-service=platform-mbean/type=memory:read-resource(include-runtime=true)

      {

          "outcome" => "success",

          "result" => {

              "heap-memory-usage" => {

                  "init" => 67108864L,

                  "used" => 22823600L,

                  "committed" => 65208320L,

                  "max" => 518979584L

              },

              "non-heap-memory-usage" => {

                  "init" => 35815424L,

                  "used" => 42499472L,

                  "committed" => 52985856L,

                  "max" => 325058560L

              },

              "object-pending-finalization-count" => 0,

              "verbose" => false

          }

      }

      How can I read a child attribute such as the "used" or "max", which are child of heap-memory-usage ?

      Thanks

      Max

        • 1. Re: Is it possible to read a child attribute via CLI ?
          ssilvert

          I think the closest you can get with a CLI command is

          /core-service=platform-mbean/type=memory/:read-attribute(name=heap-memory-usage)

          {

              "outcome" => "success",

              "result" => {

                  "init" => 67108864L,

                  "used" => 119206544L,

                  "committed" => 272367616L,

                  "max" => 477233152L

              }

          }

           

          The problem is that "heap-memory-usage" and "non-heap-memory-usage" are attributes of type ModelNode.Object.  If you want to write a script that pull out only "used" or "max" I think you wil need to use Advanced CLI scripting with Groovy, Rhino, Jython, etc.

           

          Stan

          1 of 1 people found this helpful