Difference between revisions of "Nagios FreeBSD"

From Teknologisk videncenter
Jump to: navigation, search
m (Step 2: Install)
m (Step 4: Apache configuration)
Line 138: Line 138:
 
Starting apache.
 
Starting apache.
 
</source>
 
</source>
 +
== Step 5: Nagios minimal configuration ==
 +
  
  

Revision as of 14:18, 5 November 2009

Installation

Step 1: prepare

[root@sun ~]# <input>cd /usr/ports/net-mgmt/nagios</input>
[root@sun /usr/ports/net-mgmt/nagios]# <input>make</input>
===>  Vulnerability check disabled, database not found
===>  Found saved configuration for nagios-3.0.6
=> nagios-3.0.6.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from http://nchc.dl.sourceforge.net/sourceforge/nagios/.
fetch: http://nchc.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz: Moved Temporarily
<notice> ..... Output omitted ..... </notice>
*** Compile finished ***

If the main program and CGIs compiled without any errors, you
can continue with installing Nagios as follows (type 'make'
without any arguments for a list of all possible options):

  make install
     - This installs the main program, CGIs, and HTML files

  make install-init
     - This installs the init script in /usr/local/etc/rc.d

  make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file

  make install-config
     - This installs *SAMPLE* config files in /usr/local/etc/nagios
       You'll have to modify these sample files before you can
       use Nagios.  Read the HTML documentation for more info
       on doing this.  Pay particular attention to the docs on
       object configuration files, as they determine what/how
       things get monitored!

  make install-webconf
     - This installs the Apache config file for the Nagios
       web interface


*** Support Notes *******************************************

If you have questions about configuring or running Nagios,
please make sure that you:

     - Look at the sample config files
     - Read the HTML documentation
     - Read the FAQs online at http://www.nagios.org/faqs

before you post a question to one of the mailing lists.
Also make sure to include pertinent information that could
help others help you.  This might include:

     - What version of Nagios you are using
     - What version of the plugins you are using
     - Relevant snippets from your config files
     - Relevant error messages from the Nagios log file

For more information on obtaining support for Nagios, visit:

       http://www.nagios.org/support/

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

Enjoy.

Step 2: Install

[root@sun /usr/ports/net-mgmt/nagios]# <input>make install</input>
===>  Installing for nagios-3.0.6
===>   nagios-3.0.6 depends on file: /usr/local/libexec/nagios/check_nagios - not found
<notice> ..... Output omitted ..... </notice>
===>   nagios-3.0.6 depends on shared library: ltdl.4 - found
pw: unknown group `nagios'
You need a "nagios" group.
Would you like me to create it [YES]? <input>YES</input>
Done.
pw: no such user `nagios'
You need a "nagios" user.
Would you like me to create it [YES]? <input>YES</input>
<notice> ..... Output omitted ..... </notice>
**********************************************************************

 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
     Allow from all
     Allow from 127.0.0.1
   </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/

**********************************************************************
===> Installing rc.d startup script(s)
===>   Registering installation for nagios-3.0.6

Step 3: nagios daemon config

[root@sun /etc]# <input>echo 'nagios_enable="YES"' >> /etc/rc.conf</input>

Step 4: Apache configuration

[root@sun /etc]# <input>echo '   <Directory /usr/local/www/nagios></input>
     Order deny,allow
     Deny from all
     Allow from 127.0.0.1
   </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/
' >> /usr/local/etc/apache/httpd.conf
[root@sun /etc]# <input>/usr/local/etc/rc.d/apache restart</input>
Stopping apache.
Waiting for PIDS: 969, 969, 969, 969.
Starting apache.

Step 5: Nagios minimal configuration