Nagios's Monitored end configuration

Source: Internet
Author: User
Tags config curl openssl openldap

After completing the server-side setting of the Nagios, it is necessary to make the relevant settings on the monitored host side and set some monitoring parameter values.

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/soft/tools/

The complete configuration script is as follows:

#!/bin/bash #auto Configure Nagios Linux client side #2012 -12-05 nagios_dir= "/usr/local/nagios" 192.16 8.0.50 ' function Install_nagios {yum-y Install Install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng Libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2 -devel ncurses ncurses-devel Curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl* openssl-de Vel nss_ldap openldap openldap-devel openldap-clients openldap-servers libxslt-devel libevent-devel NTP Libtool-ltdl bis On Libtool vim-enhanced gd* useradd nagios cd/usr/local/src tar zxvf nagios-plugins- 1.4.16.tar.gz tar zxvf nrpe-2.13.tar.gz cd/usr/local/src/nagios-plugins-1.4.16 #编译安装nagios插件包./C Onfigure--prefix= $nagios _dir make;make install chown-r nagios:nagios $nagios _dir cd/usr/l ocal/src/nrpe-2.13 #编译安装Nrpe package./configure make all make Install-plugin make Install-daemon make Install-daemon-config function Set_nagios () {CD $nagios _dir/etc/sed-i.bak '/server_address/s/^#//' nrpe.cfg #修改主机的n  RPE configuration file Sed-i '/server_address/s/=.*$/=0.0.0.0/' nrpe.cfg sed-i '/allowed_hosts/s/^.*$/&, ' $nagiosrv '/' Nrpe.cfg sed-i ' 205acommand[check_disk]=/usr/local/nagios/libexec/check_disk-w 15%-C 5%-P/-p/b Oot ' nrpe.cfg #追加监控磁盘容量的命令 sed-i ' 206acommand[check_swap]=/usr/local/nagios/libexec/check_swap-w 30%-C 10% ' Nrpe. CFG #追加监控swap容量的命令} function Restart_nagios () #重启nrpe服务 {kill-9 ' cat/var/run/nrpe.pid ' >/ Dev/null 2>&1 $nagios _dir/bin/nrpe-c $nagios _dir/etc/nrpe.cfg-d} case $ in install) install 
_nagios;; 
config) Set_nagios;; 
restart) Restart_nagios;; *) echo "Usage sh nagiosclient.sh {install|confIg|restart} ";; Esac

This article is from the "Strive for" blog, please be sure to keep this source http://carllai.blog.51cto.com/1664997/1085691

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.