Monitor your Linux server with a monitoring treasure (attached photos)

Source: Internet
Author: User
Keywords Server Linux monitor treasure
In the http://www.unixbar.net/see the use of monitoring Treasure monitor server, feel good, on the installation of a configuration, the following describes the specific installation Method! Monitoring treasure using the standard SNMP protocol to provide users with server monitoring, which means that the monitored server must run the SNMP agent (SNMPD), then we will detail how to install, open the SNMP agent on the Linux server, and make the necessary security configuration, Nginx monitoring and server i/o,cpu load, memory load and other related functions. The following example uses the CentOS environment, but it also applies to other Linux distributions. 1, compile and install # wget http://cdnetworks-kr-2.dl.sourceforge.net/project/net-snmp/net-snmp/5.5/net-snmp-5.5.tar.gz# Tar- ZXVF Net-snmp-5.5.tar.gz then generates compilation rules by configure, as follows: # CD net-snmp-5.5#./configure--PREFIX=/USR/LOCAL/SNMP-- With-openssl--with-mib-modules and then always enter # make# make install2, setting up a secure authentication method exposing the SNMP agent to all hosts on the network is dangerous, in order to prevent other hosts from accessing your SNMP agent , we need to include an authentication mechanism on the SNMP agent. SNMP supports different authentication mechanisms, depending on the version of the SNMP protocol, which currently supports the V2C and V3 two versions, where the V2C version of the authentication mechanism is relatively simple, it is based on plaintext password and authorized IP to authenticate, While the V3 version is authenticated by the encrypted transmission of username and password, we recommend using V3. Note that the SNMP protocol version and the SNMP agent version are different, and the V2C and V3 referred to earlier are the versions of the SNMP protocol, and NET-SNMP is the suite of programs used to implement the SNMP protocol, which is currently the latest version of the 5.5 mentioned earlier. We recommend that you use the V3 version for authentication. For some earlier versions of Linux distributions, the built-in SNMP agent may not support V3, so we recommend that you compile and install the latest NET-SNMP as described in the previous section. V3 support Another authentication method, need to create a V3 account number, we also modify the following configuration file: # vi/usr/local/snmp/share/snmp/snmpd.conf then add a read-only account, as follows: Rouser Jiankongbao Auth can see that, in V3, "Rouser" is used to represent a read-only account type, and subsequent "Jiankongbao" is the specified username, followed by "auth" to indicate the need for authentication. Next, we will add "Jiankongbao" This user, this is the special mechanism in V3, we open the following configuration file: # vi/var/net-snmp/ snmpd.conf This file will be automatically invoked when the SNMPD is started, we need to add instructions to create the user inside it, as follows: CreateUser Jiankongbao MD5 MyPassword This line of configuration means creating a " Jiankongbao "User, the password is" MyPassword ", and uses the MD5 to carry on the encryption transmission. The caveat here is that the password must be at least 8 bytes. This is the SNMP protocol, if less than 8 bytes, communication will not proceed. It is noteworthy that once SNMPD is started, for security reasons, this line of configuration will be snmpd automatically deleted, of course, SNMPD will be in the form of redaction of these configuration records in other files, restart SNMPD is not necessary to add these configurations, unless you want to create new users. The user name, password, and encryption method in the above configuration need to be added when the monitor adds the server. Once the SNMP agent has been configured, you can now start SNMPD, as follows: #/USR/LOCAL/SNMP/SBIN/SNMPD If you want to close, you can kill the process directly, as follows: # killall-9 SNMPD3, MySQL Monitor create MySQL permissions you need to create a dedicated MySQL user on the MySQL server that is being monitored, and the benefits are: (1) effective isolation and management of your other MySQL users. (2) Limited management of the user, do not need to give any MySQL permissions. (3) Specify the access IP address of the monitoring treasure to prevent other illegal access. Operation is very simple, in the MySQL operation is as follows: CREATE USER ' Jiankongbao ' @ ' 125.76.229.113 ' identified by ' Your_password '; Create user ' Jiankongbao ' @ ' 125.76.229.215 ' identified by ' Your_password '; In the above operation, we created the MySQL user named "Jiankongbao", the password is " Your_password, it is recommended that you modify it. In addition, we do not need to grant any privileges to the MySQL account at this time。 At the same time, the current authorized IP address designated by the monitor is: 125.76.229.113, 125.76.229.215, two must be added at the same time, then if there are changes, we will promptly notify the user. Note: In MySQL or firewall to specify the authorized IP address, please only open our designated IP address, rather than directly open the entire Class C network segment, such as 125.76.229.0/24, because the other servers in the network segment is not within our controllable range. 4, Nginx monitoring compile nginx need to open nginx monitoring installation Pcre#tar zxvf PCRE-8.0.TAR.GZ#CD pcre-8.0#./configure#make && make Install installs nginx# tar zxvf nginx-0.7.64.tar.gz# cd nginx-0.7.64#./configure--with-http_stub_status_module Usr/local/nginx--user=www--group=www# make && make install configuration files need to add Location/nginx {stub_status on;auth_ Basic "Nginxstatus"; # auth_basic_user_fileconf/htpasswd; #密码由apache的htpasswd工具来产生access_log off; SNMP is configured to do so. Next configure the Monitor treasure now let's see how to add the server monitor in the monitor treasure, through the new navigation, you will easily enter the page that adds the server, here divides into two parts, first is fills in the server information, including the server name and the IP address, as well as the operating system type. These are very simple, the reason to choose the operating system type, because of the Linux and Windows mechanism there are some differences, so their SNMP information base will be somewhat different, we need to be based on different systems to provide the corresponding monitoring project. Next is the SNMP settings, mainly the choice of different SNMP protocol, as well as the completion of authentication information, the front has been a detailed introduction, here you only need to fill in the front configuration information truthfully. 498) this.width=498 ' OnMouseWheel = ' javascript:return big (This) ' style= ' Cursor:pointer ' Id=ewebeditor_tempelement_ IMG Onclick= "showimg (THIS.SRC); return false;" border=0 alt= use monitoring treasure to monitor your Linux server 1 src= "http://images.51cto.com/files/uploadimg/ 20100203/1034070.gif "width=600> fill out, click the Submit button, this time the monitoring treasure will use this information to try to connect your SNMP monitoring agent, take a few minutes, this step is very important to find the problem after submitting again, if the connection is successful, You will see the Success page, as follows 498) this.width=498 ' OnMouseWheel = ' javascript:return big (This) ' style= ' Cursor:pointer ' id=ewebeditor_ Tempelement_img onclick= "showimg (THIS.SRC); return false;" border=0 alt= use monitoring treasure to monitor your Linux server 2 src= "http:// Images.51cto.com/files/uploadimg/20100203/1034071.gif "> then click on" Add Monitor Project ", you can think of this server select Monitoring project, for Linux server, Monitoring Bao currently provides the following monitoring items, you can check all, and then submit. 498) this.width=498 ' OnMouseWheel = ' javascript:return big (This) ' style= ' Cursor:pointer ' Id=ewebeditor_tempelement_ IMG onclick= "showimg (THIS.SRC); return false;" border=0 alt= use Monitor to monitor your Linux server 3 src= "http://images.51cto.com/files/ Uploadimg/20100203/1034072.gif "> Add nginx Monitor 498) this.width=498; ' OnMouseWheel = ' javascript:return big (This) ' style = "Cursor:pointer" id=ewebeditor_tempelement_img onclick= showimg (THIS.SRC);order=0 alt= use Surveillance to monitor your Linux server 4 src= "Http://images.51cto.com/files/uploadimg/20100203/1034073.gif" width=500> 498) this.width=498 ' OnMouseWheel = ' javascript:return big (This) ' style= ' Cursor:pointer ' Id=ewebeditor_tempelement_ IMG onclick= "showimg (THIS.SRC); return false;" border=0 alt= use Monitor to monitor your Linux server 5 src= "http://images.51cto.com/files/ Uploadimg/20100203/1034074.gif "width=500> and then wait for a while, you can see the monitoring state!" 498) this.width=498 ' OnMouseWheel = ' javascript:return big (This) ' style= ' Cursor:pointer ' Id=ewebeditor_tempelement_ IMG onclick= "showimg (THIS.SRC); return false;" border=0 alt= use Monitor to monitor your Linux server 6 src= "http://images.51cto.com/files/ Uploadimg/20100203/1034075.gif "width=500>
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.