hb_sz 发表于 2019-1-19 12:45:21

使用zabbix_sender收集监控信息

  

  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-r} [-c ]
Options:
-c --config                  Absolute path to the configuration file
-z --zabbix-server         Hostname or IP address of Zabbix server
-p --port               Specify port number of server trapper running on the server. Default is 10051
-s --host                  Specify host name. Host IP address and DNS name will not work
-I --source-address      Specify source IP address
-k --key                        Specify item key
-o --value                Specify value
-i --input-file          Load values from input file. Specify - for standard input
                                       Each line of file contains whitespace delimited:   
                                       Specify - into use hostname from configuration file or --host argument
-T --with-timestamps               Each line of file contains whitespace delimited:   
                                       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 -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
  

  




页: [1]
查看完整版本: 使用zabbix_sender收集监控信息