1.zabbix_sender的使用
zabbix_sender程序主要用于那些执行时间比较长的自定义脚本间隔发送状态或性能数据到zabbix server.
$ /usr/local/zabbix/bin/zabbix_sender --help
Zabbix Sender v2.2.3 (revision 44105) (7 April 2014)
usage: zabbix_sender [-Vhv] {[-zpsI] -ko | [-zpI] -T -i <file> -r} [-c <file>]
Options:
-c --config <file> Absolute path to the configuration file
-z --zabbix-server <server> Hostname or IP address of Zabbix server
-p --port <server port> Specify port number of server trapper running on the server. Default is 10051
-s --host <hostname> Specify host name. Host IP address and DNS name will not work
-I --source-address <IP address> Specify source IP address
-k --key <key> Specify item key
-o --value <key value> Specify value
-i --input-file <input file> Load values from input file. Specify - for standard input
Each line of file contains whitespace delimited: <hostname> <key> <value>
Specify - in <hostname> to use hostname from configuration file or --host argument
-T --with-timestamps Each line of file contains whitespace delimited: <hostname> <key> <timestamp> <value>
This can be used with --input-file option
Timestamp should be specified in Unix timestamp format
-r --real-time Send metrics one by one as soon as they are received
This can be used when reading from standard input
-v --verbose Verbose mode, -vv for more details
Other options:
-h --help Give this help
-V --version Display version number
$ /usr/local/zabbix/bin/zabbix_sender -s "xxxxx" -z xxxx -k MongoDB.Status[version] -o 2.4.6
info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.000054"
sent: 1; skipped: 0; total: 1
-s 指定zabbix_sender发送的主机名称
-k 指定的KEY是通过配置文件指定的
2.Trapper Items
Trapper Items接收来源数据而不是查询它。用于将需要的数据推送给zabbix
参考文档:
https://www.zabbix.com/documentation/2.2/manual/concepts/sender
https://www.zabbix.com/documentation/2.2/manual/config/items/itemtypes/trapper
转载于:https://blog.51cto.com/john88wang/1639412