Sprungmarken

Servicenavigation

Hauptnavigation

Sie sind hier:

Hauptinhalt

Dipl-Inform Stefan Freitag

IGE Nagios Server Installation

The following installation instructions were used on a Scientific Linux 5.4 (64 Bit).

Firewall

  • Open port 80 in the firewall for outgoing/incoming HTTP connections.

Prerequisites

  • Changing the SE Linux policy from enforcing to permissive
    setenforce Permissive
    sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
    In some cases it might be better to disable SELinux.
  • Install packages required for the compilation of the Nagios core source code
    yum install gcc make autoconf
  • Install additional necessary packages
    yum install openssl-devel gd-devel
  • Install packages for the web server and PHP
    yum install httpd php php-cli php-common
  • Create a nagios user and group. Additionally create a group that will be allowed to execute the CGI files, e. g.
    groupadd -g 9000 nagios
    groupadd -g 9001 nagcmd
    useradd -u 9000 -g nagios -G nagcmd -d /usr/local/nagios -c "Nagios Admin" nagios
  • Get an idea about the user running the httpd service and add this user to the nagcmd group
    grep "^User" /etc/httpd/conf/httpd.conf
    usermod -a -G nagcmd apache

Nagios Server Core Installation

  1. Download of the Nagios server source code to a temporary directory
    wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz -P /tmp
  2. Extract the downloaded code
    tar xzf /tmp/nagios-3.2.3.tar.gz -C /tmp
  3. Run the configure script
    cd /tmp/nagios-3.2.3
    ./configure  --sysconfdir=/etc/nagios --localstatedir=/var/nagios --with-command-group=nagcmd --with-nagios-user=nagios --with-nagios-group=nagios --prefix=/usr/local/nagios

     where the options are

    --with-command-group=<grp> # sets group name for command access
    --sysconfdir=DIR           # read-only single-machine data [PREFIX/etc]
    --localstatedir=DIR        # modifiable single-machine data [PREFIX/var]
  4. Compile the source code
    make all
  5. Install the compiled code
    make install
    make install-init
    make install-commandmode
    make install-config
    make install-webconf
  6. Remove the temporary directory and the extracted files
    cd
    rm -f /tmp/nagios-3.2.3.tar.gz
    rm -rf /tmp/nagios-3.2.3
  7. Enable the automated start of Nagios at system startup
    chkconfig --add nagios
    chkconfig nagios on
  8. Adjust permissions so that the apache user can access the contents of /usr/local/nagios/share/
    chmod 755 /usr/local/nagios/

Nagios Plug-In Installation

  1. Download of the Nagios Plug-Ins source code
    wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz -P /tmp
  2. Extract the downloaded code
    tar xzf /tmp/nagios-plugins-1.4.15.tar.gz -C /tmp
  3. Run the configure script
    cd /tmp/nagios-plugins-1.4.15
    ./configure --sysconfdir=/etc/nagios --localstatedir=/var/nagios --enable-perl-modules
  4. Compile the source code
    make
  5. Install the compiled source code
    make install
  6. Remove the temporary directory and the extracted files
    rm -f /tmp/nagios-plugins-1.4.15.tar.gz
    rm -rf /tmp/nagios-plugins-1.4.15

Nagios RPE Installation

  1. Download of the Nagios Runtime Plug-In Executor source code
    wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz -P /tmp
  2. Extract the downloaded code
    tar xzf /tmp/nrpe-2.12.tar.gz -C /tmp
  3. Run the configure script
    cd /tmp/nrpe-2.12
    ./configure --sysconfdir=/etc/nagios --enable-ssl
  4. Compile the source code
    make all
  5. Copy the check_nrpe to the Nagios Plug-Ins directory
    cp /tmp/nrpe-2.12/src/check_nrpe /usr/local/nagios/libexec/
  6. Copy the nrpe executable to the /usr/bin directory
    cp /tmp/nrpe-2.12/src/nrpe /usr/bin/

HTTP Configuration

  1. Modify the file /etc/httpd/conf.d/nagios.conf
  2. Create a user nagiosadmin with a secret password
    htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

Other

  • Enable the automatic start of the httpd daemon
    chkconfig httpd on