Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. CPU instance discovery

CPU instance discovery

Scheduled Pinned Locked Moved Support
7 Posts 5 Posters 42.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ?
    ?
    Legoman
    wrote on last edited by
    #1

    Hi,

    I considered this great product, thank you for the job.

    I try to add CPU usage on template and I would like to add a CPU usage per CPU with instance discovery (the same way I've done with disk usage and FileSystem.MountPoints). Is it possible ?

    Thank you.

    1 Reply Last reply
    0
    • A
      A
      Alex Kirhenshtein
      wrote on last edited by
      #2

      Yes, it's possible.

      Create script which query System.CPU.Count from the node and return indexes it as array (e.g. 4 cpu == [0, 1, 2, 3]), then use this script in instance discovery.

      1 Reply Last reply
      0
      • T
        T
        tomaskir
        wrote on last edited by
        #3

        Here is the script I use:

        cpuCount = AgentReadParameter($node, "System.CPU.Count");
        
        if (cpuCount == null || cpuCount == 1)
          return null;
        
        array cpuArray;
        
        for (i = 0; i < cpuCount; i++)
          cpuArray[i] = i;
        
        return cpuArray;
        
        1 Reply Last reply
        0
        • ?
          ?
          Legoman
          wrote on last edited by
          #4

          Excellent. It works ! Thank you.

          1 Reply Last reply
          0
          • R
            R
            rainerh
            wrote on last edited by
            #5

            Hello,

            I tried the script, but it does not work:

            Configuration like this:

            General:
              Description = Average CPU {instance} utilization for last Minute
              Data Parameter = System.CPU.Usage({instance})    from NetXMS Agent (Integer)

            Instance Discovery:
              Instance Discovery method = Script
              next line = System.CPU.Count
              Instance discovery filter script = your script

            Thank you
            Rainer

            1 Reply Last reply
            0
            • Z
              Z
              zsing82
              wrote on last edited by
              #6

              Create the script in the Script Library.

              Open the DCI in the template and go to Instance Discovery.
              Instance discovery method = Script
              Next line = name of script in Script Library
              Instance discovery filter script should be left blank.  Your script will be called from the Script Library as long you entered the script name in the line above.

              Force an instance discovery poll to see if it works.

              1 Reply Last reply
              0
              • R
                R
                rainerh
                wrote on last edited by
                #7

                Thank you, now the script and instance discovery works fine

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                Powered by NodeBB Contributors
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups