Git Product home page Git Product logo

zabbix-utils's Introduction

zabbix-utils

zabbix_jsonify

Never write your own script again just to format data, if you wanna use new source for zabbix low level discovery. With zabbix_jsonify you can turn nearly every standard output to zabbix-compliant json. Simply by piping your command to zabbix_jsonify, you have your LLD ready and you can save a lot of time without debugging "Value should be a JSON object" error messages.

Usage

usage: zabbix_jsonify [-h] [--delimiter DELIMITER] keyname [keyname ...]
Converts lines from standard input to JSON for Zabbix discovery.

positional arguments:
  keyname               The {#KEYNAME} that will be returned.

optional arguments:
  -h, --help            show this help message and exit
  --delimiter DELIMITER
                        Delimiter of columns. Default is space

Example

root@localhost:~# cat /proc/mounts  | zabbix_jsonify FSTYPE FSNAME
{"data":
[
    {
        "{#FSTYPE}": "sysfs", 
        "{#FSNAME}": "/sys"
    }, 
...
   {
        "{#FSTYPE}": "tmpfs", 
        "{#FSNAME}": "/run/user/10067"
    }
]
}
root@localhost:~# cat /etc/zabbix/zabbix_agentd.d/userparameter_varnish.conf
UserParameter=varnish.backend.discovery,echo "backend.list" | sudo varnishadm |  awk 'NR>2 {print substr($$1,6)}' | zabbix_jsonify VARNISHBACKEND

zabbix-utils's People

Contributors

lukassabla avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.