check_zabbix

check_zabbix

Check plugin to retreive Zabbix monitoring host status using Zabbix server API.

This script could be used as Icinga/Nagios check plugin.

Requirements

  • Python
  • zabbix_client (python module)
  • configparser (python module)

Installation using VirtualEnv

virtualenv venv
./venv/bin/pip install zabbix_client configparser
./venv/bin/python check_zabbix -h

Usage

Usage: check_zabbix [options]

Options:
  -h, --help            show this help message and exit
  -v, --verbose         
  -d, --debug           
  -c CONFIG             Load parameters from configuration file
  -U ZABBIX_URL, --zabbix-url=ZABBIX_URL
                        Zabbix server URL (Default : http://localhost)
  -u ZABBIX_USER, --user=ZABBIX_USER
                        Zabbix user (Default : admin)
  -p ZABBIX_PASSWORD, --password=ZABBIX_PASSWORD
                        Zabbix password
  -H ZABBIX_HOST, --host=ZABBIX_HOST
                        Zabbix host to check
  --allow-no-trigger-host
                        Zabbix host to check
  --check-triggers-related-items-state
                        Check triggers's related enabled items state is
                        correct

Using configuration file

Use -c parameter to load configuration from file. See example file example.conf for file format (INI).

Note : Parameters in command-line are could override configuration file informations.

Copyright

Copyright (c) 2017 Benjamin Renard

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.