{"id":46108,"date":"2025-07-30T02:26:21","date_gmt":"2025-07-29T18:26:21","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/46108.html"},"modified":"2025-07-30T02:26:21","modified_gmt":"2025-07-29T18:26:21","slug":"vue-%e7%bb%93%e5%90%88-zabbix-api-%e8%8e%b7%e5%8f%96%e6%9c%8d%e5%8a%a1%e5%99%a8-cpu%e3%80%81%e5%86%85%e5%ad%98%e3%80%81gpu-%e7%ad%89%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/46108.html","title":{"rendered":"Vue \u7ed3\u5408 Zabbix API \u83b7\u53d6\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u6570\u636e"},"content":{"rendered":"<h4>\u4e00\u3001\u7b80\u4ecb<\/h4>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Vue \u7ed3\u5408 Zabbix API \u53ef\u4ee5\u5b9e\u73b0\u5bf9\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u76d1\u63a7\u6570\u636e\u7684\u52a8\u6001\u83b7\u53d6\u4e0e\u5c55\u793a\u3002Zabbix \u662f\u4e00\u6b3e\u5f00\u6e90\u7684\u76d1\u63a7\u5de5\u5177&#xff0c;\u63d0\u4f9b\u4e30\u5bcc\u7684 API \u63a5\u53e3\u4f9b\u5f00\u53d1\u8005\u8c03\u7528\u3002\u901a\u8fc7 Vue \u524d\u7aef\u6846\u67b6&#xff0c;\u53ef\u4ee5\u5c06 Zabbix \u8fd4\u56de\u7684\u6570\u636e\u4ee5\u56fe\u8868\u6216\u8868\u683c\u5f62\u5f0f\u76f4\u89c2\u5448\u73b0&#xff0c;\u4fbf\u4e8e\u8fd0\u7ef4\u548c\u5f00\u53d1\u4eba\u5458\u5b9e\u65f6\u638c\u63e1\u670d\u52a1\u5668\u6027\u80fd\u72b6\u6001\u3002<\/p>\n<h4>\u4e8c\u3001\u6570\u636e\u83b7\u53d6\u6d41\u7a0b<\/h4>\n<h5 style=\"background-color:transparent\">1. Zabbix API \u914d\u7f6e<\/h5>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u786e\u4fdd Zabbix \u670d\u52a1\u5df2\u542f\u7528 API \u529f\u80fd&#xff0c;\u5e76\u83b7\u53d6 API \u7684\u8bbf\u95ee\u5730\u5740&#xff08;\u5982 http:\/\/your-zabbix-server\/api_jsonrpc.php&#xff09;\u3002\u521b\u5efa\u5177\u6709 API \u8bbf\u95ee\u6743\u9650\u7684 Zabbix \u7528\u6237&#xff0c;\u8bb0\u5f55\u7528\u6237\u540d\u548c\u5bc6\u7801\u7528\u4e8e\u8ba4\u8bc1\u3002<\/p>\n<p>\u6ce8\u610f\u00a0your-zabbix-server \u662f\u4f60\u90e8\u7f72\u7684 zabbix \u670d\u52a1\u5730\u5740&#xff0c;\u4e0d\u662f\u5b9e\u9645\u7684\u6587\u4ef6\u5730\u5740\u3002<\/p>\n<p><font face=\"monospace\">\u4e0b\u9762\u4ee3\u7801\u90e8\u5206\u4ee5\u4e0b\u5217\u4fe1\u606f\u4e3a\u4f8b&#xff1a;<\/font><\/p>\n<p><font face=\"monospace\">\u00a0\u8d26\u53f7&#xff1a;<span style=\"color:#ff9900\">Admin<\/span>&#xff0c;<\/font><\/p>\n<p><font face=\"monospace\">\u00a0\u5bc6\u7801&#xff1a;<span style=\"color:#ff9900\">zabbix<\/span>&#xff0c;<\/font><\/p>\n<p><font face=\"monospace\">\u00a0API\u8bbf\u95ee\u5730\u5740&#xff1a;<\/font><span style=\"color:#ff9900\">http:\/\/your-zabbix-server\/api_jsonrpc.php<\/span><\/p>\n<p><span style=\"color:#fe2c24\">$AjaxZabbix<\/span><span style=\"color:#38d8f0\"> <\/span><span style=\"color:null\">\u662f\u6211\u5c01\u88c5\u7684 axios&#xff0c;\u6309\u7167\u4f60\u6b63\u5e38\u7684\u63a5\u53e3\u5199\u6cd5\u5c31\u53ef\u4ee5&#xff0c;\u6211\u8fd9\u91cc\u662f\u4e3a\u4e86\u65b9\u4fbf\u5c55\u793a\u8bf7\u6c42\u65b9\u5f0f\u3001\u8bf7\u6c42\u5730\u5740\u3002<\/span><\/p>\n<h5>2. Vue \u9879\u76ee\u51c6\u5907<\/h5>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728 Vue \u9879\u76ee\u4e2d\u5b89\u88c5 Axios \u6216\u5176\u4ed6 HTTP \u8bf7\u6c42\u5e93&#xff0c;\u7528\u4e8e\u4e0e Zabbix API \u4ea4\u4e92\u3002\u521b\u5efa\u72ec\u7acb\u7684\u914d\u7f6e\u6587\u4ef6\u5b58\u50a8 Zabbix API \u5730\u5740\u3001\u7528\u6237\u540d\u548c\u5bc6\u7801\u7b49\u4fe1\u606f\u3002<\/p>\n<h5 style=\"background-color:transparent\">3. \u83b7\u53d6\u8ba4\u8bc1 Token<\/h5>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u901a\u8fc7 Zabbix API \u7684 user.login \u65b9\u6cd5\u83b7\u53d6\u8ba4\u8bc1 Token\u3002\u53d1\u9001 POST \u8bf7\u6c42\u81f3 Zabbix API \u5730\u5740&#xff0c;\u8bf7\u6c42\u4f53\u5305\u542b\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u6210\u529f\u540e\u4f1a\u8fd4\u56de Token&#xff0c;\u540e\u7eed\u8bf7\u6c42\u9700\u5728\u5934\u90e8\u643a\u5e26\u6b64 Token\u3002<\/p>\n<p>\/\/\u767b\u5f55zabbix \u83b7\u53d6\u7528\u6237id<br \/>\nloginZabnix() {<br \/>\n  var body &#061; {<br \/>\n    jsonrpc: &#034;2.0&#034;,<br \/>\n    method: &#034;user.login&#034;,<br \/>\n    params: {<br \/>\n      user: &#034;Admin&#034;, \/\/ zabbix \u8d26\u53f7<br \/>\n      password: &#034;zabbix&#034;, \/\/ zabbix \u5bc6\u7801<br \/>\n    },<br \/>\n    id: 1,<br \/>\n  };<br \/>\n  $AjaxZabbix(&#034;post&#034;, &#039;http:\/\/your-zabbix-server\/api_jsonrpc.php&#039;, body).then((res) &#061;&gt; {<br \/>\n    console.log(res.result, &#039;token\u6807\u8bc6&#039;)<br \/>\n  });<br \/>\n}, <\/p>\n<p>\u8fd4\u56de\u7ed3\u679c&#xff1a;<\/p>\n<h5><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"107\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729182614-68891246e1dfe.png\" width=\"876\" \/><\/h5>\n<h5 style=\"background-color:transparent\">4. \u67e5\u8be2\u4e3b\u673a\u6570\u636e<\/h5>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u901a\u8fc7 Zabbix API \u7684 host.get \u65b9\u6cd5\u83b7\u53d6\u6240\u6709\u4e3b\u673a\u3002\u53d1\u9001 POST \u8bf7\u6c42\u81f3 Zabbix API \u5730\u5740&#xff0c;\u8bf7\u6c42\u4f53\u5305\u542b\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u6210\u529f\u540e\u4f1a\u8fd4\u56de\u4e3b\u673a\u5217\u8868&#xff0c;\u540e\u7eed\u67e5\u8be2\u76d1\u63a7\u9879\u4f1a\u7528\u5230\u4e3b\u673a\u5217\u8868\u4e2d\u7684hostid\u3002<\/p>\n<p>hostZabnix() {<br \/>\n  var body &#061; {<br \/>\n    jsonrpc: &#034;2.0&#034;,<br \/>\n    method: &#034;host.get&#034;,<br \/>\n    \/\/ \u9009\u62e9\u60f3\u8981\u8f93\u51fa\u7684\u5185\u5bb9<br \/>\n    params: {<br \/>\n      output: [&#034;hostid&#034;, &#034;host&#034;, &#034;name&#034;, &#034;flags&#034;, &#034;description&#034;, &#034;status&#034;],<br \/>\n      selectInterfaces: [&#034;interfaceid&#034;, &#034;ip&#034;],<br \/>\n    },<br \/>\n    id: 1,<br \/>\n    auth: token, \/\/ \u4ecelogin.get \u65b9\u6cd5\u4e2d\u83b7\u53d6\u5230\u7684token<br \/>\n  };<br \/>\n  $AjaxZabbix(&#034;post&#034;, &#039;http:\/\/your-zabbix-server\/api_jsonrpc.php&#039;, body).then((res) &#061;&gt; {<br \/>\n    console.log(res.result, &#039;\u4e3b\u673a\u5217\u8868&#039;)<br \/>\n  });<br \/>\n}, <\/p>\n<p>\u8fd4\u56de\u7ed3\u679c&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"497\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729182615-688912475f411.png\" width=\"852\" \/><\/p>\n<h5 style=\"background-color:transparent\">5. \u67e5\u8be2\u76d1\u63a7\u9879\u6570\u636e<\/h5>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4f7f\u7528 Zabbix API \u7684 item.get \u65b9\u6cd5\u67e5\u8be2\u76ee\u6807\u76d1\u63a7\u9879&#xff08;\u5982 CPU \u4f7f\u7528\u7387\u3001\u5185\u5b58\u5360\u7528\u7b49&#xff09;\u7684 ID&#xff0c;\u540e\u7eed\u67e5\u8be2CPU\u7b49\u4f7f\u7528\u6570\u636e\u4f1a\u7528\u5230\u76d1\u63a7\u9879\u5217\u8868\u4e2d\u7684 itemid\u3002<\/p>\n<p>itemZabnix() {<br \/>\n  var body &#061; {<br \/>\n    jsonrpc: &#034;2.0&#034;,<br \/>\n    method: &#034;item.get&#034;,<br \/>\n    \/\/ \u9009\u62e9\u8f93\u51fa\u5185\u5bb9<br \/>\n    params: {<br \/>\n      output: [&#034;itemids&#034;, &#034;key_&#034;],<br \/>\n      hostids: hostid,<br \/>\n    },<br \/>\n    id: 1,<br \/>\n    auth: token,<br \/>\n  };<br \/>\n  $AjaxZabbix(&#034;post&#034;, &#039;http:\/\/your-zabbix-server\/api_jsonrpc.php&#039;, body).then((res) &#061;&gt; {<br \/>\n    console.log(res.result, &#039;\u76d1\u63a7\u9879\u5217\u8868&#039;);<br \/>\n  });<br \/>\n}, <\/p>\n<p>\u8fd4\u56de\u7ed3\u679c&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"450\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729182615-68891247dee36.png\" width=\"858\" \/><\/p>\n<h5 style=\"background-color:transparent\">6. \u67e5\u8be2CPU\u3001\u5185\u5b58\u7b49\u4fe1\u606f<\/h5>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u6839\u636e\u76d1\u63a7\u9879\u5217\u8868\u4e2d\u5f97\u5230\u7684\u6570\u636e\u7684 itemid&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 Zabbix API \u7684 history.get \u65b9\u6cd5\u8fdb\u884c\u67e5\u8be2&#xff0c;\u6bcf\u4e00\u4e2a\u76d1\u63a7\u9879\u4ee3\u8868\u76d1\u63a7\u7684\u4e00\u4e2a\u6570\u636e\u4fe1\u606f&#xff0c;\u6bd4\u5982 key_ \u503c\u4e3a\u201dsystem.cpu.util\u201c\u7684\u76d1\u63a7\u9879&#xff0c;\u53ef\u4ee5\u67e5\u8be2\u5230 cpu \u5f53\u524d\u7684\u4f7f\u7528\u7387\u3002\u4e0b\u9762\u4ee5 cpu\u4f7f\u7528\u7387 \u4e3a\u4f8b&#xff1a;<\/p>\n<p>deployZabnix() {<br \/>\n  var body &#061; {<br \/>\n    jsonrpc: &#034;2.0&#034;,<br \/>\n    method: &#034;history.get&#034;,<br \/>\n    params: {<br \/>\n      output: &#034;extend&#034;,<br \/>\n      history: 0, \/\/ 0\u8868\u793a\u6d6e\u70b9\u6570\u7c7b\u578b&#xff0c;\u9002\u7528\u4e8eCPU\u3001\u5185\u5b58\u7b49\u6307\u6807<br \/>\n      itemids: itemid,  \/\/ \u76d1\u63a7\u9879\u7684 itemid<br \/>\n      sortfield: &#034;clock&#034;, \/\/ \u6839\u636e\u65f6\u95f4\u6392\u5e8f<br \/>\n      sortorder: &#034;DESC&#034;,  \/\/ \u6392\u5e8f\u89c4\u5219<br \/>\n      limit: 1, \/\/ \u83b7\u53d6\u6700\u65b0\u7684\u4e00\u6761\u6570\u636e&#xff0c;\u6570\u5b57\u662f\u51e0\u5c31\u4f1a\u8fd4\u56de\u51e0\u6761\u6570\u636e<br \/>\n    },<br \/>\n    id: 1,<br \/>\n    auth: token,<br \/>\n  };<br \/>\n  $AjaxZabbix(&#034;post&#034;, &#039;http:\/\/your-zabbix-server\/api_jsonrpc.php&#039;, body).then((res) &#061;&gt; {<br \/>\n    console.log(res.result[0].value, &#039;\u914d\u7f6e\u4f7f\u7528\u7387&#039;);<br \/>\n  });<br \/>\n}, <\/p>\n<p>\u8fd4\u56de\u7ed3\u679c&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"182\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729182616-68891248912c4.png\" width=\"831\" \/><\/p>\n<h4>\u4e09\u3001\u603b\u7ed3<\/h4>\n<h5 style=\"background-color:transparent\">1. \u6d41\u7a0b\u6458\u8981<\/h5>\n<p>&#xff08;1&#xff09;user.login&#xff08;\u83b7\u53d6token&#xff09;<\/p>\n<p>&#xff08;2&#xff09;host.get&#xff08;\u83b7\u53d6\u4e3b\u673a\u5217\u8868&#xff09;<\/p>\n<p>&#xff08;3&#xff09;item.get&#xff08;\u6839\u636e\u4e3b\u673a\u7684 hostid \u83b7\u53d6\u76d1\u63a7\u9879\u5217\u8868&#xff09;<\/p>\n<p>&#xff08;4&#xff09;history.get&#xff08;\u6839\u636e\u76d1\u63a7\u9879\u7684 itemid \u83b7\u53d6\u76d1\u63a7\u9879\u5b9e\u9645\u6570\u636e&#xff09;<\/p>\n<h5>2. \u5e38\u7528\u76d1\u63a7\u9879<\/h5>\n<h6>CPU<\/h6>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:500px\">\n<tbody>\n<tr>\n<td>system.cpu.util<\/td>\n<td>cpu\u4f7f\u7528\u7387&#xff08;%&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>system.cpu.load[percpu,avg1]<\/td>\n<td>cpu\u5355\u6838 1 \u5206\u949f\u5e73\u5747\u8d1f\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>system.cpu.load[percpu,avg5]<\/td>\n<td>cpu\u5355\u6838 5\u00a0\u5206\u949f\u5e73\u5747\u8d1f\u8f7d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h6>\u5185\u5b58<\/h6>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:500px\">\n<tbody>\n<tr>\n<td>vm.memory.size[total]<\/td>\n<td>\u603b\u7269\u7406\u5185\u5b58&#xff08;\u5b57\u8282&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vm.memory.size[available]<\/td>\n<td>\u53ef\u7528\u5185\u5b58&#xff08;\u5b57\u8282&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vm.memory.size[pavailable]<\/td>\n<td>\u5185\u5b58\u53ef\u7528\u7387&#xff08;%&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vm.memory.size[used]<\/td>\n<td>\u5df2\u7528\u5185\u5b58&#xff08;\u5b57\u8282&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vm.memory.size[free]<\/td>\n<td>\u7a7a\u95f2\u5185\u5b58&#xff08;\u5b57\u8282&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h6>\u78c1\u76d8<\/h6>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:500px\">\n<tbody>\n<tr>\n<td>vfs.fs.size[\/,total]<\/td>\n<td>\u6839\u5206\u533a\u603b\u7a7a\u95f4&#xff08;\u5b57\u8282&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vfs.fs.size[\/,free]<\/td>\n<td>\u6839\u5206\u533a\u5269\u4f59\u7a7a\u95f4&#xff08;\u5b57\u8282&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vfs.fs.size[\/,pfree]<\/td>\n<td>\u6839\u5206\u533a\u5269\u4f59\u7a7a\u95f4\u767e\u5206\u6bd4&#xff08;%&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vfs.fs.size[\/,used]<\/td>\n<td>\u6839\u5206\u533a\u5df2\u7528\u7a7a\u95f4&#xff08;\u5b57\u8282&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vfs.dev.read[,ops]<\/td>\n<td>\u78c1\u76d8\u8bfb\u53d6\u64cd\u4f5c\u6b21\u6570&#xff08;IOPS&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vfs.dev.write[,ops]<\/td>\n<td>\u78c1\u76d8\u5199\u5165\u64cd\u4f5c\u6b21\u6570&#xff08;IOPS&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vfs.dev.read[,bytes]<\/td>\n<td>\u78c1\u76d8\u8bfb\u53d6\u6570\u636e\u91cf&#xff08;\u5b57\u8282\/\u79d2&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>vfs.dev.write[,bytes]<\/td>\n<td>\u78c1\u76d8\u5199\u5165\u6570\u636e\u91cf&#xff08;\u5b57\u8282\/\u79d2&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h6>GPU<\/h6>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 GPU\u5b98\u65b9\u6ca1\u6709\u63d0\u4f9b\u76d1\u63a7\u9879&#xff0c;\u9700\u8981\u6211\u4eec\u81ea\u5df1\u53bb\u521b\u5efa\u76f8\u5173\u76d1\u63a7\u9879&#xff01;&#xff08;\u8ba9\u8fd0\u7ef4\u53bb\u52a0&#xff09;<\/p>\n<h5 style=\"background-color:transparent\">3. \u6ce8\u610f\u9879<\/h5>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u5982\u679c\u4f60\u7684zabbix\u670d\u52a1\u4e2d\u81ea\u5b9a\u4e49\u4e86\u5b98\u65b9\u5df2\u6709\u7684\u76d1\u63a7\u9879&#xff0c;\u4f1a\u8fdb\u884c\u8986\u76d6&#xff0c;\u6211\u4eec\u516c\u53f8\u8fd0\u7ef4\u5c31\u5c06\u00a0vm.memory.size[pavailable] \u8bbe\u7f6e\u6210\u4e86\u4f7f\u7528\u7387&#xff0c;\u800c\u5b98\u65b9\u662f\u53ef\u7528\u7387&#xff0c;\u7ed3\u679c\u6b63\u597d\u76f8\u53cd&#xff01;&#xff01;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"919\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729182616-68891248ed4f5.png\" width=\"1920\" \/><\/p>\n<p>\u6240\u4ee5\u5728\u4f7f\u7528\u524d\u5148\u5230 zabbix \u670d\u52a1\u754c\u9762\u770b\u770b&#xff0c;\u4f60\u8981\u67e5\u8be2\u7684\u76d1\u63a7\u9879\u662f\u5426\u662f\u4f60\u8981\u5f97\u5230\u7684\u6570\u636e&#xff0c;\u4ee5\u514d\u53d1\u751f\u9519\u8bef&#xff01;<\/p>\n<ul><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Vue\u7ed3\u5408Zabbix API\u5b9e\u73b0\u670d\u52a1\u5668\u76d1\u63a7\u529f\u80fd\u3002\u901a\u8fc7Zabbix\u63d0\u4f9b\u7684API\u63a5\u53e3\uff0c\u53ef\u4ee5\u83b7\u53d6CPU\u3001\u5185\u5b58\u7b49\u670d\u52a1\u5668\u6027\u80fd\u6570\u636e\u3002\u5177\u4f53\u5b9e\u73b0\u6d41\u7a0b\u5305\u62ec\uff1a\u914d\u7f6eZabbix API\u8bbf\u95ee\u6743\u9650\u3001Vue\u9879\u76ee\u51c6\u5907\u3001\u83b7\u53d6\u8ba4\u8bc1Token\u3001\u67e5\u8be2\u4e3b\u673a\u6570\u636e\u3001\u83b7\u53d6\u76d1\u63a7\u9879ID\uff0c\u6700\u540e\u901a\u8fc7history.get\u65b9\u6cd5\u67e5\u8be2\u5177\u4f53\u76d1\u63a7\u6570\u636e\u3002\u6587\u4e2d\u8fd8\u5217\u4e3e\u4e86\u5e38\u7528\u76d1\u63a7\u9879\u5982CPU\u4f7f\u7528\u7387\u3001\u5185\u5b58\u5360\u7528\u7b49\uff0c\u5e76\u63d0\u9192\u6ce8\u610f\u81ea\u5b9a\u4e49\u76d1\u63a7\u9879\u53ef\u80fd\u8986\u76d6\u5b98\u65b9\u9ed8\u8ba4\u503c\u7684\u60c5\u51b5\u3002_\u4f7f\u7528sql\u83b7\u53d6zabbix\u6570\u636e<\/p>\n","protected":false},"author":2,"featured_media":46103,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[458,625,935,43],"topic":[],"class_list":["post-46108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-vue","tag-vue-js","tag-zabbix","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Vue \u7ed3\u5408 Zabbix API \u83b7\u53d6\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/46108.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vue \u7ed3\u5408 Zabbix API \u83b7\u53d6\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Vue\u7ed3\u5408Zabbix API\u5b9e\u73b0\u670d\u52a1\u5668\u76d1\u63a7\u529f\u80fd\u3002\u901a\u8fc7Zabbix\u63d0\u4f9b\u7684API\u63a5\u53e3\uff0c\u53ef\u4ee5\u83b7\u53d6CPU\u3001\u5185\u5b58\u7b49\u670d\u52a1\u5668\u6027\u80fd\u6570\u636e\u3002\u5177\u4f53\u5b9e\u73b0\u6d41\u7a0b\u5305\u62ec\uff1a\u914d\u7f6eZabbix API\u8bbf\u95ee\u6743\u9650\u3001Vue\u9879\u76ee\u51c6\u5907\u3001\u83b7\u53d6\u8ba4\u8bc1Token\u3001\u67e5\u8be2\u4e3b\u673a\u6570\u636e\u3001\u83b7\u53d6\u76d1\u63a7\u9879ID\uff0c\u6700\u540e\u901a\u8fc7history.get\u65b9\u6cd5\u67e5\u8be2\u5177\u4f53\u76d1\u63a7\u6570\u636e\u3002\u6587\u4e2d\u8fd8\u5217\u4e3e\u4e86\u5e38\u7528\u76d1\u63a7\u9879\u5982CPU\u4f7f\u7528\u7387\u3001\u5185\u5b58\u5360\u7528\u7b49\uff0c\u5e76\u63d0\u9192\u6ce8\u610f\u81ea\u5b9a\u4e49\u76d1\u63a7\u9879\u53ef\u80fd\u8986\u76d6\u5b98\u65b9\u9ed8\u8ba4\u503c\u7684\u60c5\u51b5\u3002_\u4f7f\u7528sql\u83b7\u53d6zabbix\u6570\u636e\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/46108.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-29T18:26:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729182614-68891246e1dfe.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/46108.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/46108.html\",\"name\":\"Vue \u7ed3\u5408 Zabbix API \u83b7\u53d6\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-29T18:26:21+00:00\",\"dateModified\":\"2025-07-29T18:26:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/46108.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/46108.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/46108.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vue \u7ed3\u5408 Zabbix API \u83b7\u53d6\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u6570\u636e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Vue \u7ed3\u5408 Zabbix API \u83b7\u53d6\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/46108.html","og_locale":"zh_CN","og_type":"article","og_title":"Vue \u7ed3\u5408 Zabbix API \u83b7\u53d6\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Vue\u7ed3\u5408Zabbix API\u5b9e\u73b0\u670d\u52a1\u5668\u76d1\u63a7\u529f\u80fd\u3002\u901a\u8fc7Zabbix\u63d0\u4f9b\u7684API\u63a5\u53e3\uff0c\u53ef\u4ee5\u83b7\u53d6CPU\u3001\u5185\u5b58\u7b49\u670d\u52a1\u5668\u6027\u80fd\u6570\u636e\u3002\u5177\u4f53\u5b9e\u73b0\u6d41\u7a0b\u5305\u62ec\uff1a\u914d\u7f6eZabbix API\u8bbf\u95ee\u6743\u9650\u3001Vue\u9879\u76ee\u51c6\u5907\u3001\u83b7\u53d6\u8ba4\u8bc1Token\u3001\u67e5\u8be2\u4e3b\u673a\u6570\u636e\u3001\u83b7\u53d6\u76d1\u63a7\u9879ID\uff0c\u6700\u540e\u901a\u8fc7history.get\u65b9\u6cd5\u67e5\u8be2\u5177\u4f53\u76d1\u63a7\u6570\u636e\u3002\u6587\u4e2d\u8fd8\u5217\u4e3e\u4e86\u5e38\u7528\u76d1\u63a7\u9879\u5982CPU\u4f7f\u7528\u7387\u3001\u5185\u5b58\u5360\u7528\u7b49\uff0c\u5e76\u63d0\u9192\u6ce8\u610f\u81ea\u5b9a\u4e49\u76d1\u63a7\u9879\u53ef\u80fd\u8986\u76d6\u5b98\u65b9\u9ed8\u8ba4\u503c\u7684\u60c5\u51b5\u3002_\u4f7f\u7528sql\u83b7\u53d6zabbix\u6570\u636e","og_url":"https:\/\/www.wsisp.com\/helps\/46108.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-29T18:26:21+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729182614-68891246e1dfe.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/46108.html","url":"https:\/\/www.wsisp.com\/helps\/46108.html","name":"Vue \u7ed3\u5408 Zabbix API \u83b7\u53d6\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-29T18:26:21+00:00","dateModified":"2025-07-29T18:26:21+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/46108.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/46108.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/46108.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Vue \u7ed3\u5408 Zabbix API \u83b7\u53d6\u670d\u52a1\u5668 CPU\u3001\u5185\u5b58\u3001GPU \u7b49\u6570\u636e"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/46108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=46108"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/46108\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/46103"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=46108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=46108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=46108"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=46108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}