Monitor Zabbix User-Defined OID
Monitor Zabbix User-Defined OID
1. Write the Monitoring Service script
[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 # Add a row
[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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould 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 (shocould be Timeticks): STRING: "5"
[Root @ db02 ~] #
2. Add categories, projects, and triggers in zabbix
3. view images
Some Zabbix Tutorials:
Compile and install Zabbix2.4.5 source code in Ubuntu 14.04
Install and deploy the distributed monitoring system Zabbix 2.06
Install and deploy the distributed monitoring system Zabbix 2.06
Install and deploy Zabbix in CentOS 6.3
Zabbix distributed monitoring system practice
Under CentOS 6.3, Zabbix monitors apache server-status
Monitoring MySQL database Parameters Using Zabbix in CentOS 6.3
Install Zabbix 2.0.6 in 64-bit CentOS 6.2
ZABBIX details: click here
ZABBIX: click here
This article permanently updates the link address: