Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
сервис_nagios [2020/02/27 07:35] val Убрал windows, freebsd и ubuntu |
сервис_nagios [2020/11/17 14:59] (текущий) val [Установка] |
||
---|---|---|---|
Строка 9: | Строка 9: | ||
=== Debian 10 === | === Debian 10 === | ||
- | * Можно не ставить [[Сервис MTA]] и [[UA mail]], поставит exim4 как зависимость | + | * Рекомендуется настроить [[Сервис MTA]] и установить [[UA mail]] (не обязательно), иначе поставит exim4 как зависимость |
* [[Сервис HTTP#Установка и запуск сервера Apache]] | * [[Сервис HTTP#Установка и запуск сервера Apache]] | ||
Строка 20: | Строка 20: | ||
# apt install nagios4 | # apt install nagios4 | ||
- | |||
- | # cd /etc/nagios4/conf.d/ | ||
</code> | </code> | ||
==== Настройка объектов мониторинга ==== | ==== Настройка объектов мониторинга ==== | ||
+ | |||
+ | * [[https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/dependencies.html|Host and Service Dependencies]] | ||
<code> | <code> | ||
- | server# /usr/lib/nagios/plugins/check_http -I val.bmstu.ru | + | server# /usr/lib/nagios/plugins/check_http -H yandex.ru -S |
+ | |||
+ | server# less /etc/nagios-plugins/config/http.cfg | ||
</code><code> | </code><code> | ||
- | server# cat corpX.cfg | + | server# cat /etc/nagios4/conf.d/corpX.cfg |
</code><code> | </code><code> | ||
define host{ | define host{ | ||
- | use generic-host | + | use generic-host |
- | name my-templ-host | + | name my-templ-host |
- | register 0 | + | register 0 |
- | max_check_attempts 1 | + | max_check_attempts 1 |
- | # check_command check-host-alive | + | check_command check-host-alive_4 |
- | # check_command check-host-alive_4 | + | |
- | | + | |
# mail send to user nagios | # mail send to user nagios | ||
Строка 53: | Строка 53: | ||
host_name yandex | host_name yandex | ||
alias yandex web site | alias yandex web site | ||
- | address ya.ru | + | address yandex.ru |
} | } | ||
Строка 60: | Строка 60: | ||
host_name yandex | host_name yandex | ||
service_description www | service_description www | ||
- | # check_command check_http | + | check_command check_https_4 |
- | # check_command check_http_4 | + | check_interval 5 |
- | normal_check_interval 5 | + | retry_interval 1 |
- | retry_check_interval 1 | + | |
} | } | ||
Строка 79: | Строка 78: | ||
host_name switch | host_name switch | ||
service_description ping | service_description ping | ||
- | # check_command check_winping | + | check_command check_ping_4!100.0,20%!500.0,60% |
- | + | check_interval 5 | |
- | # может понадобиться ключ -4 в описание команды | + | retry_interval 1 |
- | # check_command check_ping!100.0,20%!500.0,60% | + | |
- | normal_check_interval 5 | + | |
- | retry_check_interval 1 | + | |
- | } | + | |
- | + | ||
- | #--------------------------------- | + | |
- | + | ||
- | define servicedependency{ | + | |
- | host_name switch | + | |
- | service_description ping | + | |
- | dependent_host_name yandex | + | |
- | dependent_service_description www | + | |
- | execution_failure_criteria o | + | |
- | notification_failure_criteria w,u | + | |
} | } | ||
</code> | </code> | ||
Строка 105: | Строка 90: | ||
=== Debian 10 === | === Debian 10 === | ||
- | * [[http://server.corpX.un/nagios4/]] | + | * [[http://server/nagios4/]] |
<code> | <code> | ||
Строка 169: | Строка 154: | ||
<code> | <code> | ||
- | # cd /usr/lib/nagios/plugins | + | # /usr/lib/nagios/plugins/check_snmp -H router -C public -o ifInOctets.2,ifOutOctets.2 --rate -w 1000,1000 -c 10000,10000 |
- | + | ||
- | # ./check_snmp -H router -C public -o ifInOctets.2,ifOutOctets.2 --rate -w 1000,1000 -c 10000,10000 | + | |
# rm -r /usr/var/* | # rm -r /usr/var/* |