O & M monitoring Nagios serialization 3: deploying and configuring the Nagios Service (1)

Source: Internet
Author: User

As the saying goes: to do good things, you must first sharpen your tools. to make system management easier and more effective, a good monitoring tool is essential. here, I recommend nagios, an open-source monitoring tool that has been used for more than four years and is powerful and customizable.

O & M monitoring Nagios serialization 1: self-monitoring implementation of Nagios servers
Http://net.it168.com/a2009/0309/267/000000267878.shtml
O & M monitoring Nagios serialization 2: deploying an apache server
Http://net.it168.com/a2009/0310/268/000000268103.shtml
O & M monitoring Nagios serialization 3: deploying and configuring the Nagios Service
O & M monitoring Nagios serialization 4: Nagios monitoring mysql Server
O & M monitoring Nagios serialization 5: Important policies for key application monitoring


(1) Add an account to 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 general gnu source code software installation, nagios installation requires several more steps. If the general software runs to make install, the installation is complete ). 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:
Bin Nagios execution program Directory, which has only one file nagios
The location of the etc Nagios configuration file. After initial installation, there are only a few *. cfg-sample files.
The directory where the sbin Nagios Cgi file is located, that is, the directory where the file needed to execute External commands is located
Share the directory of the Nagios webpage File
Directory where var Nagios 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, there will be many files in the/usr/local/nagios generated directory libexec), which is exactly what nagios needs.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.