{"id":6553,"date":"2021-01-07T09:22:09","date_gmt":"2021-01-07T01:22:09","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=6553"},"modified":"2021-07-24T10:51:34","modified_gmt":"2021-07-24T02:51:34","slug":"%e4%bd%bf%e7%94%a8influxdb%e5%92%8cgrafana%e8%ae%be%e7%bd%aepfsense%e7%9b%91%e6%8e%a7","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=6553","title":{"rendered":"\u4f7f\u7528InfluxDB\u548cGrafana\u8fdc\u7a0b\u76d1\u63a7pfSense"},"content":{"rendered":"<p style=\"text-align: justify;\">pfSense\u7684\u4eea\u8868\u677f\u672c\u8eab\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5b9e\u65f6\u663e\u793a\u7684\u6570\u636e\uff0c\u4f46\u6ca1\u6709\u8ffd\u6eaf\u6027\u3002\u501f\u52a9<a href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/installation\/debian\/\">Grafana<\/a>\u53caInfluxDB\u6570\u636e\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u5efa\u7acb\u80fd\u8ffd\u6eaf\u7684\u76d1\u63a7\u6570\u636e\u5e73\u53f0\u3002InfluxDB\u662f\u7528\u4e8e\u5b58\u50a8\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u7684\u6570\u636e\u5e93\u5e73\u53f0\uff0c\u53ef\u4ee5\u4ece\u4e0d\u540c\u8bbe\u5907\u6536\u96c6\u6307\u6807\u548c\u4e8b\u4ef6\uff0c\u5b83\u662fTICK Stack\u7684\u4e00\u90e8\u5206\u3002\u5305\u62ec\uff1a<span id=\"ezoic-pub-ad-placeholder-110\" class=\"ezoic-adpicker-ad\"><\/span><\/p>\n<p style=\"text-align: justify;\"><strong>T<\/strong>\u00a0\u2013\u00a0\u00a0<em>Telegraf\uff1b <\/em>\u4e00\u4e2a\u7528Go\u7f16\u5199\u7684\u4ee3\u7406\uff0c\u7528\u4e8e\u4ece\u5176\u8fd0\u884c\u7684\u7cfb\u7edf\u548c\u8be5\u7cfb\u7edf\u4e0a\u8fd0\u884c\u7684\u670d\u52a1\u6536\u96c6\u6027\u80fd\u6307\u6807\u3002\u6536\u96c6\u7684\u6307\u6807\u5c06\u8f93\u51fa\u5230InfluxDB\u6216\u5176\u4ed6\u53d7\u652f\u6301\u7684\u6570\u636e\u5e93\u5b58\u50a8\u4e0a\u3002<br \/>\n<strong>I<\/strong>\u00a0\u2013\u00a0<em>InfluxDB<\/em><br \/>\n<strong>C<\/strong>\u00a0\u2013\u00a0<em>Chronograf\uff1b\u00a0<\/em>\u7528Go\u548cReact.js\u7f16\u5199\u7684Web\u5e94\u7528\u7a0b\u5e8f\uff0c\u63d0\u4f9b\u4e86\u53ef\u89c6\u5316\u76d1\u89c6\u6570\u636e\u5e76\u8f7b\u677e\u521b\u5efa\u8b66\u62a5\u548c\u81ea\u52a8\u5316\u89c4\u5219\u7684\u5de5\u5177\u3002<br \/>\n<strong>K<\/strong>\u00a0\u2013\u00a0<em>Kapacitor<\/em> \u00a0A\u6570\u636e\u5904\u7406\u5f15\u64ce\u3002\u5b83\u53ef\u4ee5\u5904\u7406\u6765\u81eaInfluxDB\u7684\u6d41\u6570\u636e\u548c\u6279\u5904\u7406\u6570\u636e\u3002<\/p>\n<p style=\"text-align: justify;\">\u4e0b\u9762\u4ecb\u7ecd\u5728Ubuntu 20.04 \u7cfb\u7edf\u4e0a\u5b89\u88c5Grafana\u548cInfluxDB\uff0c\u642d\u5efapfSense\u9632\u706b\u5899\u8fdc\u7a0b\u6570\u636e\u76d1\u63a7\u5e73\u53f0\u7684\u8fc7\u7a0b\u3002<\/p>\n<h1 style=\"text-align: justify;\">\u5b89\u88c5Grafana\u76d1\u63a7\u5e73\u53f0<\/h1>\n<p style=\"text-align: justify;\">\u5728Ubuntu 20.04 \u7cfb\u7edf\u547d\u4ee4\u884c\uff0c\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo apt-get install -y adduser libfontconfig1\r\nwget https:\/\/dl.grafana.com\/oss\/release\/grafana_7.3.6_amd64.deb\r\nsudo dpkg -i grafana_7.3.6_amd64.deb<\/pre>\n<p style=\"text-align: justify;\">\u5b89\u88c5\u5b8c\u6210\u4ee5\u540e\uff0c\u7528systemd\u542f\u52a8\u670d\u52a1\uff1a<\/p>\n<pre>sudo systemctl daemon-reload\r\nsudo systemctl start grafana-server\r\nsudo systemctl status grafana-server<\/pre>\n<p style=\"text-align: justify;\">\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\uff1a<\/p>\n<pre>sudo systemctl enable grafana-server.service<\/pre>\n<h1 style=\"text-align: justify;\">\u5b89\u88c5InfluxDB\u6570\u636e\u5e93<\/h1>\n<p style=\"text-align: justify;\">\u5728Ubuntu 20.04 \u7cfb\u7edf\u547d\u4ee4\u884c\uff0c\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style=\"text-align: justify;\">\u6dfb\u52a0\u5b58\u50a8\u5e93\uff1a<\/p>\n<pre>echo \"deb https:\/\/repos.influxdata.com\/ubuntu focal stable\" | sudo tee \/etc\/apt\/sources.list.d\/influxdb.list<\/pre>\n<p style=\"text-align: justify;\">\u5bfc\u5165GPG\u5bc6\u94a5\uff1a<span id=\"ezoic-pub-ad-placeholder-111\" class=\"ezoic-adpicker-ad\"><\/span><\/p>\n<pre>sudo curl -sL https:\/\/repos.influxdata.com\/influxdb.key | sudo apt-key add -<\/pre>\n<p style=\"text-align: justify;\">\u66f4\u65b0apt\u7d22\u5f15\u5e76\u5b89\u88c5\uff1a<\/p>\n<pre>sudo apt-get update\r\nsudo apt-get install influxdb<\/pre>\n<p style=\"text-align: justify;\">\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\uff1a<\/p>\n<pre>sudo systemctl enable --now influxdb<\/pre>\n<p style=\"text-align: justify;\">\u68c0\u67e5\u670d\u52a1\u72b6\u6001\uff1a<\/p>\n<pre>systemctl status influxdb<\/pre>\n<h1 style=\"text-align: justify;\">\u521b\u5efa\u6570\u636e\u5e93<\/h1>\n<p style=\"text-align: justify;\">\u5728Ubuntu 20.04 \u7cfb\u7edf\u547d\u4ee4\u884c\uff0c\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style=\"text-align: justify;\">\u767b\u5f55\u6570\u636e\u5e93:<\/p>\n<pre>influx<\/pre>\n<p style=\"text-align: justify;\">\u8bbe\u7f6e\u6570\u636e\u5e93\u7684\u7ba1\u7406\u5458\u5bc6\u7801\u4e3a&#8221;pfsense&#8221;:<\/p>\n<pre>create user admin with password 'pfsense' with all privileges<\/pre>\n<p style=\"text-align: justify;\">\u521b\u5efa\u6570\u636e\u5e93&#8221;pfsense&#8221;:<\/p>\n<pre>create database \"pfsense\"<\/pre>\n<p style=\"text-align: justify;\">\u8bbe\u7f6e\u6570\u636e\u5e93&#8221;pfsense&#8221;\u7684\u5e10\u53f7\u548c\u5bc6\u7801\u4e3a&#8221;pfsense&#8221;:<\/p>\n<pre>create user pfsense with password 'pfsense'\r\ngrant all privileges on pfsense to pfsense<\/pre>\n<p style=\"text-align: justify;\">\u67e5\u8be2\u6570\u636e\u5e93:<\/p>\n<pre>show databases<\/pre>\n<p style=\"text-align: justify;\">\u67e5\u8be2\u7528\u6237:<\/p>\n<pre>show users<\/pre>\n<p style=\"text-align: justify;\">\u9000\u51fa\u6570\u636e\u5e93\u7ba1\u7406\u754c\u9762<\/p>\n<pre>exit<\/pre>\n<h1 style=\"text-align: justify;\">\u914d\u7f6epfSense<\/h1>\n<p style=\"text-align: left;\">\u5bfc\u822a\u5230pfSense\u9632\u706b\u5899\u7684&#8221;\u7cfb\u7edf- &gt;\u63d2\u4ef6\u7ba1\u7406=&gt;\u53ef\u7528\u63d2\u4ef6&#8221;\u83dc\u5355\uff0c\u627e\u5230Telegraf\u63d2\u4ef6\u5e76\u5b89\u88c5\u3002<a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171631.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6557\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171631.jpg\" alt=\"\" width=\"1139\" height=\"407\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171631.jpg 1139w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171631-300x107.jpg 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171631-1024x366.jpg 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171631-768x274.jpg 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171631-500x179.jpg 500w\" sizes=\"auto, (max-width: 1139px) 100vw, 1139px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5bfc\u822a\u5230\u670d\u52a1<span style=\"font-weight: 300; font-size: 15px;\">&#8211; &gt;\u00a0<\/span>Telegraf<span style=\"font-weight: 300; font-size: 15px;\">\u83dc\u5355\uff0c\u53c2\u7167\u4e0b\u56fe\u586b\u5199\u53c2\u6570\u3002<a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171501.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6558\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171501.jpg\" alt=\"\" width=\"947\" height=\"752\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171501.jpg 947w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171501-300x238.jpg 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171501-768x610.jpg 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-171501-378x300.jpg 378w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/><\/a><\/span><\/p>\n<p style=\"text-align: justify;\">\u4fdd\u5b58\u540e\uff0cpfSense\u5c06\u4ee5\u8bbe\u7f6e\u7684\u66f4\u65b0\u95f4\u9694\u5c06\u6570\u636e\u53d1\u9001\u5230InfluxDB\u3002<\/p>\n<h1 style=\"text-align: justify;\">\u6dfb\u52a0\u6570\u636e\u6e90<\/h1>\n<p style=\"text-align: justify;\">\u6d4f\u89c8\u5668\u8f93\u5165&#8221;http:\/\/ip\u5730\u5740:3000&#8243;\u8fdb\u5165Grafana\u7ba1\u7406\u754c\u9762\uff0c\u9ed8\u8ba4\u5e10\u53f7\u548c\u5bc6\u7801\u4e3a&#8221;admin&#8221;\u3002\u767b\u5f55\u4ee5\u540e\uff0c\u4f1a\u63d0\u793a\u4fee\u6539\u5bc6\u7801\u3002<\/p>\n<p style=\"text-align: left;\">\u5b89\u88c5InfluxDB\u6570\u636e\u6e90\uff0c\u70b9\u51fb\u5de6\u4fa7\u7684Configuration\u83dc\u5355\uff0c\u70b9\u51fbData Sources\uff0c\u5355\u51fb\u53f3\u5219\u7684Add data sources\u6309\u94ae\uff0c\u6dfb\u52a0InfluxDB\u6570\u636e\u6e90\u3002<a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172209.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6560\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172209.jpg\" alt=\"\" width=\"1150\" height=\"676\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172209.jpg 1150w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172209-300x176.jpg 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172209-1024x602.jpg 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172209-768x451.jpg 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172209-500x294.jpg 500w\" sizes=\"auto, (max-width: 1150px) 100vw, 1150px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u670d\u52a1\u5668URL\u53c2\u8003\u4e0b\u56fe\uff0c\u8f93\u5165\u524d\u9762\u521b\u5efa\u7684\u6570\u636e\u5e93\u4fe1\u606f\uff0c\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u5e95\u90e8\u7684Save&amp;Test\u3002<a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172250.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6561\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172250.jpg\" alt=\"\" width=\"665\" height=\"948\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172250.jpg 665w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210106-172250-210x300.jpg 210w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/a><\/p>\n<h1 style=\"text-align: justify;\">\u5bfc\u5165\u76d1\u63a7\u4eea\u8868\u6a21\u677f<\/h1>\n<p style=\"text-align: left;\">\u8fdb\u5165Grafana\uff0c\u70b9\u51fb\u5de6\u4fa7\u7684&#8221;+&#8221;\uff0c\u9009\u62e9import\uff0c\u5bfc\u5165\u6a21\u677f\u6587\u4ef6\uff0c\u53ef\u4ee5\u5728<a href=\"https:\/\/grafana.com\/grafana\/dashboards\/10095\">\u8fd9\u91cc<\/a>\u4e0b\u8f7d\u9002\u5408pfSense\u7684Grafana\u4eea\u8868\u677f\u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165\u8be5\u6a21\u677f\u7684\u6570\u5b57\u7f16\u53f710095\u5bfc\u5165\u3002<a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085833.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6563\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085833.jpg\" alt=\"\" width=\"865\" height=\"658\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085833.jpg 865w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085833-300x228.jpg 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085833-768x584.jpg 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085833-394x300.jpg 394w\" sizes=\"auto, (max-width: 865px) 100vw, 865px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">\u5bfc\u5165\u540e\uff0c\u6839\u636e\u81ea\u5df1\u7684\u914d\u7f6e\uff0c\u586b\u5199\u76f8\u5173\u4fe1\u606f\u3002wan\u63a5\u53e3\u7f51\u5361\u540d\u79f0\uff0c\u53ef\u4ee5\u5728pfSense\u7684\u63a5\u53e3\u5206\u914d\u83dc\u5355\u4e2d\u67e5\u8be2\u3002<a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085010.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6564\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085010.jpg\" alt=\"\" width=\"921\" height=\"791\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085010.jpg 921w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085010-300x258.jpg 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085010-768x660.jpg 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-085010-349x300.jpg 349w\" sizes=\"auto, (max-width: 921px) 100vw, 921px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">\u5bfc\u5165\u6a21\u677f\u540e\uff0c\u5c31\u53ef\u4ee5\u5728\u4eea\u8868\u76d8\u67e5\u770bpfSense\u9632\u706b\u5899\u7684\u5404\u9879\u7edf\u8ba1\u4fe1\u606f\u4e86\u3002<a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-090653.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6565\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-090653.jpg\" alt=\"\" width=\"1219\" height=\"1144\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-090653.jpg 1219w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-090653-300x282.jpg 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-090653-1024x961.jpg 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-090653-768x721.jpg 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2021\/01\/Jietu20210107-090653-320x300.jpg 320w\" sizes=\"auto, (max-width: 1219px) 100vw, 1219px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>pfSense\u7684\u4eea\u8868\u677f\u672c\u8eab\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5b9e\u65f6\u663e\u793a\u7684\u6570\u636e\uff0c\u4f46\u6ca1\u6709\u8ffd\u6eaf\u6027\u3002\u501f\u52a9Grafa &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=6553\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[295],"class_list":["post-6553","post","type-post","status-publish","format-standard","hentry","category-pfsense","tag-grafana-influxdb"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/6553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6553"}],"version-history":[{"count":0,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/6553\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}