Nagios Installation and Configuration

Source: Internet
Author: User
<span id="Label3"></p><p><p>Prepare to check the environment before installation</p></p><p><p>Iptables-f</p></p><p><p>Setenforce 0</p></p><p><p><br></p></p><p><p>#gcc环境 the lamp environment and some other Nagios dependency packages</p></p><p><p>Yum-y Install gcc* yum-y install httpd mysql mysql-server mysql-devel php php-server glibc glibc-common *gd*</p></p><p><p><br></p></p><p><p>#添加nagios运行所需要的用户和组</p></p><p><p>Groupadd Nagcmd</p></p><p><p>Useradd-g Nagcmd Nagios</p></p><p><p>Usermod-g Nagcmd Apache</p></p><p><p><br></p></p><p><p>#编译安装nagios</p></p><p><p>Mkdir/cdrom</p></p><p><p>Cp-a/cdrom/*.</p></p><p><p>TAR-XF nagios-3.3.1. tar.gz</p></p><p><p><br></p></p><p><p>CD Nagios</p></p><p><p>./configure--with-commadn-group=nagcmd--enable-event-broker</p></p><p><p><br></p></p><p><p>Make all && make install && make install-init make Install-commandmode make Install-config && make Install-webconf</p></p><p><p><br></p></p><p><p>2. Generate a password file</p></p><p><p>Htpasswd-c/usr/local/nagios/etc/htpasswd.user Nagiosadmin</p></p><p><p><br></p></p><p><p><br></p></p><p><p>Service httpd Restart</p></p><p><p><br></p></p><p><p>View effects in the browser enter a user name and password</p></p><p><p><br></p></p><p><p>Installing the plug-in manager nagios-plugins</p></p><p><p><br></p></p><p><p>Unzip the compilation</p></p><p><p><br></p></p><p><p>TAR-XF nagios-plugins-1.4.14.tar.gz</p></p><p><p><br></p></p><p><p>cd/root/nagios-plugins-1.4.14</p></p><p><p><br></p></p><p><p>./configure--with-nagios-user=nagios--wtih-nagios-group=nagios--with-mysql--enable-perl-modules</p></p><p><p><br></p></p><p><p>Make && make install</p></p><p><p><br></p></p><p><p>Configure and start Nagios</p></p><p><p><br></p></p><p><p>Chkconfig--add Nagios</p></p><p><p><br></p></p><p><p>Chkconfig Nagios on</p></p><p><p><br></p></p><p><p>/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg</p></p><p><p>#此命令用来检测语法</p></p><p><p><br></p></p><p><p>Service Nagios Start<br></p></p><p><p><br></p></p><p><p><br></p></p><p><p>Monitoring of Windows hosts</p></p><p><p>Install Nsclient + +</p></p><p><p>650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M00/97/7C/wKioL1kuvLWgiiQmAAHnwrnGzfg551.png-wh_500x0-wm_ 3-wmp_4-s_343906951.png "title=" image 1.png "alt=" wkiol1kuvlwgiiqmaahnwrngzfg551.png-wh_50 "/></p></p><p><p>650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M02/97/7B/wKiom1kuvM2xUXtxAAFafFzoA8k079.png-wh_500x0-wm_ 3-wmp_4-s_11602377.png "title=" image 2.png "alt=" wkiom1kuvm2xuxtxaafaffzoa8k079.png-wh_50 "/></p></p><p><p><br></p></p><p><p>Server-side Settings Windows monitoring</p></p><p><p>Cd/usr/local/nagios</p></p><p><p><br></p></p><p><p>CD etc/</p></p><p><p><br></p></p><p><p>CD objects/</p></p><p><p>650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M02/97/7C/wKioL1kuvRaQPLddAAA6D4TSrZs878.png-wh_500x0-wm_ 3-wmp_4-s_4116598372.png "title=" image 3.png "alt=" wkiol1kuvraqplddaaa6d4tsrzs878.png-wh_50 "/></p></p><p><p>#进入nagios主目录, Enabling windows-enabled Support</p></p><p><p><br></p></p><p><p>Vim NAGIOS.CF</p></p><p><p><br></p></p><p><p>Vim/usr/local/nagios/etc/objects/contacts.cfg</p></p><p><p><br></p></p><p><p>#39 cfg_file=/usr/local/nagios/etc/objects/windows.cfg</p></p><p><p><br></p></p><p><p>Vim/usr/local/nagios/etc/objects/contacts.cfg</p></p><p><p><br></p></p><p><p>#35 Email [email protected] Alarm Mailbox According to the actual change to find a software best then use QQ mailbox and then associated QQ number then you can know the alarm</p></p><p><p><br></p></p><p><p>Detect and start the Nagios service</p></p><p><p><br></p></p><p><p>/usr/local/nagios/bin/nagios-v/usr/local/ngios/etc/nagios.cfg</p></p><p><p><br></p></p><p><p>Service Nagios Restart</p></p><p><p><br></p></p><p><p>Monitoring of Linux</p></p><p><p><br></p></p><p><p>Installing Gcc,openssl Openssl-devel</p></p><p><p>Yum-y Install OpenSSL Openssl-devel</p></p><p><p><br></p></p><p><p><br></p></p><p><p>Installing the plug-in manager nagios-plugins</p></p><p><p><br></p></p><p><p>Create a Nagios user, or you will get an error</p></p><p><p><br></p></p><p><p>Useradd Nagios</p></p><p><p><br></p></p><p><p>Cd/root</p></p><p><p>TAR-XF nagios-plugins-1.4.14.tar.gz</p></p><p><p><br></p></p><p><p>CD nagios-plugins-1.4.14</p></p><p><p><br></p></p><p><p>./configure--with-nagios-user=nagios--with-nagios-group=nagios</p></p><p><p><br></p></p><p><p>Make a && make install</p></p><p><p><br></p></p><p><p>Install Nrpe ensure Openssl,openss-devel is installed</p></p><p><p><br></p></p><p><p>TAR-XF nrpe-2.8.1.tar.gz</p></p><p><p><br></p></p><p><p>CD nrpe-2.8.1</p></p><p><p><br></p></p><p><p>./configure--enable-ssl--with-ssl-lib=/usr/lib</p></p><p><p><br></p></p><p><p>Make all</p></p><p><p><br></p></p><p><p>Make Install-plugin</p></p><p><p><br></p></p><p><p>Make Install-daemon</p></p><p><p><br></p></p><p><p>Make Install-daemon-config</p></p><p><p><br></p></p><p><p>Vim/usr/local/nagios/etc/nrpe.cfg</p></p><p><p><br></p></p><p><p>allowed_hosts=192.168.121.1 127.0.0.1</p></p><p><p><br></p></p><p><p>/usr/local/nagios/bin/nrpe-c/usr/local/nagios/etc/nrpe.cfg-d</p></p><p><p><br></p></p><p><p><br></p></p><p><p>service-loaded</p></p><p><p>Nagios-plugins</p></p><p><p><br></p></p><p><p>./configure--enable-ssl--with-ssl-lib=/usr/lib</p></p><p><p><br></p></p><p><p>Make all</p></p><p><p><br></p></p><p><p>Make Install-plugin</p></p><p><p><br></p></p><p><p>cd/usr/local/nagios/etc/</p></p><p><p><br></p></p><p><p>CD objects/</p></p><p><p><br></p></p><p><p>Ls</p></p><p><p><br></p></p><p><p>Vim Linux.cfg</p></p><p><p><br></p></p><p><p>650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M00/97/7C/wKioL1kuv66yyK0gAABpH1pOC84026.png-wh_500x0-wm_ 3-wmp_4-s_2250905106.png "title=" image 4.png "alt=" wkiol1kuv66yyk0gaabph1poc84026.png-wh_50 "/></p></p><p><p><br></p></p><p><p>Vim Cmmands.cfg</p></p><p><p><br></p></p><p><p>650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M00/97/7B/wKiom1kuv8-zkdD7AABlpWdUUzQ292.png-wh_500x0-wm_ 3-wmp_4-s_1400176457.png "title=" image 5.png "alt=" wkiom1kuv8-zkdd7aablpwduuzq292.png-wh_50 "/></p></p><p><p>To enable a custom liunx.cfg file</p></p><p><p><br></p></p><p><p>Vim/usr/local/nagios/etc/nagios.cfg</p></p><p><p><br></p></p><p><p>31# cfg_file=/usr/local/nagios/etc/objects/linux.cfg</p></p><p><p><br></p></p><p><p><br></p></p><p><p>Detect and enable</p></p><p><p>/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg</p></p><p><p><br></p></p><p><p>Service Nagios Restart</p></p><p><p><br></p></p><p><p>Monitoring of services</p></p><p><p>Client</p></p><p><p><br></p></p><p><p>Yum-y install MySQL Mysql-server</p></p><p><p><br></p></p><p><p>Service mysqld Start</p></p><p><p><br></p></p><p><p>Mysqladmin-uroot password ' 123123 '</p></p><p><p><br></p></p><p><p>Mysql-uroot-p</p></p><p><p><br></p></p><p><p>Create DATABASE nagios;</p></p><p><p><br></p></p><p><p>Grant Selcet on nagios.* to [e-mail protected] '% ' identifed by ' 123123 ';</p></p><p><p><br></p></p><p><p>Select User,password,host from mysql.user;</p></p><p><p><br></p></p><p><p>Server check to see if you can connect to the database</p></p><p><p><br></p></p><p><p>/usr/local/nagios/libexec/check_mysql-h 192.168.121.1-u nagios-d nagios-p 123123</p></p><p><p><br></p></p><p><p>Vim mysql.cfg650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M02/97/7D/wKioL1kuwQuxjc2_ Aabkkoqbdec647.png-wh_500x0-wm_3-wmp_4-s_3447235062.png "title=" image 6.png "alt=" wkiol1kuwquxjc2_ Aabkkoqbdec647.png-wh_50 "/></p></p><p><p><br></p></p><p><p><br></p></p><p><p>Startup configuration</p></p><p><p>Vim/usr/local/nagios/etc/nagios.cfg</p></p><p><p>650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M00/97/7D/wKioL1kuwTyAAWYCAAB272MIMzY711.png-wh_500x0-wm_ 3-wmp_4-s_4234417854.png "title=" image 7.png "alt=" wkiol1kuwtyaawycaab272mimzy711.png-wh_50 "/></p></p><p><p><br></p></p><p><p>Vim Commadns.cfg</p></p><p><p>650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M01/97/7C/wKiom1kuwV3zwblhAABrBhiWuEo149.png-wh_500x0-wm_ 3-wmp_4-s_3465004235.png "title=" image 8.png "alt=" wkiom1kuwv3zwblhaabrbhiwueo149.png-wh_50 "/></p></p><p><p>Detect Start Nagios</p></p><p><p>/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg</p></p><p><p><br></p></p><p><p>Service Nagios Restart</p></p><p><p><br></p></p><p><p>View in Browser</p></p><p><p><br></p></p><p><p><br></p></p><p><p>This article is from the "lingyu technology blog" blog, Make sure to keep this source http://lampit.blog.51cto.com/12958178/1931116</p></p><p><p>Nagios Installation and Configuration</p></p></span>

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.