1.[root@bjjk ~]# vi /usr/local/nagios/etc/objects/commands.cfg
慶元網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),慶元網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為慶元上千家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站建設(shè)要多少錢,請找那個售后服務(wù)好的慶元做網(wǎng)站的公司定做!
添加新內(nèi)容:
define command{ command_name check_tomcat_8080 command_line $USER1$/check_http -I $HOSTADDRESS$ -p $PORT$ -u $URL$ -e $N200$ -w $Warning$ -c $Cri$ }
2.[root@bjjk ~]# vi /usr/local/nagios/etc/objects/services.cfg
添加監(jiān)控服務(wù)項:
##############################tomcat-076 check_tomcat_8080##################################### define service{ host_name tomcat-076 service_description check_tomcat_8080 check_command check_nrpe!check_tomcat_8080 max_check_attempts 5 normal_check_interval 5 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r contact_groups yunwei }
3.檢查是否正確
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
4.客服端添加監(jiān)控項
[root@tomcat-076 tomcat]#vi /usr/local/nagios/etc/nrpe.cfg log_facility=daemon pid_file=/var/run/nrpe.pid server_port=5666 nrpe_user=nagios nrpe_group=nagios allowed_hosts=127.0.0.1,X.X.X.X dont_blame_nrpe=0 debug=0 command_timeout=60 connection_timeout=300 command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10 command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20 command[check_mem]=/usr/local/nagios/libexec/check_mem 70 80 command[check_disks]=/usr/local/nagios/libexec/check_disks 70 80 command[check_ipcons]=/usr/local/nagios/libexec/check_ipcons 3000 5000 command[check_tomcat_8080]=/usr/local/nagios/libexec/check_http -I 192.168.1.77 -p 80 -u /AdCollectT/ok.html -e 200 -w 5 -c 10
5.啟動nrpe
[root@tomcat-076 tomcat]#/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
6.重啟nagios服務(wù)端
service nagios reload
7.查看是否成功
網(wǎng)站標(biāo)題:nagios通過check_http監(jiān)控tomcat
URL地址:http://jinyejixie.com/article40/gpidho.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供用戶體驗、面包屑導(dǎo)航、云服務(wù)器、服務(wù)器托管、品牌網(wǎng)站設(shè)計、定制開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)