The use of Linux monitoring platform Nagios (ii) Monitoring-side environment deployment

Source: Internet
Author: User
Tags chmod config mysql

This is just a function of the monitoring side of the overall script installserver ()

The specific script is as follows:

#!/bin/bash #this is Nagios server or client install Shell #at 2012/10/29 path= ' pwd ' Httppath=/usr/lo Cal/apache2 mysqlpath=/usr/local/mysql Nagiospath=/usr/local/nagios installserver () {Yum install-y    
 xinetd useradd-m Nagios groupadd nagcmd useradd-a-G nagcmd nagios useradd-a-G nagcmd Apache CD $path tar-zxvf nagios-3.2.0.tar.gz cd nagios-3.2.0./configure--with-command-group=nagcmd--with-nagio    
 S-user=nagios--with-nagios-group=nagios make install make install-init make Install-config Make Install-commandmode make install-webconf echo ' ######################################## ' echo ' please Create the Nagios user for Apache "echo"----------------------------------------"Cat $path/http.txt >>/etc/http d/httpd.conf $httppath/bin/htpasswd-c $nagiospath/etc/htpasswd.users nagiosadmin chkconfig--add nagios C    
 Hkconfig Nagios onCD $path tar-zxvf nagios-plugins-1.4.14.tar.gz cd nagios-plugins-1.4.14./configure--prefix= $nagiospath- -with-nagios-user=nagios--with-nagios-group=nagios make make install CD $path TAR-ZXVF Nrpe-2.12.ta    
 r.gz CD nrpe-2.12./configure make all make install make install-plugin make Install-daemon    
 Make Install-daemon-config make install-xinetd read-p ' please input the Nagios server IP: ' ServerIP       echo "Nrpe 5666/tcp #nrpe" >>/etc/services sed-i "s#only_from.* #only_from = 127.0.0.1 $serverip # "/etc/xinetd.d/nrpe chkconfig--add xinetd chkconfig xinetd on service xinetd Restart CD $path tar-zxvf check_mysql_health-2.1.tar.gz cd check_mysql_health-2.1./configure--prefi X=/usr/local/nagios--with-nagios-user=nagios--with-nagios-group=nagios--with-perl=/usr/bin/perl make I Nstall Yum InstallPERL-DBI perl-dbd-mysql-y cd $path tar-zxvf check_iftraffic.tar.gz chmod +x check_iftraffic chmod +x check_mem.sh chmod +x check_cpu.sh chmod +x CP ip_conn.sh CP C Heck_cpu.sh/usr/local/nagios/libexec CP check_iftraffic/usr/local/nagios/libexec CP Ip_conn.sh/usr/local/nagi Os/libexec mv $path/cfg/server/etc/*/usr/local/nagios/etc mv $path/cfg/server/objects/*/usr/local/nagios/etc/o bjects chown-r Nagios.nagios/usr/local/nagios Service httpd Restart service xinetd restart echo "###
 ################################ "echo" ######### The result ######## "Echo-----------------------------------"     
 /usr/sbin/lsof-i:5666 echo "-----------------------------------"/usr/local/nagios/libexec/check_nrpe-h localhost }

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.