Ad Widget

Collapse

CPU count

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ReefShark
    Member
    • Dec 2005
    • 43

    #1

    CPU count

    My manager wants me to 'monitor' the number of CPU's in every system. I think I can write something for linux to extract that data from the system, but I am somewhat Windoze-challenged and have no idea how to pull it off on the W2K servers I put in Zabbix.

    Any help on this matter would be greatly appreciated.
  • Dave96
    Junior Member
    • Jan 2006
    • 21

    #2
    If you mean the amount of processes running, than there are built-in functions for that.

    Comment

    • selin
      Junior Member
      • Aug 2005
      • 26

      #3
      CPU # - Registry Entry

      If you read the following registry key and count the subkeys, you get the number of CPUs.

      HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\Cen tralProcessor

      The 0, 1, 2, 3...etc. represent the different processors. Now, without checking, this may represent the number of processors that the OS sees - not the physical number (ie. dual-core or hyperthreading may show different numbers). However, I am certain that if you check the Net, you can find a method to determine if the processor listed are physical or virtual.

      Reading the registry can be done easily with VBScript via WSH, WinBatch...

      Comment

      • cameronsto
        Senior Member
        • Oct 2005
        • 148

        #4
        This can also be achieved via WMI and VBS. Here's an example, http://vbnet.mvps.org/index.html?cod..._processor.htm

        -cameron

        Comment

        • ReefShark
          Member
          • Dec 2005
          • 43

          #5
          Got the linux clients working with
          Code:
          UserParameter=system.cpucount,grep processor /proc/cpuinfo | wc -l
          Still looking into the Windows stuff.... Is there any way to get the number of CPU's present through SNMP?

          Comment

          • Lane
            Junior Member
            • Apr 2009
            • 7

            #6
            CPU count

            On Windows clients use the key in a host item

            system.cpu.num[online]



            Description - Processor Count
            Type - Zabbix Agent
            Key - system.cpu.num[online]
            Type of information - Numeric (Integer 64bit)
            Units -
            Use multiplier - Do Not Use
            Update interval (in sec) - 3600

            Comment

            • nelsonab
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • Sep 2006
              • 1233

              #7
              Originally posted by ReefShark
              Got the linux clients working with
              Code:
              UserParameter=system.cpucount,grep processor /proc/cpuinfo | wc -l
              Still looking into the Windows stuff.... Is there any way to get the number of CPU's present through SNMP?
              As someone mentioned earlier that will give you the total number of cores, not physical CPU's
              RHCE, author of zbxapi
              Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
              Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

              Comment

              • alixen
                Senior Member
                • Apr 2006
                • 474

                #8
                Originally posted by nelsonab
                As someone mentioned earlier that will give you the total number of cores, not physical CPU's
                And for cores with hyperthreading enabled, each core is counted twice. New Intel CPUs (i7) are multicore AND hyperthreaded

                Hope this helps

                Alixen
                http://www.alixen.fr/zabbix.html

                Comment

                • speculatrix
                  Junior Member
                  • Jan 2018
                  • 7

                  #9
                  Originally posted by ReefShark
                  Got the linux clients working with
                  Code:
                  UserParameter=system.cpucount,grep processor /proc/cpuinfo | wc -l
                  Still looking into the Windows stuff.... Is there any way to get the number of CPU's present through SNMP?
                  a little more efficient:

                  UserParameter=system.cpucount,grep -c "^processor" /proc/cpuinfo

                  Comment

                  • aib
                    Senior Member
                    • Jan 2014
                    • 1615

                    #10
                    And now you can use Zabbix Agent key:
                    https://www.zabbix.com/documentation...zabbix_agent?s[]=system.cpu.num
                    system.cpu.num
                    Number of CPUs. Integer type - possible values:
                    online (default), max
                    Example:
                    ⇒ system.cpu.num
                    Sincerely yours,
                    Aleksey

                    Comment

                    Working...