Ad Widget

Collapse

Problems with wmi.get

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bsteph
    Junior Member
    • Sep 2012
    • 15

    #1

    Problems with wmi.get

    I'm running zabbix 2.2.1 on both the server and the client. I'm trying to issue a wmi.get using the example from the documentation and getting zbx_notsupported errors. Here's what I'm trying from the server:

    zabbix_get -s windowserver -k wmi.get[root\cimv2,select * from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%',Status]

    Any ideas what I'm doing wrong???
  • dkanbier
    Junior Member
    Zabbix Certified Specialist
    • Jul 2013
    • 13

    #2
    Originally posted by bsteph
    I'm running zabbix 2.2.1 on both the server and the client. I'm trying to issue a wmi.get using the example from the documentation and getting zbx_notsupported errors. Here's what I'm trying from the server:

    zabbix_get -s windowserver -k wmi.get[root\cimv2,select * from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%',Status]

    Any ideas what I'm doing wrong???
    From what I understand from the documentation wmi.get takes 2 arguments separated by a comma, you seem to give 3.

    Comment

    • bsteph
      Junior Member
      • Sep 2012
      • 15

      #3
      other attempts

      I've also tried the following:

      zabbix_get -s windowserver -k wmi.get[root\cimv2,"select * from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%'"]
      ZBX_NOTSUPPORTED

      zabbix_get -s windowserver -k wmi.get["root\cimv2","select * from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%'"]
      ZBX_NOTSUPPORTED

      zabbix_get -s windowserver -k wmi.get["root\cimv2","select * from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%',Status"]
      ZBX_NOTSUPPORTED

      My end goal is to try and query individual app pool state

      Comment

      • steveboyson
        Senior Member
        • Jul 2013
        • 582

        #4
        "select *" may return several lines while zabbix expects only ONE result.

        Comment

        • melvin
          Junior Member
          • Sep 2013
          • 5

          #5
          Hello,

          Just create an item with:

          Type: zabbix agent
          Key:
          wmi.get[root\cimv2,select Status from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%']
          Type of information: Character

          This will not work with zabbix_get but it will work as an item.

          Comment

          • bsteph
            Junior Member
            • Sep 2012
            • 15

            #6
            Originally posted by melvin
            Hello,

            Just create an item with:

            Type: zabbix agent
            Key:
            wmi.get[root\cimv2,select Status from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%']
            Type of information: Character

            This will not work with zabbix_get but it will work as an item.
            I tried that too. Even cutting and pasting your example. Same results.

            Comment

            • melvin
              Junior Member
              • Sep 2013
              • 5

              #7
              That's strange. I have the same Zabbix server/client version and when i configure this, it works. I have tested this on Windows Server 2008 R2 and Windows 7 PRO.
              Have you tried to isolate this?
              -Different server/system
              -Check if other WMI queries work in Zabbix
              -Check with a vbs (or other way) (script) to see if you get results

              I can mail you the screens or my config files...

              Greets,
              Melvin
              Last edited by melvin; 15-01-2014, 18:28.

              Comment

              • bsteph
                Junior Member
                • Sep 2012
                • 15

                #8
                Originally posted by melvin
                That's strange. I have the same Zabbix server/client version and when i configure this, it works. I have tested this on Windows Server 2008 R2 and Windows 7 PRO.
                Have you tried to isolate this?
                -Different server/system
                -Check if other WMI queries work in Zabbix
                -Check with a vbs (or other way) (script) to see if you get results

                I can mail you the screens or my config files...

                Greets,
                Melvin
                This wmi query worked:
                zabbix_get -s Windowserver -k wmi.get["root\cimv2","SELECT * FROM Win32_LogicalDisk WHERE Size != Null AND DriveType >= 2"]

                I gave up and just wrote a powershell script and a usercheck.

                Comment

                • diego.leoratto
                  Junior Member
                  • Sep 2013
                  • 3

                  #9
                  My experience

                  Hello!

                  I would like to share my conclusions about this questions, after some tests...

                  To test with zabbix_get, use the sintax like this example:

                  $ zabbix_get -s 10.7.112.118 -k wmi.get["root\cimv2","SELECT Vendor FROM Win32_ComputerSystemProduct"]

                  You have to use the quotation marks.
                  The wmi.get key accepts only 2 arguments, as bsteph said.

                  To test in Zabbix Server front end:

                  As steveboyson said, don't use "SELECT *", create an item and try the sintax below with your arguments for SELECT clause:

                  wmi.get[root\CIMV2,SELECT Model FROM Win32_DiskDrive WHERE Name LIKE '%PHYSICALDRIVE0%']

                  Excuse my poor English, I expect it can be helpful.

                  Best regards.
                  Diego

                  Comment

                  Working...