From 9de78e1b3abdd5444ba604cebfda8960ddc4d66d Mon Sep 17 00:00:00 2001 From: newrain Date: Thu, 17 Jun 2021 11:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 28 ++----------------- zabbix-agentd.d/db.conf | 6 ++++ zabbix-agentd.d/os.conf | 10 +++++++ .../script/dbMonitor.sh | 0 .../script/osMonitor.sh | 0 5 files changed, 19 insertions(+), 25 deletions(-) create mode 100644 zabbix-agentd.d/db.conf create mode 100644 zabbix-agentd.d/os.conf rename dbMonitor.sh => zabbix-agentd.d/script/dbMonitor.sh (100%) rename osMonitor.sh => zabbix-agentd.d/script/osMonitor.sh (100%) diff --git a/README.md b/README.md index 3e0f90f..22369b4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# zabbix-monitor-userparameter +# zabbix-monitor-UserParameter #### 介绍 -zabbix 监控脚本,程序由全体千锋云计算2101班全体同仁开发 +zabbix 监控脚本 #### 软件架构 软件架构说明 @@ -17,20 +17,8 @@ zabbix 监控脚本,程序由全体千锋云计算2101班全体同仁开发 2. 将脚本放置在/etc/zabbix/zabbix-agentd.d/script/目录下 3. 设置执行权限 4. /etc/zabbix/zabbix-agentd.d/os.conf 设置user-parameter +5. zabbix客户端导入xml文件 -os.conf -```shell -userparameter=systemcheck.disk,sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Disk -userparameter=systemcheck.memory,sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Memory -userparameter=systemcheck.swap,sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Swap -userparameter=systemcheck.cpuload[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh CPULoad $1 -userparameter=systemcheck.file,sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh FileMD5 -userparameter=systemcheck.uptime[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Uptime $1 -userparameter=systemcheck.connect[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Conns $1 -userparameter=systemcheck.port[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Ports $1 -userparameter=systemcheck.service[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Services $1 -userparameter=systemcheck.crontab[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Crontab $1 -``` #### 参与贡献 @@ -39,13 +27,3 @@ userparameter=systemcheck.crontab[*],sh /etc/zabbix/zabbix-agentd.d/script/osMon 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/zabbix-agentd.d/db.conf b/zabbix-agentd.d/db.conf new file mode 100644 index 0000000..834c205 --- /dev/null +++ b/zabbix-agentd.d/db.conf @@ -0,0 +1,6 @@ +UserParameter=dbcheck.heartbeat[*],sh /etc/zabbix/zabbix-agentd.d/script/dbMonitor.sh $1 heartbeat +UserParameter=dbcheck.crud[*],sh /etc/zabbix/zabbix-agentd.d/script/dbMonitor.sh $1 crud $2 +UserParameter=dbcheck.twins[*],sh /etc/zabbix/zabbix-agentd.d/script/dbMonitor.sh $1 twins +UserParameter=dbcheck.slowlog[*],sh /etc/zabbix/zabbix-agentd.d/script/dbMonitor.sh $1 slowlog +UserParameter=dbcheck.config[*],sh /etc/zabbix/zabbix-agentd.d/script/dbMonitor.sh $1 config $2 +UserParameter=dbcheck.ruser[*],sh /etc/zabbix/zabbix-agentd.d/script/dbMonitor.sh $1 ruser \ No newline at end of file diff --git a/zabbix-agentd.d/os.conf b/zabbix-agentd.d/os.conf new file mode 100644 index 0000000..cc27c44 --- /dev/null +++ b/zabbix-agentd.d/os.conf @@ -0,0 +1,10 @@ +UserParameter=systemcheck.disk,sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Disk +UserParameter=systemcheck.memory,sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Memory +UserParameter=systemcheck.swap,sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Swap +UserParameter=systemcheck.cpuload[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh CPULoad $1 +UserParameter=systemcheck.file,sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh FileMD5 +UserParameter=systemcheck.uptime[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Uptime $1 +UserParameter=systemcheck.connect[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Conns $1 +UserParameter=systemcheck.port[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Ports $1 +UserParameter=systemcheck.service[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Services $1 +UserParameter=systemcheck.crontab[*],sh /etc/zabbix/zabbix-agentd.d/script/osMonitor.sh Crontab $1 \ No newline at end of file diff --git a/dbMonitor.sh b/zabbix-agentd.d/script/dbMonitor.sh similarity index 100% rename from dbMonitor.sh rename to zabbix-agentd.d/script/dbMonitor.sh diff --git a/osMonitor.sh b/zabbix-agentd.d/script/osMonitor.sh similarity index 100% rename from osMonitor.sh rename to zabbix-agentd.d/script/osMonitor.sh