Ad Widget

Collapse

Problem with UserParameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BartTechne
    Junior Member
    • Jan 2019
    • 15

    #1

    Problem with UserParameter

    I have this in my conf file: (agentd)


    ### Option: UserParameter
    # User-defined parameter to monitor. There can be several user-defined parameters.
    # Format: UserParameter=<key>,<shell command>
    #
    # Mandatory: no
    # Default:
    # UserParameter=

    UserParameter=mssql.db.discovery,powershell -NoProfile -ExecutionPolicy Bypass -File "C:\zabbix\scripts\mssql_basename.ps1"
    UserParameter=mssql.version,powershell -NoProfile -ExecutionPolicy Bypass -File "C:\zabbix\scripts\mssql_version.ps1"

    But for some odd reason when I use the Template on my host. I keep getting unsupported item key ?
    When i run the powershells on their own, i get my value back in the normal JSON format.

    Any ideas?
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2
    Did you restart the agent service after adding the lines in the config?

    Also UnsafeUserParameters must be enabled if you use quotes in your commands.

    Comment

    • demoss
      Junior Member
      • Oct 2018
      • 9

      #3
      <never mind, I misread your question>

      Comment

      Working...