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 - Instance discovery

Process - Instance discovery

Scheduled Pinned Locked Moved Support
11 Posts 3 Posters 133.4k 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.
  • T
    T
    Tursiops
    wrote on last edited by
    #2

    Create an ExternalList in your agent configuration:

    ExternalList = Phonalisa.Processes:ps axco command | grep phonalisa- | sort -u
    

    That should give you a list called "Phonalisa.Processes" on your agent, which you can then use in your Instance Discovery DCI.

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

      Thanks

      i am not able to handle these new list.
      I added these to netxmsd.config:

      # Log File
      LogFile=/var/log/nxagentd

      # IP white list, can contain multiple records separated by comma.
      # CIDR notation supported for subnets.
      MasterServers=10.10.__.__/32

      #ExternalList
      ExternalList=Phonalisa.Processes:ps axco command | grep phonalisa- | sort -u

      Then I restartet the Agent.
      I think that these will work fine, because a test of show agent suportet lists in info will result like this:

      Agent.ActionList
      Agent.SubAgentList
      ...
      Phonalisa.Processes
      ...
      System.IO.Devices
      System.ProcessList

      How can I use this?

      In "General" I set  Process.Count({instance})  at Parameter

      In Instance Discovery I select Agent List at discovery method
      and  Phonalisa.Processes  in List name

      What Have I to do in discovery filter script?

      When I do nothin only  75  will be returned  -I thin the total number of precesses

      Thank you very much
      Rainer

      1 Reply Last reply
      0
      • T
        T
        Tursiops
        wrote on last edited by
        #4

        There should be no need to use the instance discovery filter.
        I'm assuming Instance Discovery did run against the Agent?

        Setup under General should look something like the attached screenshot.

        Please confirm if the list contains the data you expect.
        Right-click on your agent, select "Execute server script" and run the following:

        processes = AgentReadList($node,"Phonelisa.Processes");
        if ( processes == null ) return "The list is empty!";
        foreach ( process : processes ) {
          println(process);
        }
        

        This should list all the processes it knows about. If it does, then that's not your problem.

        But if the above returns "The list is empty!", check that running the command that generates the list produces the expected output.
        It worked on my system when I tested it against other processes (I don't have any phonalisa ones), so there is a possibility the command doesn't work as expected on your system.
        As the user running the Agent, run the command that generates the list:

        ps axco command | grep phonalisa- | sort -u
        

        See if that actually produces the list of process names you expect.


        Capture.png

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

          the script works fine - here the result:

          phonalisa-callr
          phonalisa-ctid
          phonalisa-ctrld
          phonalisa-dbsrv
          phonalisa-ldapd
          phonalisa-logd
          phonalisa-msgd
          phonalisa-voipd

          *** FINISHED ***

          Result: (null)

          configuration like this:

          this results in:


          generlal.PNG

          InstanceDiscovery.PNG

          result.PNG

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

            I have found a little mistake.
            I forget the dot.
            But the same result.


            InstanceDiscovery.PNG

            1 Reply Last reply
            0
            • T
              T
              Tursiops
              wrote on last edited by
              #7

              The description should include the process names as per your list and you should end up with one DCI per list entry.
              Instead it appears the list returns "1" to your Instance Discovery DCI, hence your DCI returns 0, as there is no process called "1".
              Not sure what exactly is happening, I'll have to set the whole thing up at my end (not just the script) for comparison/testing.
              I'm assuming you're running the latest version of NetXMS?

              1 Reply Last reply
              0
              • V
                V
                Victor Kirhenshtein
                wrote on last edited by
                #8

                Hi,

                you have wrong discovery method - it should be "Script", not "Agent List" if you are using script from script library for discovery.

                Best regards,
                Victor

                1 Reply Last reply
                0
                • T
                  T
                  Tursiops
                  wrote on last edited by
                  #9

                  The script was only to check if the server gets the correct results back from the ExternalList command on the agent.
                  I'm guessing the ExternalList command is actually incorrect (I haven't used those on Linux yet, only Windows).

                  1 Reply Last reply
                  0
                  • V
                    V
                    Victor Kirhenshtein
                    wrote on last edited by
                    #10

                    Yes, my mistake - method is correct. Still seems to be a typo in list name: it is "Phonelisa.Processes" in script and "Phonalisa.Processes" in DCI configuration.

                    Best regards,
                    Victor

                    1 Reply Last reply
                    0
                    • T
                      T
                      Tursiops
                      wrote on last edited by
                      #11

                      Yep, the script had a typo. Oops. Was only for testing though, so should not affect the actual DCI.

                      I just set something similar up on a Ubuntu system here and I think the ExternalList needs an update:

                      ExternalList=Phonalisa.Processes:/bin/bash -c "ps axco command | grep phonalisa- | sort -u"
                      

                      Using that (i.e. with /bin/bash), it worked for me when I grepped for "imap" processes (returned imap and imap-login). Created two DCIs, one for each and returned the correct values.

                      Let me know if that works for you.

                      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