Zabbix common keys and custom keys

Source: Internet
Author: User

Several keys commonly used in zabbix:

1. net. tcp. port [, 3306]/usr/local/zabbix/bin/-s192.168.8.120-knet. tcp. port [, 3306] returns the existence of port 3306 with 1 as 192.168.8.120, and the absence of 0. 2. The monitored process: proc. num [mysqld]/usr/local/zabbix/bin/zabbix_get-s192.168.8.120-kproc. num [mysqld] returns the number of mysqld processes in 192.168.8.120/usr/local/zabbix/bin/zabbix_get-s192.168.8.120-kproc. num [] returns the number of all processes in 192.168.8.120. 3. view the number of CPU cores: system. cpu. the return value of num is the number of cores of the server CPU. 4. view the system startup time and current time: system. boottime, System. the return value of localtime is the system start time and current time. It is in the timestamp format. 5. view the simple information of the system: system. the return value of uname is 192.168.8.120, which is similar to linux's uname-a Command 6. view the inbound and outbound traffic of the current network card of windowns: net. if. out [{HOST. NAME}, bytes], net. if. in [{HOST. NAME}, bytes] and key: net. if. out [eth0, bytes], net. if. in [eth0, bytes] is the same as/usr/local/zabbix/bin/zabbix_get-s192.168.8.120-knet. if. in [192.168.8.120, bytes] returns the incoming traffic whose IP address is 192.168.8.120. This value is the Count value, measured in bytes, minus the value obtained last time, divided by the time interval for this period of time average traffic/u Sr/local/zabbix/bin/zabbix_get-s192.168.8.120-knet. if. out [192.168.8.120, bytes] returns outbound traffic whose IP address is 192.168.8.120. This value is the Count value, measured in bytes, minus the value obtained last time, divided by the interval, the average traffic for this period of time 7. view the system memory size: vm. memory. size [total], return value unit: bytes8, View File size: vfs. file. size [file], for example, vfs. file. size [/var/log/syslog] returns the size of/var/log/syslog. The unit is bytes9. Check whether the file exists: vfs. file. if the exists [file] file exists, 0 is returned and 110 is not returned. Check the MD5: vfs of the file. file. md5sum [file]: Check the MD5 value of a small file and return the MD5 value (it seems that only Versions later than 2.0 have This key) 11. Two keys: net. if. discovery, vfs. fs. this template is available in the discovery, windows, and linux monitoring templates (Version 2.0 and later). The application can be a commonly used key, in fact, the monitoring server is nothing more than memory, hard disk usage, CPU load, traffic, servers and ports. If you want to monitor others, you can use custom keys. I like custom keys and write a script to return the desired monitoring results. zabbix is doing very well in this field, highly scalable and supports various scripts to implement custom keys. To enable the custom key, enable the UnsafeUserParameters = 1 parameter in the client configuration file, and then define the key at the bottom of the configuration file, for example, UserParameter = free. disk,/usr/local/zabbix/bin/disk. pyfree. disk is the name of the key,/usr/local/zabbix/bin/disk. py calls free for the server. the script executed when disk is the key. The result is free. disk return value. Scripts can be any script language that can run. Note: The script must use an absolute path. Pay attention to the script permission. The script return value should be as simple as possible, so that you can easily set the alarm value.

This article from the "Wang Wei" blog, please be sure to keep this source http://wangwei007.blog.51cto.com/68019/1034704

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.