中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

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

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

nagios監控的安裝

發布時間:2020-05-25 12:47:32 來源:網絡 閱讀:714 作者:飛俠119 欄目:移動開發

一.服務端的安裝

所需的安裝包:http://pan.baidu.com/s/1dFKaM8D

環境:centos7  IP:192.168.217.131

(1)  step 1:install gcc and lamp env etc

yum install gccglibc glibc-common -y

yum install gdgd-devel -y

yum installhttpd php php-gd -y

yum installmysql* -y

 

(2) step 2:add nagios  user and group

/usr/sbin/useradd-m nagios

#/usr/sbin/useraddapache

/usr/sbin/groupaddnagcmd

/usr/sbin/usermod-a -G nagcmd nagios

/usr/sbin/usermod-a -G nagcmd apache

 

(3)  step 3:download and install nagios

unzipoldboy_training_nagios_soft.zip

tar xzfnagios-3.5.1.tar.gz

cd nagios

./configure 【--with-group=nagios --with-user=nagios

--with-command-group=nagcmd

make all

make install

makeinstall-init

makeinstall-config

makeinstall-commandmode

makeinstall-webconf          #出現404,說明沒執行這個

(4)  step 4:config web auth

htpasswd -cb/usr/local/nagios/etc/htpasswd.users tong 123456 //用戶認證,登錄nagios

 

(5) step 5:install nagios-plugins

yum -y installperl-devel

tar zxfnagios-plugins-2.1.1.tar.gz

cdnagios-plugins-2.1.1

./configure--with-nagios-user=nagios --with-nagios-group=nagios --

enable-perl-modules

make &&make install

ls /usr/local/nagios/libexec/|wc-l     看有幾個

 

(6)  step 6:install nrpe

tar zxvfnrpe-2.12.tar.gz

cd nrpe-2.12

./configure

make all

makeinstall-plugin

makeinstall-daemon

makeinstall-daemon-config

 

(7)  step 7:startup service and check

/etc/init.d/nagios start

service httpd start

echo -----------

lsof -i tcp:80

echo ----------

ps -ef|grepnagios   沒進程就iptables -F

echo"NAGIOS is successfully installed."

echo ok

我的訪問地址:http://192.168.217.131/nagios/


二.客戶端的安裝

環境:centos7   IP:192.168.217.137

(1)  step 1: add nagios user

#useradd -mnagios -s /sbin/nologin

 

(2)  step 2: install nagios-plugins  

yum -y install perl-devel

tar zxfnagios-plugins-2.1.1.tar.gz

cdnagios-plugins-2.1.1

./configure--prefix=/usr/local/nagios --enable-perl-modules --enable-redhat-pthread-workaround

make &&make install

ls/usr/local/nagios/libexec/|wc -l

 

(3)  step 3: install nrpe     

tar zxfnrpe-2.12.tar.gz

cd nrpe-2.12

./configure

make all

makeinstall-plugin

makeinstall-daemon

makeinstall-daemon-config

 

(4)  step 4: install soft for iostat   

tar zxvfParams-Validate-0.91.tar.gz

cdParams-Validate-0.91

perl Makefile.PL

make 

make install

#----------------------------------------

tar zxvfClass-Accessor-0.31.tar.gz

cdClass-Accessor-0.31

perl Makefile.PL

make

make install

#----------------------------------------

tar zxvfConfig-Tiny-2.12.tar.gz

cd Config-Tiny-2.12

perl Makefile.PL

make

make install

#----------------------------------------

tar zxvfMath-Calc-Units-1.07.tar.gz

cdMath-Calc-Units-1.07

perl Makefile.PL

make

make install

#----------------------------------------

tar zxvfRegexp-Common-2010010201.tar.gz

cdRegexp-Common-2010010201

perl Makefile.PL

make

make install

#----------------------------------------

tar zxvfNagios-Plugin-0.34.tar.gz

cdNagios-Plugin-0.34

perl Makefile.PL

make

make install

#______________________

#for monitoriostat

yum installsysstat -y

check_memory.pl安裝包有】

/bin/cp/home/oldboy/tools/check_memory.pl /usr/local/nagios/libexec

/bin/cp/home/oldboy/tools/check_iostat /usr/local/nagios/libexec

 

chmod 755/usr/local/nagios/libexec/check_memory.pl

chmod 755/usr/local/nagios/libexec/check_iostat

 

yum install -ydos2unix

dos2unix/usr/local/nagios/libexec/check_memory.pl

dos2unix/usr/local/nagios/libexec/check_iostat

ls/usr/local/nagios/libexec/|wc -l   插件數量

 

(5)  step 5: 修改nrpe.cfg

cd/usr/local/nagios/etc/  #配置文件路徑

#cp nrpe.cfgnrpe.cfg.bk   備份

#vim nrpe.cfg+79

perl -pi -e 's/allowed_hosts=127.0.0.1/

allowed_hosts=127.0.0.1,192.168.217.131(服務端)/g'

#delete 199--203【刪掉的行】

cp/usr/local/nagios/etc/nrpe.cfg /usr/local/nagios/etc/nrpe.cfg.ori #復制

sed -i'199,203d' /usr/local/nagios/etc/nrpe.cfg

 

echo"command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,6

-c30,25,20">>/usr/local/nagios/etc/nrpe.cfg

 

echo"command[check_mem]=/usr/local/nagios/libexec/check_memory.pl -w 6%

-c3%">>/usr/local/nagios/etc/nrpe.cfg

 

echo"command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c

8% -p/">>/usr/local/nagios/etc/nrpe.cfg

 

echo"command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c

10%">>/usr/local/nagios/etc/nrpe.cfg

 

echo"command[check_iostat]=/usr/local/nagios/libexec/check_iostat -w 6

-c10">>/usr/local/nagios/etc/nrpe.cfg

(6)  step 6: start nagios client

#start nagiosclient

pkill nrpe

sleep 2

#/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d #啟動

 

#echo"/usr/local/nagios/bin/nrpe -c- /usr/local/nagios/etc/nrpe.cfg -

d">>/etc/rc.local         開機自動啟動

 

#netstat-lnt|grep 5666 && echo "nagios client is ok"

nagios監控的安裝


三.登錄驗證:

nagios監控的安裝

nagios監控的安裝

由于沒有啟動客戶端的機器,所以只能看到服務器的機器up

向AI問一下細節

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

AI

峨山| 襄汾县| 宁陕县| 温宿县| 抚远县| 长丰县| 靖宇县| 五大连池市| 成安县| 牡丹江市| 大化| 枝江市| 章丘市| 泰顺县| 天峻县| 长垣县| 密山市| 宁明县| 怀宁县| 六枝特区| 通山县| 吉木乃县| 临颍县| 宕昌县| 凌源市| 云梦县| 乌鲁木齐市| 当涂县| 安丘市| 湟源县| 隆尧县| 平遥县| 静乐县| 叶城县| 原平市| 本溪| 固原市| 定边县| 临泽县| 炉霍县| 丰都县|