91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

nagios 客戶端一鍵安裝

發布時間:2020-07-25 19:58:40 來源:網絡 閱讀:483 作者:zhenxing_06 欄目:移動開發

                         nagios 客戶端一鍵安裝安裝

   此腳本為個人線上生產環境使用,不一定適合大眾,腳本寫的也很一般。希望大家多提意見。


1   這是改過之后的腳本,nrpe是放在xinetd里面啟動的. 讓nrpe的信息獨立存放(本處放空文件了),snmpd的日志也獨立存放。都不在寫入系統messages。


#!/bin/bash
#Date: 2013/12/6
useradd nagios
cd /usr/local/src
wget http://10.100.0.11/nagios-c.tar.gz
tar zxvf nagios-c.tar.gz
tar zxvf nagios-plugins-1.5.tar.gz
cd nagios-plugins-1.5
./configure
make
make install
chown nagios:nagios /usr/local/nagios
chown -R nagios:nagios /usr/local/nagios/libexec
cd ../
tar zxvf nrpe-2.15.tar.gz
cd nrpe-2.15
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
sed -i "s@allowed_hosts=127.0.0.1@allowed_hosts=127.0.0.1,10.100.0.11@" /usr/local/nagios/etc/nrpe.cfg
sed -i '/disable/i\        log_type        = file /dev/null' /etc/xinetd.d/nrpe
sed -i 's#127.0.0.1#10.100.0.11#' /etc/xinetd.d/nrpe
chkconfig xinetd on
service xinetd restart
netstat -an | grep 5666
if [ $? -eq 0 ];then
  echo -e "$R nrpe is start $E"
else
  echo -e "$R nrpe is not start!!!!!!! $E"
fi
echo -e "$R######################install snmpd ################################## $E"
rpm -qa | grep net-snmp
if [ $? -eq 0 ];then
   echo -e "$R net-snmp install ok! $E"
   sed -i 's#OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"#OPTIONS="-LS0-6d -Lf /var/log/snmpd.log -p /var/run/snmpd.pid"#' /etc/init.d/snmpd
   sed -i 's#access  notConfigGroup ""      any       noauth    exact  systemview none none#access  notConfigGroup ""      any       noauth    exact  all none none#' /etc/snmp/snmpd.conf
   sed -i 's#\#view all    included  .1                               80#view all    included  .1                               80#' /etc/snmp/snmpd.conf
   sed -i 's#com2sec notConfigUser  default       public#com2sec notConfigUser  10.100.0.11       100che#' /etc/snmp/snmpd.conf
else
   echo -e "$R snmpd is not install $E"
fi
service snmpd restart
chkconfig snmpd on
ps -ef | grep -v grep | grep snmpd
if [ $? -eq 0 ];then
   echo -e "$R snmpd is ok! $E "
else
   echo -e "$R snmpd is error $E"
fi



2   傳統腳本,所有信息都是按照基本方式來的:


useradd nagios
cd /usr/local/src
#wget http://nchc.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
#wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gz
#wget https://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz
#wget http://jaist.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
wget http://10.100.0.11/nagios-c.tar.gz
tar zxvf nagios-c.tar.gz
tar zxvf nagios-plugins-1.5.tar.gz
cd nagios-plugins-1.5
./configure
make
make install
chown nagios:nagios /usr/local/nagios
chown -R nagios:nagios /usr/local/nagios/libexec
cd ../
tar zxvf nrpe-2.15.tar.gz
cd nrpe-2.15
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
sed -i 's@allowed_hosts=127.0.0.1@allowed_hosts=127.0.0.1,10.100.0.11@' /usr/local/nagios/etc/nrpe.cfg
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
#check /etc/rc.local in nrpe process:
grep "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" /etc/rc.local
if  [ $? -eq 0 ];then
    echo "nrpe existing , not Don't need to write."
else
    echo " nrpe is not install ,but already write /etc/rc/local file. "
    echo "###this is nagios client BY:renzhenxing date:$(date +%F)" >> /etc/rc.local
    echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >> /etc/rc.local
fi
netstat -an | grep -v "grep" | grep 5666
if [ $? -eq 0 ];then
  echo "nrpe is start "
else
  echo "nrpe is not start!!!!!!!"
fi


至此完成



向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

敦化市| 乌兰察布市| 岑溪市| 江山市| 东方市| 黑水县| 十堰市| 西城区| 盐亭县| 南康市| 琼结县| 定远县| 苍溪县| 四平市| 辰溪县| 峨山| 桐庐县| 安塞县| 鄂托克前旗| 贵定县| 武安市| 柳林县| 乐业县| 罗定市| 揭西县| 新安县| 新昌县| 嘉定区| 灵璧县| 阿城市| 共和县| 凤山县| 高密市| 彭泽县| 马鞍山市| 开封县| 宣城市| 咸阳市| 巴南区| 咸宁市| 青河县|