您好,登錄后才能下訂單哦!
nagios4.2.4 添加被監(jiān)控端
Install:
epel源
yum install -y nagios yum install -y nagios-plugins-all
private 目錄下面的resource.cfg 文件記錄 插件位置
監(jiān)控、被監(jiān)控都需要nrpe
yum install -y nrpe
/etc/nagios/nrpe.cfg 命令需要修改
安裝完成以后
一、監(jiān)控端
1、修改配置文件
vim /etc/nagios/nrpe.cfg allow hosts = 127.0.0.1 /usr/lib64/nagios/plugins/ //各插件存放路徑
vim /etc/nagios/objects/command.cfg
最后加入,支持pnp以及check_nrpe
#'check_nrpe' command definition define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ } # Bulk with NPCD mode # define command { command_name process-service-perfdata-file command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$ } define command { command_name process-host-perfdata-file command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$ }
vim /etc/nagios/nagios.cfg
cfg_dir=/etc/nagios/servers //指定被監(jiān)控的主機(jī)配置文件的存放路徑
創(chuàng)建 /etc/nagios/servers/s0.cfg 關(guān)于s0的相關(guān)監(jiān)控項(xiàng)
可以自行添加監(jiān)視的服務(wù)
define host{ use linux-server,host-pnp host_name s0 alias s0 address 192.168.1.88 } define service{ use generic-service,srv-pnp host_name s0 service_description load負(fù)載 check_command check_nrpe!check_load }
二、被監(jiān)控端
vim /etc/nagios/nrpe.cfg
allow hosts = 192.168.1.202 (監(jiān)控端服務(wù)器) /usr/lib64/nagios/plugins/ //執(zhí)行命令存放的路徑 在s0.cfg需要的命令在此文件中 command[check_tomcat1]=/usr/lib64/nagios/plugins/check_service tomcat1 #檢查tomcat1服務(wù)的狀態(tài),需要check_service這個(gè)監(jiān)控插件
具體文件見(jiàn)百度云網(wǎng)盤(pán)
nrpe.cfg 里面加上command[check_tomcat1] 以后 不重啟nrpe 監(jiān)控中會(huì)提示 check_tomcat1,沒(méi)有定義
歡迎打算使用阿里云服務(wù)器的小伙伴,加我私聊??!QQ:3533470970 或直接領(lǐng)取阿里云幸運(yùn)券:https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=b6h928qb&utm_source=b6h928qb
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。