DeploymentNagios ServiceThe specific implementation steps are as follows:
Deploy nagios services
(1) Add an accountTo run Nagios. Of course, you can also run it with the root account. However, for security reasons, you can run it with a common account without assigning shell logon permissions to this account.
1. if you add an account in linux, useradd nagios-s/sbin/nologin automatically generates a group named nagios.
2. the operation for adding an account to freebsd Is pw groupadd nagios; pw useradd nagios-g nagios-s/sbin/nologin.
Note: Do not set a password for nagios users.
(2) install nagios Software
Tar zxvf nagios-2.9.tar.gz
Cd nagios-2.9
./Configure-prefix =/usr/local/nagios-with-nagios-user = nagios-with-nagios-group = nagios
Make all
After executing this step, make install will prompt you to run the make install-init, make install-commandmode, and make install-config commands in sequence. We select two of them for execution:
Make install-commandmode
Make install-config
Compared with the general gnu source code software installation, nagios has several more steps (the general software can be installed after running make install ). Of course, you can also do not execute these two steps. You can manually grant the directory or file permissions, and then manually create a configuration file, which has the same effect. After nagios is installed, we can generate the following directory under the/usr/local/nagios installation directory:
The directory where the binNagios executable program is located. This directory has only one file nagios
Location of the etcNagios configuration file. After the initial installation, there are only a few *. cfg-sample files.
The directory where the sbinNagios Cgi file is located, that is, the directory where the file needed to execute External commands is located
The directory where the shareNagios webpage file is located
Directory where varNagios log files, spids, and other files are located
(3) install the nagios plugin
There is no plug-in, and nagios does not play any role. The plug-in is also a powerful weapon for nagios extension functions. In addition to downloading common plug-ins, we can also compile our own plug-ins according to actual requirements. Nagios plug-in nagios-plugins-1.4.9 can be found on www.nagios.org, And then we use wget to download it. Note: The version between the plug-in and nagios is not associated much, not necessarily with the nagios-plugins-1.4.9 version. After the download is complete, it is easy to install: first execute the configuration./configure-prefix =/usr/local/nagios, then compile and install make; make install. The installation path specified during the configuration process is/usr/local/nagios, instead of/usr/local/nagios-plus, the libexec directory will be generated in the/usr/local/nagios directory (which contains many files), which is exactly what nagios needs.
(4) Configure nagios
Configuration is the most complex part of nagios. It makes it easy for us to process configurations one by one. The configuration file directory of the newly installed nagios is/usr/local/nagios/etc.
Through four points in the article, we clearly know that if you deploy the nagios service, I hope it will help you!