阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

监控Zabbix自定义OID

224次阅读
没有评论

共计 2730 个字符,预计需要花费 7 分钟才能阅读完成。

监控 Zabbix 自定义 OID

1. 写监控服务的脚本

[root@db02 ~]# cat mysqlstat.sh
#!/bin/bash

mysqlstat=`ps aux | grep mysql | wc -l`
echo $mysqlstat
[root@db02 ~]# ./mysqlstat.sh
3

[root@db02 ~]# snmpwalk -v 2c -c public localhost .1.3.6.1.2.1.1.9.1.4.100
SNMPv2-MIB::sysORUpTime.100 = No Such Instance currently exists at this OID
[root@db02 ~]# vim /etc/snmp/snmpd.conf
extend .1.3.6.1.2.1.1.9.1.4.100  mysqlstat /root/mysqlstat.sh    #添加一行

[root@db02 ~]# /etc/init.d/snmpd restart
Stopping snmpd:                              [OK]
Starting snmpd:                                [OK]
[root@db02 ~]# snmpwalk -v 2c -c public localhost -On  .1.3.6.1.2.1.1.9.1.4.100
.1.3.6.1.2.1.1.9.1.4.100.1.0 = Wrong Type (should be Timeticks): INTEGER: 1
.1.3.6.1.2.1.1.9.1.4.100.2.1.2.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): STRING: “/root/mysqlstat.sh”
.1.3.6.1.2.1.1.9.1.4.100.2.1.3.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): “”
.1.3.6.1.2.1.1.9.1.4.100.2.1.4.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): “”
.1.3.6.1.2.1.1.9.1.4.100.2.1.5.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): INTEGER: 5
.1.3.6.1.2.1.1.9.1.4.100.2.1.6.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): INTEGER: 1
.1.3.6.1.2.1.1.9.1.4.100.2.1.7.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): INTEGER: 1
.1.3.6.1.2.1.1.9.1.4.100.2.1.20.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): INTEGER: 4
.1.3.6.1.2.1.1.9.1.4.100.2.1.21.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): INTEGER: 1
.1.3.6.1.2.1.1.9.1.4.100.3.1.1.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): STRING: “5”
.1.3.6.1.2.1.1.9.1.4.100.3.1.2.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): STRING: “5”
.1.3.6.1.2.1.1.9.1.4.100.3.1.3.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): INTEGER: 1
.1.3.6.1.2.1.1.9.1.4.100.3.1.4.9.109.121.115.113.108.115.116.97.116 = Wrong Type (should be Timeticks): INTEGER: 0
.1.3.6.1.2.1.1.9.1.4.100.4.1.2.9.109.121.115.113.108.115.116.97.116.1 = Wrong Type (should be Timeticks): STRING: “5”
[root@db02 ~]#

 

2. 在 zabbix 添加分类, 项目和触发器

监控 Zabbix 自定义 OID

监控 Zabbix 自定义 OID

监控 Zabbix 自定义 OID

3. 查看图形

监控 Zabbix 自定义 OID

一些 Zabbix 相关教程集合

Ubuntu 14.04 下 Zabbix2.4.5 源码编译安装  http://www.linuxidc.com/Linux/2015-05/117657.htm

安装部署分布式监控系统 Zabbix 2.06 http://www.linuxidc.com/Linux/2013-07/86942.htm

《安装部署分布式监控系统 Zabbix 2.06》http://www.linuxidc.com/Linux/2013-07/86942.htm

CentOS 6.3 下 Zabbix 安装部署 http://www.linuxidc.com/Linux/2013-05/83786.htm

Zabbix 分布式监控系统实践 http://www.linuxidc.com/Linux/2013-06/85758.htm

CentOS 6.3 下 Zabbix 监控 apache server-status http://www.linuxidc.com/Linux/2013-05/84740.htm

CentOS 6.3 下 Zabbix 监控 MySQL 数据库参数 http://www.linuxidc.com/Linux/2013-05/84800.htm

64 位 CentOS 6.2 下安装 Zabbix 2.0.6   http://www.linuxidc.com/Linux/2014-11/109541.htm

ZABBIX 的详细介绍:请点这里
ZABBIX 的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-04/130745.htm

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计2730字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中