日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

开发nagios插件监控/etc/passwd中文件变化

發(fā)布時間:2025/7/14 编程问答 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 开发nagios插件监控/etc/passwd中文件变化 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

環(huán)境:

nagios客戶端:centos6.5

[root@long63 nagios]# uname -r 2.6.32-431.el6.x86_64 [root@long63 nagios]# ifconfig eth0|grep "inet addr"|awk -F '[ :]' '{print $13}' 192.168.200.63  

nagios服務(wù)端:centos6.5?

[root@long62 /]# uname -r 2.6.32-431.el6.x86_64 [root@long62 nagios]# ifconfig eth0|grep "inet addr"|awk -F '[ :]' '{print $13}' 192.168.200.62

操作步驟:

第一步:【客戶端】開發(fā)腳本,并授權(quán)腳本

[root@long63 libexec]# cat check_md5_ps #!/bin/sh PROGNAME=`basename $0` PROGPATH=`dirname $0` . $PROGPATH/utils.sh OriMD5="d6f7ff0f80e82d8288cfb53f1be07808" CurrMd5=`md5sum /etc/passwd|cut -c 1-32` if [ "$OriMD5" == "$CurrMd5" ]thenecho "/etc/passwd:OK"exit 0 elseecho "/etc/passwd:flase"exit 2 fi

  

[root@long63 libexec]# chmod 755 check_md5_ps

  

第二步:【客戶端】在nrpe.cfg里面添加一行

command[check_md5]=/usr/local/nagios/libexec/check_md5_ps

  

第三步:【客戶端】重啟nrpe

[root@long63 libexec]# ps -ef|grep nrpe nagios 4258 1 0 08:24 ? 00:00:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d root 4262 4133 0 08:25 pts/0 00:00:00 grep nrpe [root@long63 libexec]# pkill nrpe [root@long63 libexec]# ps -ef|grep nrpe root 4265 4133 0 08:25 pts/0 00:00:00 grep nrpe [root@long63 libexec]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d [root@long63 libexec]# ps -ef|grep nrpe nagios 4267 1 0 08:25 ? 00:00:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d root 4269 4133 0 08:25 pts/0 00:00:00 grep nrpe

  

第四步【服務(wù)端】services.cfg里面添加服務(wù)

define service{use generic-servicehost_name 063-client01check_command check_nrpe!check_md5service_description md5_etc_passwdmax_check_attempts 3normal_check_interval 10retry_check_interval 2contact_groups adminsnotification_options w,u,c,rnotification_interval 60notification_period 24x7check_period 24x7 }

  

第五步:【服務(wù)端】重啟nagios服務(wù)

[root@long62 services]# /etc/init.d/nagios checkconfig Running configuration check... OK. [root@long62 services]# /etc/init.d/nagios reload Running configuration check...done. Reloading nagios configuration...done

結(jié)果驗證

轉(zhuǎn)載于:https://www.cnblogs.com/quanag/p/9137900.html

總結(jié)

以上是生活随笔為你收集整理的开发nagios插件监控/etc/passwd中文件变化的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。