System Engineering

Install Nagios on OpenSUSE 12.3

1. Install requirements

zypper install nagios nagios-plugins nagios-www nagiosgraph apache2 apache2-doc apache2-prefork

2. Prepare mysql

CREATE USER nagios@localhost
CREATE DATABASE nagios
GRANT ...

3. Configure ndo2db

vi /etc/nagios/ndo2db.cfg

lock_file=/var/run/nagios/ndo2db.pid
db_user=nagios
db_pass=PASSWORD

chgrp nagios /var/spool/nagios
chmod g+w /var/spool/nagios
mkdir /var/run/nagios
chown nagios:nagios /var/run/nagios
cd /usr/share/doc/packages/ndoutils/db
perl ./installdb -u nagios -h localhost -d nagios -p PASSWORD

vi /etc/sysctl.conf
vi /boot/sysctl.conf-<kernelversion>

kernel.msgmnb = 131072000
kernel.msgmax = 131072000
kernel.msgmni = 262400

3. Add httpd user

htpasswd2 /etc/nagios/htpasswd.users nagiosadmin

4. Create nagios objects

cd /etc/nagios/objects
vi my_object.cfg
# ...

5. Start service with monitoring log

tail -f /var/log/nagios/config.err
# ...

service start ndo2db start
service nagios start

6. apache 설정 수정

vi /etc/apache2/httpd.conf

ScriptAlias /nagios/cgi-bin "/usr/lib/nagios/cgi"
<Directory "/usr/lib/nagios/cgi">
  Options ExecCGI
  AllowOverride None
  Order allow,deny
  Allow from all
  AuthName "NMS Access"
  AuthType Basic
  AuthUserFile /etc/nagios/htpasswd.users
  Require valid-user
</Directory>

Alias /nagios "/usr/share/nagios"
<Directory "/usr/share/nagios">
  Options FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all
  AuthName "NMS Access"
  AuthType Basic
  AuthUserFile /etc/nagios/htpasswd.users
  Require valid-user
</Directory>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.