Nagios Remote Monitoring installation and configuration detailed text 1th/3 Page _ Networking Tutorials

Source: Internet
Author: User
Tags web services

As a system administrator, I am most concerned about the importance of online systems that do not shut down or stop network services without my knowledge, and that the services or hosts that fail may sometimes take a long time to know. Especially when it comes to holidays, system administrators are nervous. To change this passive situation, I recommend the network monitoring software Nagios, personally think its biggest advantage is that it can send fault alarm message-as long as the object of Nagios monitoring failure, the system will automatically send text messages to the phone. Below is an excerpt from the Nagios official website description:


Who uses it? Lots of people, including many big companies and organizations Nagios is an open-source software used to monitor hosts, services, and networks, which many large companies or organizations use.

Before I came to this institution, there was already a netsaint (Nagios version) monitoring those online servers, but not perfect, and then I built a new monitoring platform Nagios to monitor all the online servers; so far, 413 hosts and 754 services were monitored.
Although Nagios is very useful, but the configuration is indeed trouble, according to its pronunciation I give it a Chinese name-hard enough to die. For this reason, I will be as detailed as possible to tell you I use Nagios process and experience, I hope to help beginners.
Install the required software
I. Installation of Nagios

Nagios can run in various versions of Linux and the mainstream UNIX environment, I have tried the environment has redhat Linux,centos,debian and so on. In the actual operation of the dimension, I was CentOS 4 deploy department Nagios. After installing the operating system, you need to turn off all the extra services and leave sshd this service only. Then use wget to download the source package nagios-2.6.tar.gz and httpd-2.2.0.tar.gz. Next, install the software separately, as follows:
1, decompression Nagios. Tar zxvf nagios-2.6.tar.gz
2, configure Nagios. CD Nagios;/configure–prefix=/usr/local/nagios
3, compile Nagios. Make all
4, install Nagios. Slightly different from other software installation, Nagios installation is a few steps to complete. The first step is to make install install the main programs, CGI, and HTML files, and the second step is to perform the permissions to the external command to access the Nagios configuration file, step three, and perform the Install-commandmode install-config Copy the example of the configuration file to the Nagios installation directory. Follow the installation Wizard prompts, in fact, there is also a make install-init step, it is the role of the Nagios into a run script, so that nagios with the system boot, this is a very convenient measure. But I am a person who prefers to simplify the problem without performing such an operation.
5, verify that the program is properly installed. Switch directories to the installation path (here is/usr/local/nagios), see if there are etc, bin, sbin, share, VAR, five directories, if the presence of the program is properly installed to the system. The following table provides a brief description of the five directory features:

Bin

Nagios executable program directory, this directory has only one file Nagios

etc

Nagios configuration file location, after initial installation, only a few *.cfg-sample files

Sbin

directory where the Nagios CGI files reside, which is the directory where the files needed to execute the external command

Share

Nagios the directory where the Web page files are located

Var

Nagios directory where files such as log files, spid, and so on

second, the installation of Nagios Plug-ins
No plug-ins, Nagios will have nothing to do, plug-ins are also nagios expansion of powerful weapons, in addition to downloading commonly used plug-ins, we can also write their own plug-ins according to the actual requirements. The Nagios plugin nagios-plugins-1.4.5 can be found on www.nagios.org and then we download it with wget. Note: The version between the plugin and the Nagios is not necessarily associated with this version of nagios-plugins-1.4.5. When the download is complete, it is easy to install: first perform the configuration./configure–prefix=/usr/local/nagios, then compile and install make; Make install. The point to note here is that the installation path specified in the configuration process is/usr/local/nagios, not/usr/local/nagios-plus, after the installation is completed, the directory/usr/local/ Nagios generates directory Libexec (there are many files in it), which is exactly what Nagios needs.

498) this.style.width=498; "Border=0>

Third, install the Web server Apache
Web services are not necessary for Nagios, but if Nagios does not have a web, it would be very cumbersome and uninteresting to view objects that monitor objects (only by viewing the Nagios log to determine the state). I don't want to do anything boring, so I spend a little time installing the Web.
In the Unix/linux world, Apache is the Web server's preferred object, and its download site is www.apache.org. Recommended download source code. Because we don't need very complex web features, we can simply perform a few steps to properly install Apache to the system:
1, Solution Package, configuration: Tar zxvf httpd-2.2.0.tar.gz; CD httpd-2.2.0;./configure–prefix=/usr/local/apache.
2. Compile and install: make; Make install.
When the installation is complete, execute the command./USR/LOCAL/APACHE/BIN/APACHECTL–T check to see if Apache is properly installed.
Pre-configuration processing
The main task is to create Nagios users and their bundles, so that Nagios's running users are nagios instead of root. Then the owner of the directory/usr/local/nagios is set to Nagios to ensure the security of the system. Nagios can run as root, but this is not recommended. Use the following steps to complete the above process:
1, add the SYSTEM account Nagios:useradd Nagios is very easy to add users and group Nagios to the system. Some types of Linux distributions add users and groups to the trouble-you need to add a group and then perform Useradd–g Nagios Nagios. In the actual use of the scene, Nagios users do not need to be a system user to log on to the Linux system, so you can not set the Nagios user password, or even the Nagios user's login shell set to/bin/false.
2, change the catalogue group: Chown–r Nagios.nagios/usr/local/nagios. Note that some unix/linux versions of the user and the group separator symbol are not "." and may be such a form of chown–r Nagios:nagios/usr/local/nagios.
3, SendMail. See if the sendmail is running properly? We need to use SendMail to send fault alarm information, so this package must work properly. SendMail is divided into two parts: server and client, there are 2 kinds of way to send the alarm message.
(1) The machine where the Nagios is located uses the SendMail client program to send the message to a dedicated mail server, which is then sent by the mail server to the user's mailbox.
(2) The mail client and server end use the Nagios system sendmail. The first way to use it is very normative, but more cumbersome, such as the need to do address resolution, modify the configuration of the mail server, there is another problem-it also relies on other systems, increase the point of failure and complexity. The second method is very simple, just start the SendMail service, and it no longer relies on other systems and services. In the actual scene of my work, both methods are used, with a dedicated mail server there will be sending delays (because the mail server to deal with many other users of the mail delivery), and the direct use of SendMail server and client is extremely simple and convenient. Fortunately, almost all Linux/unix distributions are installed by default sendmail, so much ink, in fact, do an action-the SendMail service to run up.
4, the mobile phone message send tool. My current company is SP, has its own SMS channel, directly send SMS client program sms_send Copy to the directory/usr/local/bin/. If there is no message issued by the Gateway Channel, then how to do? The network has a lot of SMS to send the client program, very famous is smsclient, download it down, unpack after installation. Do not forget to buy mobile phone modem and mobile card, modem only support SIM card and not support CDMA. After installing the Smsclient software and hardware modem, test whether it is normal. What if there's no modem? The solution is still some: let your mobile phone number can accept mail, which requires you to open this function in the business hall. SMS Alarm function is the most useful function, we can not stare at the monitor screen all day, also can not accept e-mail all day, but our mobile phone can be 24 hours online, as long as the object of the monitoring failure, immediately can receive the fault alarm message. In the past, I was afraid to take a long vacation, because the most worried about the key equipment or services in the holiday failure and I do not know, so the holiday becomes on duty; presumably many network administrators have similar experiences. Before I started to deploy Nagios, once in the web search on the Nagios configuration of the article, found that most of them did not introduce the use of mobile phone SMS this convenient function, it is really regrettable! Again, it is highly recommended to enable Nagios short message fault alerting function.

current 1/3 page   1 23 Next read the full text

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.