Customize Configuration

  • Open the contacts.cfg for editing
  • $ sudo nano -w /usr/local/nagios/etc/objects/contacts.cfg
  • Change the email address associated with the “nagiosadmin” contact definition to the email address you would like to use for recieving alerts.  Save and Exit

Configure the Web Interface

  • While still residing in the extracted source directory, install the Nagios web config file in the Apache conf.d directory
  • $ sudo make install-webconf
  • Output from the install-webconf command
  • /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/conf.d/nagios.conf*** Nagios/Apache conf file installed ***
  • Next we create a “nagiosadmin” account for admin access to the web interface.  Don’t forget this password you set!
  • $ sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
  • Output from the htpasswd command
  • New password:
    Re-type new password:
    Adding password for user nagiosadmin
  • Reload Apache to put our changes into effect without restarting the server.
  • 1
    2
    
    $ sudo /etc/init.d/apache2 reload
    * Reloading web server config apache2                                   [ OK ]

Compile and Install the Nagios Plugins

  • Go back to the download directory where we stored the tarballs
  • $ cd ~/download
  • Extract the nagios-plugins-1.4.13.tar.gz
  • $ tar zxvf nagios-plugins-1.4.13.tar.gz
  • Once finished extracting move into the newly created directory
  • $ cd nagios-plugins-1.4.13/
  • Compile and install the plugins
  • $ sudo ./configure --with-nagios-user=nagios --with-nagios-group=nagios
  • Output from the configure command
  • --with-apt-get-command: /usr/bin/apt-get
    --with-ping6-command: /bin/ping6 -n -U -w %d -c %d %s
    --with-ping-command: /bin/ping -n -U -w %d -c %d %s
    --with-ipv6: yes
    --with-mysql: no
    --with-openssl: no
    --with-gnutls: no
    --enable-extra-opts: no
    --with-perl: /usr/bin/perl
    --enable-perl-modules: no
    --with-cgiurl: /nagios/cgi-bin
    --with-trusted-path: /bin:/sbin:/usr/bin:/usr/sbin
  • When that completes after a minute or so run the make command
  • $ sudo make
  • Another couple minutes should pass before this finishes. Once it does run the make install command
  • $ sudo make install

Pages: 1 2 3 4 5 6

Tags: