{"id":634,"date":"2020-10-14T11:41:16","date_gmt":"2020-10-14T03:41:16","guid":{"rendered":"http:\/\/wp.vicds.com\/?p=634"},"modified":"2021-05-17T15:41:52","modified_gmt":"2021-05-17T07:41:52","slug":"cacti-debian","status":"publish","type":"post","link":"https:\/\/wp.vicds.com\/?p=634","title":{"rendered":"cacti @debian"},"content":{"rendered":"\n<p>\u5b89\u88dd\u524d\u5148\u78ba\u5b9a\u6642\u5340\u6709\u6c92\u6709\u8a2d\u5c0d  <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">timedatectl | grep \"Time zone\"\n<\/pre>\n\n\n\n<p>\u5982\u679c\u4e0d\u5c0d\u5c31\u91cd\u8a2d\u4e00\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">tzselect<\/code><\/pre>\n\n\n\n<p>\u518d\u4f86\u6642\u9593\u6709\u6c92\u6709\u5c0d<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">ntpdate time.stdtime.gov.tw<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>mysql -u root -p<\/p>\n\n\n\n<p># \u5982\u679c\u662f\u7b2c\u4e00\u6b21\u5b89\u88ddmariadb, \u5148\u6539\u5bc6\u78bc<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">Update user SET password=PASSWORD(&quot;\u5bc6\u78bc&quot;) WHERE user=&quot;\u4f7f\u7528\u8005&quot;;<\/code><\/pre>\n\n\n\n<p># \u958bcacti\u8cc7\u6599\u5eab<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">mysql&gt; create database cacti;\nmysql&gt; grant all on cacti.* to &#039;cactiuser&#039;@&#039;localhost&#039; identified by &#039;password&#039;;\nmysql&gt; flush privileges;\nmysql&gt; exit<\/code><\/pre>\n\n\n\n<p># \u91cd\u65b0\u555f\u52d5\u670d\u52d9<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\"># systemctl restart mysql apache2\n# systemctl status mysql apache2<\/code><\/pre>\n\n\n\n<p>\u5b89\u88dd\u958b\u59cb<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">apt install cacti<\/code><\/pre>\n\n\n\n<p>\u5b8c\u6210<\/p>\n\n\n\n<p>cacti \u7684\u904b\u4f5c\u65b9\u5f0f\uff0c\u4e26\u4e0d\u662f\u7531\u672c\u8eab\u4e1f\u8cc7\u6599\u7d66Server<br>\u800c\u662fServer\u4e3b\u8981\u767c\u8d77\u5230Client\u6488\u53d6\u8cc7\u6599\u5f8c\uff0c\u7e6a\u88fd\u5716\u8868\u5448\u73fe<br>\u56e0\u6b64\uff0cClient\u672c\u8eab\u90fd\u5fc5\u9808\u5b89\u88ddsnmp\u7684\u5957\u4ef6\uff0c\u4e26\u958b\u555fport\u7d66Server\u6488\u53d6<br>snmp \u4f7f\u7528\u7684 port \u70ba 161\/udp<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>client\u7aef\u8a2d\u5b9a<\/p>\n\n\n\n<p>debian\u5728\u5b89\u88ddcacti\u6642\u5c31\u6703\u5b89\u88ddsnmpd\u4e86, \u5982\u679c\u6c92\u6709\u5c31\u624b\u52d5\u88dd\u4e00\u4e0b<\/p>\n\n\n\n<p>apt install snmpd<\/p>\n\n\n\n<p>netstat -nutlp | grep snmpd<\/p>\n\n\n\n<p>\u5982\u679c\u6709\u9632\u706b\u7246\u7684\u8a71\u8981\u8b93\u5b83\u904e<\/p>\n\n\n\n<p>sudo vim \/etc\/iptables.rules<\/p>\n\n\n\n<p>-A INPUT -m state \u2013state NEW -m udp -p udp \u2013dport 161 -j ACCEPT<\/p>\n\n\n\n<p>\u5982\u679c\u662fwindows 10 \u8981\u88ddsnmp\u7684\u8a71\u8acb\u53c3\u8003<\/p>\n\n\n\n<p><strong>Enabling&nbsp;SNMP&nbsp;on&nbsp;Windows 10&nbsp;Version 1809 and Later<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Open the Settings on your\u00a0<strong>Windows<\/strong>\u00a0machine.<\/li><li>Click Apps.<\/li><li>Choose Manage optional features under Apps &amp; features.<\/li><li>Click Add a feature.<\/li><li>Select\u00a0<strong>Simple Network Management Protocol<\/strong>\u00a0(<strong>SNMP<\/strong>) from the list.<\/li><li>Click Install to enable\u00a0<strong>SNMP<\/strong>\u00a0on your computer.<\/li><li>\u4ee5\u4e0a\u8a2d\u5b9a\u5b8c\u4e86\u4e4b\u5f8c\u57f7\u884cservices.msc  .<\/li><li>\u627e\u5230SNMP \u670d\u52d9. \u9ede2\u4e0b\u9078\u5b89\u5168\u6027(Security).<\/li><li>\u5728\u7fa4\u9ad4(Accepted community names)\u7684\u5730\u65b9, \u8f38\u5165\u8207cacti\u88e1\u540c\u6a23\u7684\u540d\u5b57(\u5efa\u8b70\u4f7f\u7528\u82f1\u6587). \u4e0b\u9762\u6539\u9078\u53ef\u5f9e\u6240\u6709\u4e3b\u6a5f\u63a5\u53d7SNMP\u5c01\u5305(Accept SNMP packets from any host.<\/li><li>\u5982\u679c\u9023\u4e0d\u4e0a\u5728\u9632\u706b\u7246\u88e1\u5141\u8a31udp161\u901a\u904e.<\/li><\/ol>\n\n\n\n<p>Server\u7aef<\/p>\n\n\n\n<p>\u767b\u5165cacti\u5f8c\u4e0a\u9762\u9078console\u5de6\u908a\u9078\u55ae\u9078Create > New Device, \u5728SNMP Community String\u9019\u4e00\u6b04\u586b\u5165\u525b\u525b\u7684community name\u7684\u8a2d\u5b9a. Hostname\u586bIP,  Device Template\u9078Generic SNMP Device. \u90a3\u57fa\u672c\u7684\u5716\u8868\u61c9\u8a72\u5c31\u51fa\u4f86\u4e86.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88dd\u524d\u5148\u78ba\u5b9a\u6642\u5340\u6709\u6c92\u6709\u8a2d\u5c0d timedate [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,1],"tags":[],"class_list":["post-634","post","type-post","status-publish","format-standard","hentry","category-linux","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/posts\/634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=634"}],"version-history":[{"count":9,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/posts\/634\/revisions"}],"predecessor-version":[{"id":670,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/posts\/634\/revisions\/670"}],"wp:attachment":[{"href":"https:\/\/wp.vicds.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}