Discussion:
how to use zendmd to show number of cores per cpu on a device?
David Sloboda
2012-01-24 18:49:46 UTC
Permalink
David Sloboda [http://community.zenoss.org/people/david_sloboda] created the discussion

"how to use zendmd to show number of cores per cpu on a device?"

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

--------------------------------------------------------------
Zenoss 3.2.1 on RHEL5
Is there a way to use zendmd to report on the number of cores each CPU has?

Thanks to http://community.zenoss.org/docs/DOC-4456 http://community.zenoss.org/docs/DOC-4456 "zendmd script to dump hardware and software info"
I can see the number of CPUs on the server.

The IRC chat logs seem to imply that Zenoss out of the box does not capture the number of cores per CPU.

[***@bby1ems05 ~]$ zendmd
...
d = find("kel-lx19")
cpu_count = 1
...     print "   #%s %s" % (cpu_count, c.getManufacturerName())
...     cpu_count = cpu_count + 1
...
   #1 AMD
   #2 AMD
   #3 AMD
   #4 AMD
   #5 AMD
   #6 AMD
   #7 AMD
   #8 AMD
[***@kel-lx19 ~]# grep -c ^processor /proc/cpuinfo
8
[***@kel-lx19 ~]#
[***@kel-lx19 ~]# grep cores /proc/cpuinfo
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
[***@kel-lx19 ~]#
--------------------------------------------------------------

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

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-01-25 01:38:35 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: how to use zendmd to show number of cores per cpu on a device?"

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

--------------------------------------------------------------
I'm not sure there is a direct path the data your looking for. I'm no SNMP expert, but I'm not sure SNMP exposes the number of cores natively, so you'd need to somehow expose that data (either update snmpd config or use SSH).

Additionally looking at the CPU class and there is no attribute for cores, so once you figured out how to collect the data you would then need a custom modeler that could build relationships between CPUs and Cores.

In theory its all possible, but i don't believe it would be a trivial undertaking.
--------------------------------------------------------------

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

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]
David Sloboda
2012-01-25 02:42:17 UTC
Permalink
David Sloboda [http://community.zenoss.org/people/david_sloboda] created the discussion

"Re: how to use zendmd to show number of cores per cpu on a device?"

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

--------------------------------------------------------------
Thanks for the reply. 

After posting, I reviewed
Understanding /proc/cpuinfo
  http://www.brandonhutchinson.com/Understanding_proc_cpuinfo.html http://www.brandonhutchinson.com/Understanding_proc_cpuinfo.html
and
Understanding Linux /proc/cpuinfo
   http://www.richweb.com/cpu_info http://www.richweb.com/cpu_info
and
  http://dag.wieers.com/blog/is-hyper-threading-enabled-on-a-linux-system http://dag.wieers.com/blog/is-hyper-threading-enabled-on-a-linux-system

It looks like the host I use in my example is reporting 8 virtual processors.
The host appears to have 4 physical processors. Each processor has two cores.
[***@kel-lx19 ~]# grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l
4
[***@kel-lx19 ~]# grep cores /proc/cpuinfo
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
[***@kel-lx19 ~]#

The number of virtual processors (8) is the value I want to track.

If it gets to the point where I need to spell out the difference, I plan to solve it this way:
1) for each value (number of physical processors, number of cores per processor, number of virtual processors), write a script that gathers the value from /proc/cpuinfo
2) store each value in a unique file
3) edit snmpd.conf to cat the file in response to a request for that OID.
4) store that value in Zenoss somewhere. 
  step (4) would give me the most trouble.


Thank you,
David
--------------------------------------------------------------

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

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...