8 JS

Overview

zabbix_js is a command line utility that can be used for embedded script testing.

This utility will execute a user script with a string parameter and print the result. Scripts are executed using the embedded Zabbix scripting engine.

In case of compilation or execution errors zabbix_js will print the error in stderr and exit with code 1.

Usage

  1. zabbix_js -s script-file -p input-param [-l log-level] [-t timeout]
  2. zabbix_js -s script-file -i input-file [-l log-level] [-t timeout]
  3. zabbix_js -h
  4. zabbix_js -V

zabbix_js accepts the following command line parameters:

  1. -s, --script script-file Specify the file name of the script to execute. If '-' is specified as file name, the script will be read from stdin.
  2. -i, --input input-file Specify the file name of the input parameter. If '-' is specified as file name, the input will be read from stdin.
  3. -p, --param input-param Specify the input parameter.
  4. -l, --loglevel log-level Specify the log level.
  5. -t, --timeout timeout Specify the timeout in seconds.
  6. -h, --help Display help information.
  7. -V, --version Display the version number.

Example:

  1. zabbix_js -s script-file.js -p example