NagiosThe installation is relatively simple, and the complex is the setting of settings and configuration parameters. But you need to relax. After all, we need to fix it, right? Let's get started:
1: Get the latest installation package
:Http://www.nagios.org/download
2: log on to the server as root
The latest version is 2.5:
1) nagios, Version 2.5:
Fetch http://superb-west.dl.sourceforge.net/sourceforge/nagios/nagios-2.5.tar.gz
Or
Wget http://superb-west.dl.sourceforge.net/sourceforge/nagios/nagios-2.5.tar.gz
2) obtain the nagios plugin version 1.4.3:
Http://surfnet.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.3.tar.gz
3) obtain the image library file:
Http://dl.sf.net/nagios/imagepak-base.tar.gz
4) NRPE, version 2.5.2
Http://ufpr.dl.sourceforge.net/sourceforge/nagios/nrpe-2.5.2.tar.gz
5) NSCA, version 2.6
Http://kent.dl.sourceforge.net/sourceforge/nagios/nsca-2.6.tar.gz
3: switch to the root user
Sudo su
4: Extract
Tar zxvf nagios-2.5.tar.gz
5. Create a user running nagios
Adduser nagios
6: Create a folder for installing nagios
Make the folder owner nagios: nagios
Mkdir/usr/local/nagios
Chown nagios. nagios/usr/local/nagios
7. Confirm the web Server user
Some commands may be executed through the web interface. You must determine which user the web server runs, usually apache:
Grep "^ User"/usr/local/apache2/conf/httpd. conf
8: Create a command file group
This new group will include apache users and nagios users.
- pw groupadd nagcmd
- pw usermod apache -G nagcmd
- pw usermod nagios -G nagcmd
- ----------------------------------
- cat /etc/group
- nagcmd:*:9007:apache,nagios
- ----------------------------------
9: run the configuration script and install nagios
- cd nagios-2.5
- ./configure --prefix=/usr/local/nagios --with-gd-lib=/usr/local/lib --with-gd-inc=/usr/local/include
- ---------------------------------
- *** Configuration summary for nagios 2.5 07-13-2006 ***:
-
- General Options:
- -------------------------
- Nagios executable: nagios
- Nagios user/group: nagios,nagios
- Command user/group: nagios,nagios
- Embedded Perl: no
- Event Broker: yes
- Install ${prefix}: /usr/local/nagios
- Lock file: ${prefix}/var/nagios.lock
- Init directory: /usr/local/etc/rc.d
- Host OS: freebsd6.0
-
- Web Interface Options:
- ------------------------
- HTML URL: http://localhost/nagios/
- CGI URL: http://localhost/nagios/cgi-bin/
- Traceroute (used by WAP): /usr/sbin/traceroute
-
-
- Review the options above for accuracy. If they look okay,
- type 'make all' to compile the main program and CGIs.
- ---------------------------------
- make all
- make install
- make install-init
- make install-commandmode
- make install-config
10: Install nagios-plugins
- tar zxvf nagios-plugins-1.4.3.tar.gz
- cd nagios-plugins-1.4.3
- ./configure --prefix=/usr/local/nagios-plugins
- make all
- make install
After the installation is complete, a libexec directory will be generated in/usr/local/nagios-plugins, and all the directories will be moved to the/usr/local/nagios directory.
Mv/usr/local/nagios-plugins/libexec // usr/local/nagios/
11: Installation of imagepak-base.tar.gz
Tar-xvzf imagepak-base.tar.gz
Decompress the package to the base directory.
Mv base/usr/local/nagios/share/images/logos/
The nagios installation process ends now. You must be careful and accurate in your operations. If you are not familiar with nagios, we recommend that you first take a look at the nagios network server monitoring and network service concepts to make the service configuration more smooth. If your host is ready for the above work, we will start to configure nagios. For more information, see troubleshooting and configuration.