Discussion:
ZenJMX + Per JVM CPU Usage
dpetzel
2012-04-25 21:12:24 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"ZenJMX + Per JVM CPU Usage"

To view the discussion, visit: http://community.zenoss.org/message/66077#66077

--------------------------------------------------------------
Out of curiosity is anyone graphing Per JVM CPU usage using data available from the JVM via ZenJMX. I know this data is also possible from the OSProcess template, but in our environment that has proven to be really unreliable (On Windows At Least). So for the sake of this discussion I'm not looking for "here ishow to fix OSProcess monitoring", but more spefically I'm looking for "here is how we trend CPU usage per JVM using native JVM stats". In essence we are talking about graphing what is displayed over jconsole during an interactive JMX session.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/66077#66077]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jplouis
2012-04-25 22:23:56 UTC
Permalink
jplouis [http://community.zenoss.org/people/jplouis] created the discussion

"Re: ZenJMX + Per JVM CPU Usage"

To view the discussion, visit: http://community.zenoss.org/message/66064#66064

--------------------------------------------------------------
Short on time but can you create a datasource with the object name set to "java.lang:type=OperatingSystem" and name a data point "ProcessCpuTime"?  That might work.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/66064#66064]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2012-04-25 23:30:45 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: ZenJMX + Per JVM CPU Usage"

To view the discussion, visit: http://community.zenoss.org/message/66078#66078

--------------------------------------------------------------
getRuntimeMXBean().getUptime() / (getOperatingSystemMXBean().getProcessCpuTime() * 10000 * getOperatingSystemMXBean()).getAvailableProcessors())
So we already trend uptime, but we don't trend the other two datapoints. While its certainly possible, we monitor a large number of JVMs, so adding these data sources that we otherwise don't care about causes us to consume disk space that we other wise don't need to. Its obviously not the end of the world, but I'm curious if any one else is doing it, and if so how they are doing it.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/66078#66078]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2012-05-01 16:44:08 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: ZenJMX + Per JVM CPU Usage"

To view the discussion, visit: http://community.zenoss.org/message/66179#66179

--------------------------------------------------------------
Was able to get this working as follows in case anyone else is interested. You can can call your DataSources whatever you want, I provided names simply to illustrate the example. DataPoint names have to be entered exactly as shown.


- Add a New DataSource "AvailableProcessors" of Type JMX
          - Attribute Name = AvailableProcessors
          - Object Name = "java.lang:type=OperatingSystem"
          - Add a new DataPoint named AvailableProcessors
                    - Type = Gauge
                    - RRD Minimum = 0

- Add a New DataSource "ProcessCpuTime"          of type JMX
          - Attribute Name = ProcessCpuTime
          - Object Name = "java.lang:type=OperatingSystem"
          - Add a new DataPoint named ProcessCpuTime
                    - Type = Derive
                    - RRD Minimum = 0


- Add a New DataSource "UptimeDerive"          of type JMX
          - Attribute Name = Uptime
          - Object Name = "java.lang:type=Runtime"
          - Add a new DataPoint named ProcessCpuTime
                    - Type = Derive
                    - RRD Minimum = 0



- Create a Graph Defintion named "JMX CPU Usage" (or whatever you want to call it). The data points should be added in the order listed
          - Set Min Y = 0
          - Set Max Y = 100
          - Set Units = "percentage"
          - Add Datapoint AvailableProcessors_AvailableProcessors
                    - Name = AvailableProcessors
                    - Set Line Type to NOT Drawn
          - Add Datapoint UptimeDerive_Uptime
                    - Name = UptimeDerive
                    - Set Line Type to NOT Drawn
                    - Set the RPN to "10000,*,AvailableProcessors,*"
          - Add Datapoint ProcessCpuTime_ProcessCpuTime
                    - Name = "CPU Usage"
                    - Set Line Type = Line
                    - Set RPN = "UptimeDerive,/"
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/66179#66179]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...