{"id":43062,"date":"2024-10-04T15:17:06","date_gmt":"2024-10-04T07:17:06","guid":{"rendered":"https:\/\/server.hk\/cnblog\/43062\/"},"modified":"2024-10-04T15:17:06","modified_gmt":"2024-10-04T07:17:06","slug":"centos-7-%e5%ae%89%e8%a3%9d-grafana-%e5%8f%8a%e9%85%8d%e7%bd%ae-zabbix-%e6%95%b8%e6%93%9a%e6%ba%90","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/43062\/","title":{"rendered":"CentOS 7 \u5b89\u88dd Grafana \u53ca\u914d\u7f6e zabbix \u6578\u64da\u6e90"},"content":{"rendered":"<h1 id=\"centos-7-%e5%ae%89%e8%a3%9d-grafana-%e5%8f%8a%e9%85%8d%e7%bd%ae-zabbix-%e6%95%b8%e6%93%9a%e6%ba%90-fFzlxOBzhA\">CentOS 7 \u5b89\u88dd Grafana \u53ca\u914d\u7f6e Zabbix \u6578\u64da\u6e90<\/h1>\n<p>Grafana \u662f\u4e00\u500b\u958b\u6e90\u7684\u6578\u64da\u53ef\u8996\u5316\u5de5\u5177\uff0c\u5ee3\u6cdb\u7528\u65bc\u76e3\u63a7\u548c\u5206\u6790\u5404\u7a2e\u6578\u64da\u6e90\u3002Zabbix \u5247\u662f\u4e00\u500b\u5f37\u5927\u7684\u958b\u6e90\u76e3\u63a7\u89e3\u6c7a\u65b9\u6848\uff0c\u80fd\u5920\u6536\u96c6\u548c\u5b58\u5132\u5404\u7a2e\u6307\u6a19\u6578\u64da\u3002\u5c07 Grafana \u8207 Zabbix \u7d50\u5408\u4f7f\u7528\uff0c\u53ef\u4ee5\u5be6\u73fe\u66f4\u76f4\u89c0\u7684\u6578\u64da\u5c55\u793a\u548c\u5206\u6790\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 CentOS 7 \u4e0a\u5b89\u88dd Grafana \u4e26\u914d\u7f6e Zabbix \u6578\u64da\u6e90\u3002<\/p>\n<h2 id=\"%e5%89%8d%e6%9c%9f%e6%ba%96%e5%82%99-fFzlxOBzhA\">\u524d\u671f\u6e96\u5099<\/h2>\n<p>\u5728\u958b\u59cb\u4e4b\u524d\uff0c\u8acb\u78ba\u4fdd\u60a8\u7684 CentOS 7 \u7cfb\u7d71\u5df2\u7d93\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u66f4\u65b0\uff1a<\/p>\n<pre><code>sudo yum update -y<\/code><\/pre>\n<p>\u6b64\u5916\uff0c\u60a8\u9700\u8981\u5b89\u88dd EPEL\uff08Extra Packages for Enterprise Linux\uff09\u5eab\uff0c\u56e0\u70ba Grafana \u9700\u8981\u5f9e\u9019\u88e1\u7372\u53d6\u4f9d\u8cf4\u5305\uff1a<\/p>\n<pre><code>sudo yum install epel-release -y<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-grafana-fFzlxOBzhA\">\u5b89\u88dd Grafana<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u6211\u5011\u5c07\u5b89\u88dd Grafana\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<ol>\n<li>\u6dfb\u52a0 Grafana \u7684 YUM \u5b58\u5132\u5eab\uff1a<\/li>\n<pre><code>cat &lt;&lt;EOF | sudo tee \/etc\/yum.repos.d\/grafana.repo\n[grafana]\nname=grafana\nbaseurl=https:\/\/packages.grafana.com\/oss\/release\/rpm\nenabled=1\ngpgcheck=1\ngpgkey=https:\/\/packages.grafana.com\/gpg.key\nEOF<\/code><\/pre>\n<li>\u5b89\u88dd Grafana\uff1a<\/li>\n<pre><code>sudo yum install grafana -y<\/code><\/pre>\n<li>\u555f\u52d5 Grafana \u670d\u52d9\u4e26\u8a2d\u7f6e\u70ba\u958b\u6a5f\u81ea\u555f\uff1a<\/li>\n<pre><code>sudo systemctl start grafana-server\nsudo systemctl enable grafana-server<\/code><\/pre>\n<\/ol>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u8a2a\u554f <code>http:\/\/:3000<\/code> \u4f86\u8a2a\u554f Grafana\u3002\u9ed8\u8a8d\u7684\u767b\u9304\u7528\u6236\u540d\u548c\u5bc6\u78bc\u90fd\u662f <code>admin<\/code>\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d-zabbix-fFzlxOBzhA\">\u5b89\u88dd Zabbix<\/h2>\n<p>\u5728\u914d\u7f6e Zabbix \u6578\u64da\u6e90\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u78ba\u4fdd Zabbix \u670d\u52d9\u5668\u5df2\u7d93\u5b89\u88dd\u4e26\u904b\u884c\u3002\u53ef\u4ee5\u53c3\u8003 Zabbix \u5b98\u65b9\u6587\u6a94\u9032\u884c\u5b89\u88dd\u3002\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u78ba\u4fdd Zabbix \u670d\u52d9\u5668\u80fd\u5920\u6b63\u5e38\u904b\u884c\u4e26\u6536\u96c6\u6578\u64da\u3002<\/p>\n<h2 id=\"%e9%85%8d%e7%bd%ae-grafana-%e4%bb%a5%e4%bd%bf%e7%94%a8-zabbix-%e6%95%b8%e6%93%9a%e6%ba%90-fFzlxOBzhA\">\u914d\u7f6e Grafana \u4ee5\u4f7f\u7528 Zabbix \u6578\u64da\u6e90<\/h2>\n<p>\u73fe\u5728\uff0c\u6211\u5011\u5c07\u5728 Grafana \u4e2d\u914d\u7f6e Zabbix \u6578\u64da\u6e90\uff1a<\/p>\n<ol>\n<li>\u767b\u9304\u5230 Grafana\uff0c\u7136\u5f8c\u9ede\u64ca\u5de6\u5074\u83dc\u55ae\u4e2d\u7684\u300cConfiguration\u300d\u5716\u6a19\uff0c\u9078\u64c7\u300cData Sources\u300d\u3002<\/li>\n<li>\u9ede\u64ca\u300cAdd data source\u300d\uff0c\u7136\u5f8c\u9078\u64c7\u300cZabbix\u300d\u3002<\/li>\n<li>\u5728 Zabbix \u6578\u64da\u6e90\u914d\u7f6e\u9801\u9762\u4e2d\uff0c\u586b\u5beb\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/li>\n<ul>\n<li><strong>Name:<\/strong> \u81ea\u5b9a\u7fa9\u6578\u64da\u6e90\u540d\u7a31\uff0c\u4f8b\u5982\u300cZabbix\u300d<\/li>\n<li><strong>Zabbix API URL:<\/strong> \u586b\u5beb Zabbix API \u7684 URL\uff0c\u4f8b\u5982 <code>http:\/\/\/zabbix\/api_jsonrpc.php<\/code><\/li>\n<li><strong>Access:<\/strong> \u9078\u64c7\u300cServer (default)\u300d<\/li>\n<li><strong>JSON Data:<\/strong> \u586b\u5beb Zabbix \u7684\u7528\u6236\u540d\u548c\u5bc6\u78bc\u3002<\/li>\n<\/ul>\n<li>\u5b8c\u6210\u5f8c\uff0c\u9ede\u64ca\u300cSave &amp; Test\u300d\u4ee5\u6e2c\u8a66\u9023\u63a5\u662f\u5426\u6210\u529f\u3002<\/li>\n<\/ol>\n<h2 id=\"%e5%89%b5%e5%bb%ba%e5%84%80%e8%a1%a8%e6%9d%bf-fFzlxOBzhA\">\u5275\u5efa\u5100\u8868\u677f<\/h2>\n<p>\u4e00\u65e6 Zabbix \u6578\u64da\u6e90\u914d\u7f6e\u6210\u529f\uff0c\u60a8\u53ef\u4ee5\u958b\u59cb\u5275\u5efa\u5100\u8868\u677f\u4f86\u53ef\u8996\u5316\u6578\u64da\uff1a<\/p>\n<ol>\n<li>\u5728 Grafana \u5de6\u5074\u83dc\u55ae\u4e2d\u9078\u64c7\u300cDashboards\u300d\uff0c\u7136\u5f8c\u9ede\u64ca\u300cNew Dashboard\u300d\u3002<\/li>\n<li>\u9ede\u64ca\u300cAdd new panel\u300d\uff0c\u7136\u5f8c\u9078\u64c7\u525b\u525b\u914d\u7f6e\u7684 Zabbix \u6578\u64da\u6e90\u3002<\/li>\n<li>\u9078\u64c7\u8981\u986f\u793a\u7684 Zabbix \u6307\u6a19\uff0c\u4e26\u6839\u64da\u9700\u8981\u9032\u884c\u8a2d\u7f6e\u3002<\/li>\n<li>\u5b8c\u6210\u5f8c\uff0c\u9ede\u64ca\u300cApply\u300d\u4ee5\u4fdd\u5b58\u9762\u677f\u3002<\/li>\n<\/ol>\n<h2 id=\"%e7%b8%bd%e7%b5%90-fFzlxOBzhA\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u5df2\u7d93\u6210\u529f\u5728 CentOS 7 \u4e0a\u5b89\u88dd\u4e86 Grafana \u4e26\u914d\u7f6e\u4e86 Zabbix \u6578\u64da\u6e90\u3002\u9019\u6a23\uff0c\u60a8\u53ef\u4ee5\u5229\u7528 Grafana \u7684\u5f37\u5927\u53ef\u8996\u5316\u529f\u80fd\u4f86\u76e3\u63a7\u548c\u5206\u6790 Zabbix \u6536\u96c6\u7684\u6578\u64da\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u6578\u64da\u8655\u7406\u548c\u53ef\u8996\u5316\u7684\u7528\u6236\u4f86\u8aaa\uff0c\u9019\u662f\u4e00\u500b\u975e\u5e38\u6709\u7528\u7684\u7d44\u5408\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u7a69\u5b9a\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u904b\u884c\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u4e0d\u540c\u9700\u6c42\u3002\u7121\u8ad6\u662f\u5c0f\u578b\u9805\u76ee\u9084\u662f\u5927\u578b\u4f01\u696d\u61c9\u7528\uff0c\u6211\u5011\u7684 <a href=\"https:\/\/server.hk\">\u4f3a\u670d\u5668<\/a> \u89e3\u6c7a\u65b9\u6848\u90fd\u80fd\u70ba\u60a8\u63d0\u4f9b\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 CentOS 7 \u4e0a\u5b89\u88dd Grafana \u4e26\u914d\u7f6e Zabbix \u6578\u64da\u6e90\uff0c\u8f15\u9b06\u76e3\u63a7\u548c\u53ef\u8996\u5316\u6578\u64da\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-43062","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/43062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=43062"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/43062\/revisions"}],"predecessor-version":[{"id":43063,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/43062\/revisions\/43063"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=43062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=43062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=43062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}