开发nagios插件监控/etc/passwd中文件变化
环境:
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服务端: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
操作步骤:
第一步:【客户端】开发脚本,并授权脚本
[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
第四步【服务端】services.cfg里面添加服务
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
}
第五步:【服务端】重启nagios服务
[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
结果验证
转载于:https://www.cnblogs.com/quanag/p/9137900.html
开发nagios插件监控/etc/passwd中文件变化相关推荐
- 开发chrome 插件, background.js中 console log 看不到解决方法
开发chrome 插件, background.js中 console log 看不到解决方法 参考文章: (1)开发chrome 插件, background.js中 console log 看不到 ...
- Android开发——AS插件批量解决XML中的String/Color/Dimen硬编码
1. 问题抛出 1.1 开发方面 对于日常开发中,每写一个"#333",都要手动的在当前xml与colors.xml中来回切换,查看是否已经定义过,如果定义过则拿过来复用,如果没有 ...
- python中文件变化监控-watchdog
起步 在python中文件监控主要有两个库,一个是pyinotify,一个是watchdog.pyinotify依赖于Linux平台的inotify,后者则对不同平台的的事件都进行了封装.因为我主要用 ...
- linux之同时监控多个日志文件变化
MultiTail是一个开源的ncurses的实用工具,可用于在一个窗口或单一外壳,显示实时一样的尾巴命令,该命令拆分控制台为更多子窗口的日志文件的最后几行(很像显示多个日志文件到标准输出屏幕命令 ) ...
- Wireshark lua 插件提取PCAP报文中文件,图片,视频
本文将介绍一种简单高效的方式提取 PCAP 报文中的文件,将通过PCAP报文中数字证书.图片.视频等为例进行讲述,作为我的专栏<wireshark从入门到精通>中的一篇. 首先简单说明一下 ...
- Python监控Windows下的文件变化
windows下监控文件系统的变化.用python非常方便.实例代码例如以下,非常easy.也不多说了. import os import win32fileimport win32conACTION ...
- 使用Vue3+Element Plus开发Chrome插件
使用Vue3+Element Plus开发Chrome插件 引言 初始Vue项目的创建 Element-Plus组件的安装及导入 其他文件配置 .eslintrc.js文件 vue.config.js ...
- 一文教会你如何用Vue开发Chrome插件
前言 作为一个常年的B端前端开发者来说,千篇一律的业务开发有着些许的枯燥无味.在联调过程中,会经常发现后端在部署服务,然后又不知什么时候部署好,由于公司的部署系统查看系统部署状态入口较深,所以闲暇之余 ...
- nagios全攻略(三)----使用插件监控更多信息
三. 使用命令和插件监控更多信息<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office&quo ...
最新文章
- 周记 2016.4.5
- android dialog 控件,android控件封装 自己封装的dialog控件
- sqlserver中查找存储过程中的关键字方法之二
- 01-复杂度2 Maximum Subsequence Sum (25 分)
- python自动化工具哪个好用_微软最强 Python 自动化工具开源了!不用写一行代码!...
- 7-6 求整数段和 (10 分)
- 已知: 每个飞机只有一个油箱, 飞机之间可以相互加油(注意是相互,没有加油机) 一箱油可供一架飞机绕地球飞半圈,问题:为使至少一架飞机绕地球一圈回到起飞时的飞机...
- 实战:基于Node的控制台记事本开发
- 小波变换和motion信号处理(一)
- mysql loader_Mysql的批量导入类 MySqlBulkLoader
- windows8没有剪贴板查看器clipbrd怎么办?
- 第六章-2 CS创建监听与payload
- Android编程权威指南(第31章 定制视图与触摸事件)
- js中的循环(跳过(continue)和中断执行(break))
- 每日一词——@FUnctionalInterface
- 鉴客 iPad横屏(Landscape)尺寸规格说明
- 基于Springboot的在线租车,自租车,企业租车管理系统,基于Idea开发
- 51nod 13831048 整数分解为2的幂 [递推]【数学】
- jsp和serverlet的区别
- 【日常积累】实验室作业Socket实现多个客户端相互通信。
热门文章
- 研究表明:安卓和iOS应用无节操滥用邮箱和定位数据
- 新增的querySelector、querySelectorAll测试
- TypeScript Type Innference(类型推断)
- ORA-25153: Temporary Tablespace is Empty
- 21、深入浅出MFC学习笔记,Application Framework简介
- Navicat使用教程:使用Navicat Query Analyzer优化查询性能(第1部分)
- 在 Swift 中调用 OC 代码
- scrapy中的request对象
- hive遇到FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask错误...
- ABP 重写主键ID