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. Process.Count returns 0 even EXE is running

Process.Count returns 0 even EXE is running

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 14.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.
  • S
    S
    Spheron
    wrote on last edited by
    #1

    Hello @all,

    we are running NetXMS at V6.2.5. We notice since the last versions, that process.count returns 0 even the checked EXE is running.

    Have anyone else this behaviour to?

    Greetings
    Marco

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

      Hi Marco,

      Yes, this is a bug in the Windows agent: https://github.com/netxms/netxms/issues/3656

      Process.Count never sees the most recently started process on the machine. So it returns 0 while your EXE is the newest running process, and goes back to 1 as soon as something else starts after it - that's why it looks random. It's not specific to 6.2, so downgrading won't help. Process.CountEx and the other Process.* metrics have the same problem.

      Until it's fixed: if the process runs as a service, monitor the service instead (service name, not display name; 0 means running):

      System.ServiceState(ServiceName)
      

      Otherwise, with the WMI subagent loaded (SubAgent = wmi.nsm in nxagentd.conf), this returns the real count:

      WMI.Query(root\cimv2,"SELECT ProcessId FROM Win32_Process WHERE Name='yourapp.exe'",%%count%%)
      
      1 Reply Last reply
      0
      • S
        S
        Spheron
        wrote on last edited by
        #3

        Hi Alex,

        thanks for the infos. The checked EXE is unfortunately not a service. So i give the WMI thing a try...

        Do you patch this in the V6.2.6 ?

        Greetings
        Marco

        PS: As allways: Great Support... Many thanks...  ;D

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

          Yes, it's already fixed in the code and will be in 6.2.6, which isn't released yet: https://github.com/netxms/netxms/issues/3656. Only the agent on the Windows machine needs to be updated.

          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