Ad Widget

Collapse

Zabbix aggent testing an item with comma in parameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aleksander237
    Junior Member
    • Apr 2022
    • 13

    #1

    Zabbix aggent testing an item with comma in parameter

    Hello,

    i'm trying to test some items under windows 10. This works:

    zabbix_agent2.exe -t wmi.getall[root\cimv2,"select Name from win32_networkadapter where PhysicalAdapter=True and NetConnectionStatus>0"]

    this does not:

    zabbix_agent2.exe -t wmi.getall[root\cimv2,"select Name, Description from win32_networkadapter where PhysicalAdapter=True and NetConnectionStatus>0"]

    the second command gives me the error "Invalid number of parameters". I'm assuming that the problem lies in comma used in query.

    How do you escape commas ?

    Best regards,
    Aleksander
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #2
    Hi. The key looks good. Try to test it from Zabbix GUI by Test button on the item configuration page.
    I suppose this is a problem of the shell.

    Comment

    • aleksander237
      Junior Member
      • Apr 2022
      • 13

      #3
      Hello, the key is for sure good as this the modified zabbix's original key for item "Windows: Network interfaces WMI get". So i know it works, but I want to test more wmi queries and i don't want to use zabbix gui all the time. I want to test it locally on machine with zabbix agent. There must be (should be) way to escape these commas in the query (parameter). I've already checked backslashes, and other magic tricks. The official documentation does not help.
      Last edited by aleksander237; 17-11-2023, 12:34.

      Comment

      Working...