Ad Widget

Collapse

How to pass multiple parameters to zabbix_js?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ezoltan
    Junior Member
    • Feb 2024
    • 24

    #1

    How to pass multiple parameters to zabbix_js?

    Hello Community,

    I am playing with the Browser item that comes with Zabbix 7.0+. It looks great but it is a steep learning curve largely due to the volume of assumed knowledge and missing key information. I also find that related information is scattered throughout the documentation without being cross-referenced.

    I need to test a multiple-step web scenario which includes login, clicking buttons, returning multiple screenshots, performance data for each step, and so on.

    At the moment I need to test my custom Java script and for that I use zabbix_js. It is great when I have no more than a single parameter. But...

    ...But how do I pass multiple parameters?

    Unfortunately the documentation doesn't go beyond a basic description of the available switches - see https://www.zabbix.com/documentation...ages/zabbix_js.

    Specifically, I'd like to know, if I have, say, a URL to monitor, a username and a password to log in with, and a screen resolution for the screenshots, how do I pass all these in one command line using the -p option, or via the -i input-file option?

    Thank you.
  • Viktors Fomics
    Member
    • Oct 2025
    • 42

    #2
    Hello

    Would make sense to use a JSON file containing the required parameters with the -i option, zabbix_js should be able to parse it.

    Comment

    • Viktors Fomics
      Member
      • Oct 2025
      • 42

      #3
      Originally posted by Viktors Fomics
      Hello

      Would make sense to use a JSON file containing the required parameters with the -i option, zabbix_js should be able to parse it.
      Using the -p option is possible too though, if passing a string of parameters directly to zabbix_js is required. Inside your script, the string can be assigned to a variable such as value and calling JSON.parse(value) can convert it into a JavaScript object, that zabbix_js can use, however that string still has to be in the valid JSON format.

      Comment

      Working...