Giter VIP home page Giter VIP logo

listlld's Introduction

listlld

Zabbix Low Level Discovery from a list. Currently 2 discovery macros are supported at the same time, {#NAME} and {#VALUE} by default.

Usage

usage: listlld [-h] [--delimiter DELIMITER]
               [--name NAME] [--value VALUE]
               items

Converts a list of delimited values into a Zabbix LLD JSON for simple list
based Low Level Discoveries.

positional arguments:
  items                 List of items to convert.

optional arguments:
  -h, --help            show this help message and exit
  --delimiter DELIMITER, -d DELIMITER
                        Delimiter character used, default is ",".
  --name NAME, -n NAME  Name of the discovery macro, defaults to "{#NAME}".
                        Only specify the name, this script will add the macro
                        characters "{#...}" for you.
  --value VALUE, -v VALUE
                        Name of the discovery macro, defaults to "{#VALUE}".
                        Only specify the name, this script will add the macro
                        characters "{#...}" for you.

Examples

By specifying listlld foo,bar,baz the following output will be generated:

{"data": [{"{#NAME}": "foo"}, {"{#NAME}": "bar"}, {"{#NAME}": "baz"}]}

Alternatively, items can be specified as well in the form of listlld foo:123,bar:456,baz:789, this will result in:

{"data": [{"{#VALUE}": "123", "{#NAME}": "foo"}, {"{#VALUE}": "456", "{#NAME}": "bar"}, {"{#VALUE}": "789", "{#NAME}": "baz"}]}

The names of the discovery fields can be specified through the --name and --value arguments.

Recommended usage in Zabbix

Place the file listlld in the ExternalScripts directory on your Zabbix server (and/or proxies).

On your host or template, create a usermacro that contains the list of 'discovered' items:

{$MYLLDLIST} = foo:123,bar:456,baz:789

You can now create a discovery rule on the host/template using an external check with the following key (mind the quotes!):

listlld["{$MYLLDLIST}"]

This will now allow you to use the {#NAME} and {#VALUE} discovery macros in your prototypes.

To add or remove 'discovered' items, triggers, etc., simply edit the usermacro.

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.