Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-2459

Extend wmi.get functionality to query properties of type array

XMLWordPrintable

    • Icon: New Feature Request New Feature Request
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • None
    • Agent (G)

      I need to monitor SmartArray HDDs of old server HP DL360 G5. ILO2 of the server doesn't support SNMP (agentless SNMP) and HP system software for Windows on the server doesn't support monitoring of HDDs via SNMP, therefore I have to use HP WBEM Provider for Windows and WMI to get info about SmartArray disk drives.
      Fortunately Zabbix supports WMI and I gaily execute on zabbix server:
      zabbix_get -s winhost -k "wmi.get[root\hpq,Select OperationalStatus from HPSA_DiskDrive where ElementName='Port:2I Box:1 Bay:5']" and ...
      get ZBX_NOTSUPPORTED!

      According to MS note (http://msdn.microsoft.com/en-us/library/aa392902(v=vs.85).aspx) "WQL does not support queries of array datatypes" therefore some programming logic is requirred to access the arrays queried with WQL. And HPSA_DiskDrive.OperationalStatus is just a property of type array of strings.
      As mentioned above, WQL doesn't allow query like "Select OperationalStatus[0] from HPSA_DiskDrive" and usually arrays queried with WQL processed with something like "for each" loop. Such technique is not available in Zabbix wmi.get.

      So, the feature request:
      Please add third parameter to wmi.get - index of element in an array:
      wmi.get[<namespace>,<query>,<index>]
      <namespace> - WMI namespace
      <query> - WMI query returning a single object
      <index> - index of element if <query> returns object of type array (default value is 0)

      Similar functionality is realized in powershell - http://technet.microsoft.com/en-us/library/ff405671.aspx

      IMHO, such improvement will be usefull in many WMI cases not only in my one because property of type array is an ordinary thing amongst WBEM classes.

            Unassigned Unassigned
            v99glu v99glu
            Votes:
            8 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: