zabbix-hosts-by-alerts summary

Plugin Name: zabbix-hosts-by-alerts
Version: 2.0.1
Author: @spigell
Realease Date: 2018-09-13 20:47:10
Short Description: get hosts with specified alert description
Category: monitoring
Plugin web page: https://github.com/Spigell/zabbix-hosts-by-alerts
 
Download link: zabbix-hosts-by-alerts-v2.000001.tar.gz
Latest version link: https://sparrowhub.org/info/zabbix-hosts-by-alerts

## 2.0.0
  - python3 compatibility
  - remove outthentic from script

zabbix-hosts-by-alerts documentation

SYNOPSIS

Get zabbix's hostnames by description of trigger.

Tested on zabbix 3.2+.

Python - 3

INSTALL

  $ sparrow plg install zabbix-hosts-by-alerts

Dependencies

pyzabbix

oayml

USAGE

Manually

  $ ./zabbix-hosts-by-alerts --user foo --password bar --host 127.0.0.1
    "Server unreachable"

Sparrow usage

This script is being wrapped by sparrow as outthentic plugin. For installation you can

  $ sparrow plg install zabbix-hosts-by-alerts

And if you want to run this script

  $ sparrow plg run zabbix-hosts-by-alerts -- --user foo --password bar --host 127.0.0.1
  "Server unreachable"

  test.example.ru
  test2.example.ru

Parameters

user

A user to login. Default is zabbix. Obligatory.

password

A password. Obligatory. Default is zabbix.

host

IP of zabbix server. Obligatory.

pattern

Part of alert's description. Obligatory.

output

Default is stdout. If any other specified output will be in file.

severity

Minimal severity of alert. Default is 3

duration

Minimal duration for alert being in BAD state. Default is 5 minutes

extended(flag)

if true then adds to output description of trigger in YAML. For example: $ ./zabbix-hosts-by-alerts --user foo --password bar --host 127.0.0.1 "Server unreachable" --extended

  host: server2.example.ru
  alert: Server is unreachable 

  host: server1.example.ru
  alert: Server is unreachable 

with_values(flag)

if true then adds value lastvalue to output.

  host: server2.example.ru
  alert: 'Available memory: 3.1334% 1589039104B'
  value1: '1589039104'
  value0: '3.1334'

  host: server1.example.ru
  alert: 'Available memory: 2.9393% 1491988480B'
  value1: '1491988480'
  value0: '2.9393'

See also

sparrowdo

sparrow