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 Queries

WMI Queries

Scheduled Pinned Locked Moved Support
9 Posts 5 Posters 27.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.
  • T
    T
    toad
    wrote on last edited by
    #1

    I am impressed with Netxms, especially the fact the data is stored in SQL which allows for a simple to use data collector.

    A few days have been spent on getting SNMP queries to a MS-SQL 2005 system working when I found a webpage showing that Microsoft no longer support SNMP queries to SQL 2005 .... so that leaves WMI to perform the checks.

    I see that Netxms has a "Generic WMI Query" option within the agent, but I do not see any information on how to use this feature.

    Has anyone done WMI queries on SQL and/or other Windows performance settings? If so how is this done.

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

      Hello.

      You need to load "wmi" subagent (add "SubAgent = wmi.nsm" to your nxagentd.conf), this will add "WMI.Query()" parameter to the agent.
      This parameter takes two arguments: namespace and query string.

      Sample:

      nxget SERVER_IP '"WMI.Query('root\WMI', 'SELECT InstanceName,CurrentTemperature FROM MSAcpi_ThermalZoneTemperature')"
      

      I have no experience with querying MSSQL status using WMI, but according to google you can do something like this:

      nxget SERVER_IP "WMI.Query('root\Microsoft\SqlServer\ComputerManagement', 'SELECT State FROM SqlService')"
      
      1 Reply Last reply
      0
      • V
        V
        Victor Kirhenshtein
        wrote on last edited by
        #3

        Hi!

        Actually, WMI.Query(*) gets three parameters - namespace, query string, and property name. For example, to get CPU information, you can use the following parameter:

        WMI.Query(root\CIMV2,SELECT * FROM Win32_Processor,Name)
        

        Best regards,
        Victor

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

          can't get it to work =(

          nxget.exe 192.168.0.1 -a "none" -K "c:\netxms\var\server_key" "WMI.Query(root\CIMV2,SELECT * FROM Win32_Processor,Name)"

          or

          nxget.exe 192.168.0.1 -a none -K c:\netxms\var\server_key "WMI.Query('root\WMI', 'SELECT InstanceName,CurrentTemperature FROM MSAcpi_ThermalZoneTemperature')"

          always have:

          500: Internal error

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

            Is WMI service running? Is there any WMI-related messages in agent's log? Also, if start agent in debug mode (by adding -D switch), it will produce additional diagnostics.

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

              Thanks!

              Will test it today.

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

                WMI service at nodes has tested: all works fine.
                But still have Error 500.

                Can problem be with mismatched permissions? I mean can it be if "Local System" account haven't appropriate rights for querying to WMI interface?

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

                  question about nxget: is it something like SNMP GET?
                  and i can get only one value, but can't get the list?

                  looks like an SNMP commands: "get" and "walk".

                  is it possible to do "walk" with nxget.exe for query lists of available values form nodes?

                  Your test query: WMI.Query(root\CIMV2,SELECT * FROM Win32_Processor,Name) - it works for me! 馃槂

                  Please, need more information about syntax (root\CIMV2,SELECT * FROM Win32_Processor,Name馃槥 what is red-lighted parameter and how about other parameters?

                  I need to execute this queries, but i can't to do it (always have "500 internal error")

                  select DatabaseNodeMemory from Win32_PerfFormattedData_DNS_DNS
                  select DynamicUpdateQueued from Win32_PerfFormattedData_DNS_DNS
                  select TotalQueryReceived from Win32_PerfFormattedData_DNS_DNS
                  select TotalResponseSent from Win32_PerfFormattedData_DNS_DNS

                  1 Reply Last reply
                  0
                  • H
                    H
                    Luiz A. Camilo
                    wrote on last edited by
                    #9

                    I know that the post is old, But I just want to report what I found in case it helps someone else when searching on this f贸rum.
                    Please let me know if is there a better way to do this.

                    I found that Dell Servers have a particular way to interact with ACPI on this f贸rum : http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1307729003111+28353475&threadId=940582

                    So I made the following query using NetXMS agent :

                    WMI.Query(root\CIMV2\dell, SELECT * FROM CIM_TemperatureSensor where DeviceID=2, CurrentReading)

                    It works perfectly to me as the DeviceID 2 is the "BMC Ambient Temp Sensor" wich gives me better values (only 2 degrees of difference) like if the room temperature is around 25 Celcius, this sensor gives me the value of 270.

                    Also for those who want to explore WMI, I recommend 2 tools. One is Windows native called Wbemtest.exe (C:\windows\system32\wbem) and the other you have to download and is called "WMI Administrative Tools" http://www.microsoft.com/downloads/en/details.aspx?familyid=6430f853-1120-48db-8cc5-f2abdc3ed314

                    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