Конфигурирование Nagios для мониторинга хостов
# cd /etc/nagios/objects/
# vi contacts.cfg
email nagios@localhost
# cd ../
# vi nagios.cfg
# You can specify individual object config files as shown below:
#cfg_file=/usr/local/nagios-4.3.1/etc/objects/commands.cfg
#cfg_file=/usr/local/nagios-4.3.1/etc/objects/contacts.cfg
#cfg_file=/usr/local/nagios-4.3.1/etc/objects/timeperiods.cfg
#cfg_file=/usr/local/nagios-4.3.1/etc/objects/templates.cfg
# Definitions for monitoring the local (Linux) host
#cfg_file=/usr/local/nagios-4.3.1/etc/objects/localhost.cfg
Оставляю:
cfg_dir=/etc/nagios/objects
# cd /etc/nagios/objects
# mkdir ../disabled
# mv switch.cfg windows.cfg printer.cfg ../disabled/
Проверка конфига:
# /usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg
# service nagios restart
Всякие конфиги
# vi templates.cfg
Один хост
# vi hosts.cfg
# vi services.cfg
# service nagios restart
Несколько хостов
# vi hosts.cfg
# vi services.cfg
# service nagios restart
С использованием хостовых групп (hostgroups.cfg)
# vi hostgroups.cfg
# vi templates.cfg
# Linux host definition template - This is NOT a real host, just a template!
# vi services.cfg