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. WMI Query filtering

WMI Query filtering

Scheduled Pinned Locked Moved Support
9 Posts 3 Posters 47.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.
  • L
    L
    LeapfrogIT
    wrote on last edited by
    #1

    Is it possible to use more complex wmi queries ad DCI's ?

    For example something like

     WMI.Query(root\CIMV2,select * FROM Win32_Service WHERE Name = 'ApacheTomcatApplicationServer',status)

    Thankyou to any assistance some can provide

    kindest regards

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

      Hi!

      Yes, it shoulod be possible. WMI subagent will accept any valid WMI queries.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • L
        L
        LeapfrogIT
        wrote on last edited by
        #3

        excellent 🙂 that certainly opens up the queries I can run.

         Now I know that I can go back degugging my WQL queries themselfs will add them to Toads Pinned list once I have a decent number of queries made up. Like with most of these things it will probably be the first querie that takes some time afterthat I should be able to duplicate the priciples nice and easly 🙂

        1 Reply Last reply
        0
        • L
          L
          LeapfrogIT
          wrote on last edited by
          #4

          Sorry to be a bother , but I am really having a hard time getting this to work for me

           As an example , I am trying to run

          WMI.Query(root\CIMV2,select * FROM Win32_Service WHERE Name = 'WsusService', Status)

           When I use scriptomatic or WMI Query tester it works fine giving the resullt that I expect  however Netxms Console tells me that it's an unsupported DCI , and when I try and run it via nxget i get an internal server 500 error .

           Could this possibly be an extention of the current WMI.nsm bug for 2.22 ?  I was seing similar signs happening when I first installed 2.22 without upgrading the wmi part of the agent to the 2.23 rc release

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

            Hi!

            You should enclose query string in double quotes, because otherwise NetXMS agent incorrectly interprets single quotes within query. Correct syntax for parameter will be following:

            WMI.Query(root\CIMV2,"select * FROM Win32_Service WHERE Name = 'WsusService'", Status)

            Best regards,
            Victor

            1 Reply Last reply
            0
            • L
              L
              LeapfrogIT
              wrote on last edited by
              #6

              That worked perfectly thankyou victor 🙂

              1 Reply Last reply
              0
              • A
                A
                Anth0ny
                wrote on last edited by
                #7

                How can i use it at command prompt (for testing purposes)?

                Is it right?

                nxget host_ip WMI.Query(root\CIMV2,"select * FROM Win32_Service WHERE Name = 'WsusService'", Status)

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

                  Correct command line on Windows:

                  nxget host_ip "WMI.Query(root\CIMV2,\"select * FROM Win32_Service WHERE Name = 'WsusService'\", Status)"

                  on UNIX:
                  nxget host_ip "WMI.Query(root\\CIMV2,\"select * FROM Win32_Service WHERE Name = 'WsusService'\", Status)"

                  Best regards,
                  Victor

                  1 Reply Last reply
                  0
                  • A
                    A
                    Anth0ny
                    wrote on last edited by
                    #9

                    Victor, thanks! 😃

                    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