One-click Automated installation of Nagios client

Source: Internet
Author: User

Statement

The Stars last night

Blog:http://yestreenstars.blog.51cto.com/

This article by oneself creation, if need reprint, please indicate source, thank cooperation!

Objective

Automate the installation of Nagios clients with one click.

Environment

Os:centos 6.2 32

nagios-plugins:2.0.3

nrpe:2.15

configure

#!/bin/bash# script name: one-key automatic install nagios client#  author: yestreenstars# create time: 2014-08-08nagios_server_ip= "192.168.1.88"  #  Change this to your nagios server ' s ip.echo -n  '--Install related  software ... "Yum -y install wget openssl openssl-devel > /dev/null  2>&1 && echo  "completed!" echo -n  "--install nagios-plugins ..." useradd -m -s /sbin/nologin nagioswget  -p /tmp http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz > /dev/ null 2>&1 | |   (echo  "failure!"  && exit) tar xzf /tmp/nagios-plugins-2.0.3.tar.gz -c /usr/src/cd / USR/SRC/NAGIOS-PLUGINS-2.0.3/(./configure && make && make install)  > /dev/null 2>&1 && echo  "completed!" echo -n  "--installing nrpe ..." wget -p /tmp http://sourceforge.net/projects/ nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz > /dev/null 2>&1 | |   (echo  "failure!"  && exit) tar xzf /tmp/nrpe-2.15.tar.gz -c /usr/src/cd /usr/src/ NRPE-2.15/(./configure &&make all &&make install-plugin && Make install-daemon &&make install-daemon-config)  > /dev/null 2> &1 && echo  "completed!" chown -r nagios:nagios /usr/local/nagios/echo -n  "--setting nrpe ..." sed -i   '/^allowed_hosts=/s/$/, ' $nagios _server_ip '/'  /usr/local/nagios/etc/nrpe.cfg/usr/local/nagios/bin/ nrpe -c /usr/local/nagios/etc/nrpe.cfg -d  echo  "/usr/local/nagios/bin/nrpe&nbSp;-c /usr/local/nagios/etc/nrpe.cfg -d " >> /etc/rc.localiptables -i input  -p tcp --dport 5666 -j acceptservice iptables save > / dev/null 2>&1 && echo  "completed!"


This article is from the "Last Night Stars" blog, please make sure to keep this source http://yestreenstars.blog.51cto.com/1836303/1537255

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.