FreeBSD: установка Nagios 3.2

От знакомых админов слышал, что они отказались от munin и перешли на nagios. Посмотрел я на nagios – она на порядок выше мунина. Просто монстр. Вобщем решил поставить. ОС FreeBSD 8.1 stable . Ставить буду из портов, предварительно обновив их csup-ом.

Приступаем к установке nagios:

cd /usr/ports/net-mgmt/nagios

# make install clean

Начинается установка.

По окончанию установки выводятся рекомендации:

***********************************************************

Enable Nagios in /etc/rc.conf with the following line:

nagios_enable=»YES»

Configuration templates are available in /usr/local/etc/nagios as
*.cfg-sample files. Copy them to *.cfg files where required and
edit to suit your needs. Documentation is available in HTML form
in /usr/local/www/nagios/docs.

If you don’t already have a web server running, you will need to
install and configure one to finish off your Nagios installation.
When used with Apache, the following should be sufficient to publish
the web component of Nagios (modify the allow list to suit):

<Directory /usr/local/www/nagios>
Order deny,allow
Deny from all
Allow from 127.0.0.1
php_flag engine on
php_admin_value open_basedir /usr/local/www/nagios/:/var/spool/nagios/
</Directory>

<Directory /usr/local/www/nagios/cgi-bin>
Options ExecCGI
</Directory>

ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/
Alias /nagios/ /usr/local/www/nagios/

**********************************************************************
===> Registering installation for nagios-3.2.3
===> Cleaning for gd-2.0.35_7,1
===> Cleaning for libltdl-2.4
===> Cleaning for nagios-plugins-1.4.15_1,1
===> Cleaning for libXpm-3.5.7
===> Cleaning for libX11-1.3.6,1
===> Cleaning for jpeg-8_3
===> Cleaning for png-1.4.5
===> Cleaning for freetype2-2.4.4
===> Cleaning for fontconfig-2.8.0,1
===> Cleaning for qstat-2.11
===> Cleaning for fping-2.4b2_1
===> Cleaning for net-snmp-5.5_4
===> Cleaning for p5-Net-SNMP-6.0.1
===> Cleaning for radiusclient-0.5.6_1
===> Cleaning for xextproto-7.1.1
===> Cleaning for xproto-7.0.16
===> Cleaning for libXext-1.1.2,1
===> Cleaning for libXt-1.0.9
===> Cleaning for libxcb-1.7
===> Cleaning for xorg-macros-1.11.0
===> Cleaning for bigreqsproto-1.1.1
===> Cleaning for xcmiscproto-1.2.0
===> Cleaning for xtrans-1.2.5
===> Cleaning for kbproto-1.0.5
===> Cleaning for inputproto-2.0.1
===> Cleaning for xf86bigfontproto-1.2.0
===> Cleaning for libXau-1.0.6
===> Cleaning for libXdmcp-1.0.3
===> Cleaning for p5-Tk-804.029
===> Cleaning for p5-Crypt-DES-2.05
===> Cleaning for p5-Digest-SHA1-2.13
===> Cleaning for p5-Digest-HMAC-1.02
===> Cleaning for libSM-1.1.1_3,1
===> Cleaning for libcheck-0.9.8
===> Cleaning for libxslt-1.1.26_2
===> Cleaning for xcb-proto-1.6
===> Cleaning for libpthread-stubs-0.3_3
===> Cleaning for p5-Crypt-CBC-2.30
===> Cleaning for libICE-1.0.7,1
===> Cleaning for libgcrypt-1.4.6
===> Cleaning for libgpg-error-1.10
===> Cleaning for nagios-3.2.3
monitor#

Следуем рекомендациям.

Виртуалхост апачу:

# ***************************************** #

Alias /nagios «/usr/local/www/nagios/»

<Directory /usr/local/www/nagios/>
Order deny,allow
Allow from all
AuthName «Nagios Access»
AuthType Basic
AuthUserFile /usr/local/etc/nagios/.htpasswd.nagios
Require valid-user
</Directory>

<Directory /usr/local/www/nagios/cgi-bin/>
Options ExecCGI
AuthName «Nagios Access»
AuthType Basic
AuthUserFile /usr/local/etc/nagios/.htpasswd.nagios
Require valid-user
</Directory>

# ***************************************** #

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

htpasswd -c /usr/local/etc/nagios/.htpasswd.nagios user user

Я поставил user user что бы не забыть)

В /etc/rc.conf:

nagios_enable=»YES»

Для автозапуска nagios.

Nagios установился в /usr/local/etc/nagios

Запустить nagios:

/usr/local/etc/rc.d/nagios start

Для настройки Nagios можно применить утилиты, а можно править конфигурационные файлы руками. Я попробую все методы, позже отпишу о результатах.

http://rg74.ru

Обновлено: 12.03.2015