Ad Widget

Collapse

Discover installed software products - 'unsupported item key'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • acatic1
    Member
    • Oct 2019
    • 38

    #1

    Discover installed software products - 'unsupported item key'

    (searching 'zbx_notsupported' in Forums only gave me Russian results)



    I'm trying to collect an inventory of installed software from Windows clients.

    I started off of this effort: https://www.reddit.com/r/zabbix/comm...nventory_list/

    On the endpoint, I have agent 5.0.2.

    In its C:\Windows\Zabbix, I have a ps1 file containing:

    Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\Curre ntVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table -AutoSize > C:\Windows\Zabbix\InstalledProgramsList.txt

    In the same folder, I have a bat file containing:

    u/echo off del /s C:\Windows\Zabbix\*.txt >nul 2>null Powershell.exe -executionpolicy remotesigned -File C:\Windows\Zabbix\InstalledProgramsList.ps1 TYPE C:\Windows\Zabbix\InstalledProgramsList.txt

    In the agent's conf file, I have set the following:

    - AllowKey=system.run[*]

    - UnsafeUserParameters=1

    - UserParameter=Software.list[*],C:\Windows\Zabbix\InstalledProgramsList.bat

    I have restarted the Zabbix agent service.

    When I try testing it with .\zabbix_agentd -t Software.list[*], I get: Software.list[*] [m|ZBX_NOTSUPPORTED] [Unsupported item key.]

    Other (pre-built) active agent keys show up fine on the server, so I'd imagine the general agent config/connectivity is fine.

    What am I missing?

    I've been poring over my work time and again, and learning lots along the way. Thank you for all guidance.
  • isaqueprofeta
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Aug 2020
    • 154

    #2
    If you're not using parameters for your script, your key doesn't need to have "[*]", then try changing your agent line, removing it like this:

    - UserParameter=Software.list,C:\Windows\Zabbix\Inst alledProgramsList.bat

    Hope that helps.

    Comment

    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #3
      -t --test <item key> Test specified item and exit.
      Note: To return user parameter results as well, you must specify the configuration file (if it is not in the default location).

      Comment

      • acatic1
        Member
        • Oct 2019
        • 38

        #4
        We ended up totally doing away with the ps1 and bat files.

        In agent conf, set these lines:

        UnsafeUserParameters=1

        AllowKey=system.run[*]

        UserParameter=Software.list[*],powershell.exe -command foreach($item in (Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersi on\U ninstall")){ $item.getvalue('DisplayName') }

        ***[*] might not be needed for you. It wasn't needed for others, but it kept whining about "item does not allow parameters" whenever I'd remove it from agent and server.***

        Restart zabbix agent service.




        In Zabbix server, create active agent with following settings:

        - Type: Zabbix agent (active)

        - Key: Software.list[*] (again,[*] might not be needed for you, but whatever you do, make it same between agent and server)

        Type of information: Text

        Populates host inventory field: Software (Full details)

        Comment

        • dimir
          Zabbix developer
          • Apr 2011
          • 1080

          #5
          Beware of security issues: https://blog.zabbix.com/support-of-w...nt-side/11878/

          Comment

          Working...