Вики IT-KB

Пошаговые руководства, шпаргалки, полезные ссылки...

Инструменты пользователя

Инструменты сайта


icinga:centreon-plugins:installation-on-debian

Это старая версия документа!


Установка Centreon Plugins на Debian Linux

Плагины Centreon Plugins не имеют собственной пакетной базы, поэтому получить содержимое интересующих нас скриптов мониторинга можно с помощью клонирования из репозитория github


Установка

Создадим на сервере мониторинга, например на сервере Icinga, отдельный каталог и с помощью утилиты git склонируем в этот каталог плагины centreon-plugins:

# apt-get install git -y
# mkdir /usr/lib/nagios/plugins/centreon-plugins
# cd /usr/lib/nagios/plugins/centreon-plugins/
# git clone --depth=1 https://github.com/centreon/centreon-plugins.git

Установим библиотеки Perl, необходимые для работы плагинов:

# apt-get install perl \
libsnmp-perl libxml-libxml-perl libjson-perl libwww-perl \ 
libxml-xpath-perl libnet-telnet-perl libnet-ntp-perl libnet-dns-perl \ 
libdbi-perl libdbd-mysql-perl libdbd-pg-perl -y


Получение встроенной справки

Получим полный список плагинов, входящих в комплект Centreon Plugins:

# ./centreon_plugins.pl --list-plugin

Получим список плагинов, например, относящихся только к оборудованию APC:

# ./centreon_plugins.pl --list-plugin | grep -i apc | grep 'PLUGIN'

PLUGIN: apps::apcupsd::local::plugin PLUGIN: apps::backup::netapp::snapcenter::restapi::plugin PLUGIN: apps::php::apc::web::plugin PLUGIN: hardware::ats::apc::snmp::plugin PLUGIN: hardware::pdu::apc::snmp::plugin PLUGIN: hardware::ups::apc::snmp::plugin

Получим справку по конкретному плагину, например hardware::ats::apc::snmp::plugin:

# ./centreon_plugins.pl --plugin=hardware::ats::apc::snmp::plugin --help

Plugin Description: Check APC ATS in SNMP. Global Options: --mode Choose a mode. --dyn-mode Specify a mode with the path (separated by '::'). --list-mode List available modes. --mode-version Check minimal version of mode. If not, unknown error. --version Display plugin version. --pass-manager Use a password manager.

Получим перечень режимов работы конкретного плагина

# ./centreon_plugins.pl --plugin=hardware::ats::apc::snmp::plugin --list-mode


... Modes Meta: multi Modes Available: device-status input-lines output-lines

Получим справку по конкретному режиму плагина, например device-status:

# ./centreon_plugins.pl --plugin=hardware::ats::apc::snmp::plugin --mode=device-status --help



Plugin Description: Check APC ATS in SNMP. Global Options: --mode Choose a mode. ... Output Options: --verbose Display long output. ... Snmp Options: --hostname Hostname to query (required). ... Mode: Check device status. --component Which component to check (Default: '.*'). Can be: 'entity'. --filter Exclude some parts (comma seperated list) (Example: --filter=entity) Can also exclude specific instance: --filter=entity,CommStatus --no-component Return an error if no compenents are checked. If total (with skipped) is 0. (Default: 'critical' returns). --threshold-overload Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='entity,SourceBStatus,WARNING,fail'


Пример использования

# ./centreon_plugins.pl --plugin=hardware::ats::apc::snmp::plugin \ 
--mode=device-status --no-component \ 
--hostname='ATS01' --snmp-version='1' --snmp-community='public' --verbose

CRITICAL: Entity 'PhaseSyncStatus' status is 'outOfSync' | 'count_entity'=14;;;; Checking entities entity '24VPowerSupply' status is 'atsPowerSupplyOK' [instance = 24VPowerSupply] entity '24VSourceBPowerSupply' status is 'atsPowerSupplyOK' [instance = 24VSourceB...] entity '5VPowerSupply' status is 'n/a' [instance = 5VPowerSupply] entity 'CommStatus' status is 'atsCommEstablished' [instance = CommStatus] entity 'HardwareStatus' status is 'ok' [instance = HardwareStatus] entity 'Minus12VPowerSupply' status is 'n/a' [instance = Minus12VPowerSupply] entity 'OverCurrentState' status is 'atsCurrentOK' [instance = OverCurrentState] entity 'PhaseSyncStatus' status is 'outOfSync' [instance = PhaseSyncStatus] entity 'Plus12VPowerSupply' status is 'n/a' [instance = Plus12VPowerSupply] entity 'RedundancyState' status is 'atsFullyRedundant' [instance = RedundancyState] entity 'SourceAStatus' status is 'ok' [instance = SourceAStatus] entity 'SourceBStatus' status is 'ok' [instance = SourceBStatus] entity 'SwitchStatus' status is 'ok' [instance = SwitchStatus] entity 'VoltageOutStatus' status is 'ok' [instance = VoltageOutStatus]

Как отфильтровать или вовсе отключить perfdata

# ./centreon_plugins.pl --plugin=hardware::ats::apc::snmp::plugin --mode=device-status \
--hostname='ATS01' --snmp-version='1' --snmp-community='public' \
--no-component --filter-perfdata='dummy'

CRITICAL: Entity 'PhaseSyncStatus' status is 'outOfSync' - Entity 'RedundancyState' status is 'atsRedundancyLost' - Entity 'SourceAStatus' status is 'fail' - Entity 'SwitchStatus' status is 'fail' |


Обновление

# cd /usr/lib/nagios/plugins/centreon-plugins/
# git fetch
# git checkout origin/master

Проверено на следующих конфигурациях:

Версия ОС Версия Centreon Plugins
Debian 9 20191016

Автор первичной редакции:
Алексей Максимов
Время публикации: 08.01.2020 14:59

Обсуждение

Ваш комментарий:
 
icinga/centreon-plugins/installation-on-debian.1578485008.txt.gz · Последнее изменение: 08.01.2020 15:03 — Алексей Максимов

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki