{"id":287,"date":"2024-07-17T10:43:00","date_gmt":"2024-07-17T02:43:00","guid":{"rendered":"https:\/\/www.lerwee.cn\/?p=287"},"modified":"2025-10-24T14:48:28","modified_gmt":"2025-10-24T06:48:28","slug":"zabbix_get%e5%9f%ba%e7%a1%80%e5%91%bd%e4%bb%a4%e6%b5%85%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.lerwee.com\/en\/2024\/07\/17\/zabbix_get%e5%9f%ba%e7%a1%80%e5%91%bd%e4%bb%a4%e6%b5%85%e6%9e%90\/","title":{"rendered":"A Brief Analysis of Zabbix_get Basic Commands"},"content":{"rendered":"<p>Zabbix_get is a command-line tool for the Zabbix monitoring system that can be used to<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. Get a separate key value pair<\/strong><\/h2>\n\n\n\n<p>The following command can be used to obtain a single key value pair:<\/p>\n\n\n\n<p>zabbix_get -s &lt;server_ip&gt; -p &lt;server_port&gt; -k &lt;key&gt;<\/p>\n\n\n\n<p>among which<\/p>\n\n\n\n<p>is the IP address of the Zabbix server<\/p>\n\n\n\n<p>is the port number of the Zabbix server, default is 10050<\/p>\n\n\n\n<p>is the key name of the key value pair to be obtained.<\/p>\n\n\n\n<p>For example, to obtain a key value pair with the key name system. cpu. load [percPU, avg15], you can use the following command:<\/p>\n\n\n\n<p>zabbix_get -s 192.168.1.1 -k system.cpu.load[percpu,avg15]<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2: Retrieve multiple key value pairs from a file<\/strong><\/h2>\n\n\n\n<p>The following command can be used to retrieve multiple key value pairs from a file:<\/p>\n\n\n\n<p>zabbix_get -s &lt;server_ip&gt; -p &lt;server_port&gt; -f &lt;file&gt;<\/p>\n\n\n\n<p>among which<\/p>\n\n\n\n<p>The meanings ofandare the same as above<\/p>\n\n\n\n<p>is the file path that contains the key value pairs to be obtained.<\/p>\n\n\n\n<p>For example, to retrieve multiple key value pairs from a keys.txt file, you can use the following command:<\/p>\n\n\n\n<p>zabbix_get -s 192.168.1.1 -f \/path\/to\/keys.txt<\/p>\n\n\n\n<p>In keys.txt, each key name should have a separate line, for example:<\/p>\n\n\n\n<p>system.cpu.load[percpu,avg1]<\/p>\n\n\n\n<p>system.cpu.load[percpu,avg5]<\/p>\n\n\n\n<p>system.cpu.load[percpu,avg15]<\/p>\n\n\n\n<p>The above is the basic usage method of zabbix_get. There are other options to further customize the behavior of the command line, and you can use the zabbix_get - help command to view the complete list of options.<\/p>","protected":false},"excerpt":{"rendered":"<p>zabbix_get\u662fzabbix\u76d1\u63a7\u7cfb\u7edf\u7684\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u4e8e\u4ecezabbix\u670d\u52a1\u5668\u6216\u4ee3\u7406\u83b7\u53d6\u6570\u636e\u3002\u4ee5\u4e0b\u662f [&hellip;]<\/p>","protected":false},"author":1,"featured_media":782,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[42],"class_list":["post-287","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-articles","tag-zabbix"],"_links":{"self":[{"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/posts\/287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/comments?post=287"}],"version-history":[{"count":2,"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/posts\/287\/revisions"}],"predecessor-version":[{"id":784,"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/posts\/287\/revisions\/784"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/media\/782"}],"wp:attachment":[{"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/media?parent=287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/categories?post=287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lerwee.com\/en\/wp-json\/wp\/v2\/tags?post=287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}