Zabbix SNMP Custom OID Nginx Monitor instance (55)

Source: Internet
Author: User

Why should I customize the OID?

In the previous article we've talked about how Zabbix uses SNMP to monitor the server, but he has one obvious limitation: only the well-defined OID project can be monitored, if we want to know if the nginx process is running? What should we do without the Zabbix agent? Next, use this power to explain the custom OID .

Confirm that the SNMP OID is present

First we need to find out if an OID is being taken over by the system, such as. 1.3.6.1.4.1.2021.5000

# snmpwalk-v 2c-c public www.ttlsa.com. 1.3.6.1.4.1.2021.5000
ucd-snmp-mib::ucdavis.5000 = No Such Object available on the This agent in this OID

As stated above does not exist

To increase the custom SNMP OID

Writing scripts

# cat/root/scripts/check_nginx.sh
#!/bin/bash
Nginxnum= '/bin/psaux | /bin/grepnginx |wc-l '
Echo$nginxnum

Modify Configuration

# vim/etc/snmp/snmpd.conf
Extend. 1.3.6.1.4.1.2021.5000 check_nginx/root/scripts/check_nginx.sh//Add this line
Get SNMP Information

The following gets all the data for the custom OID, the first line is the data we need to get, then write the OID in Zabbix. 1.3.6.1.4.1.2021.5000.4.1.2.11.99.104.101.99.107.95.110.103.105.110.120.1

# snmpwalk-v 1-c public 173.219.255.122.1.3.6.1.4.1.2021.5000
ucd-snmp-mib::ucdavis.5000.1.0 = integer:1
ucd-snmp-mib::ucdavis.5000.2.1.2.11.99.104.101.99.107.95.110.103.105.110.120 = STRING: "/root/scripts/check_ Nginx.sh "
ucd-snmp-mib::ucdavis.5000.2.1.3.11.99.104.101.99.107.95.110.103.105.110.120 = ""
ucd-snmp-mib::ucdavis.5000.2.1.4.11.99.104.101.99.107.95.110.103.105.110.120 = ""
ucd-snmp-mib::ucdavis.5000.2.1.5.11.99.104.101.99.107.95.110.103.105.110.120 = Integer:5
ucd-snmp-mib::ucdavis.5000.2.1.6.11.99.104.101.99.107.95.110.103.105.110.120 = integer:1
ucd-snmp-mib::ucdavis.5000.2.1.7.11.99.104.101.99.107.95.110.103.105.110.120 = integer:1
ucd-snmp-mib::ucdavis.5000.2.1.20.11.99.104.101.99.107.95.110.103.105.110.120 = Integer:4
ucd-snmp-mib::ucdavis.5000.2.1.21.11.99.104.101.99.107.95.110.103.105.110.120 = integer:1
ucd-snmp-mib::ucdavis.5000.3.1.1.11.99.104.101.99.107.95.110.103.105.110.120 = STRING: "6"
ucd-snmp-mib::ucdavis.5000.3.1.2.11.99.104.101.99.107.95.110.103.105.110.120 = STRING: "6"
ucd-snmp-mib::ucdavis.5000.3.1.3.11.99.104.101.99.107.95.110.103.105.110.120 = integer:1
ucd-snmp-mib::ucdavis.5000.3.1.4.11.99.104.101.99.107.95.110.103.105.110.120 = integer:0
ucd-snmp-mib::ucdavis.5000.4.1.2.11.99.104.101.99.107.95.110.103.105.110.120.1 = STRING: "6"
Create SNMP Item

Snmp-oid

Get the latest data

SNMP gets nginx data

Next create the trigger and alarm, I will not say more, you can refer to the "Zabbix trigger"

Zabbix SNMP Custom OID Nginx Monitor instance (55)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.