{"id":13583,"date":"2016-05-20T06:02:00","date_gmt":"2016-05-19T22:02:00","guid":{"rendered":"http:\/\/blog.pmail.idv.tw\/?p=13583"},"modified":"2016-05-27T11:58:41","modified_gmt":"2016-05-27T03:58:41","slug":"centos-7-%e5%ae%89%e8%a3%9dcacti","status":"publish","type":"post","link":"https:\/\/blog.pmail.idv.tw\/?p=13583","title":{"rendered":"CentOS-7 \u5b89\u88ddcacti 0.8.8g"},"content":{"rendered":"<p>CentOS7 \u5feb\u901f\u5b89\u88ddcacti \u7b46\u8a18<\/p>\n<p><!--more--><\/p>\n<p>\u5b89\u88dd\u9700\u8981\u5957\u4ef6\uff0c\u5229\u7528yum\u4f86\u5b89\u88dd\u89e3\u6c7a\u76f8\u4f9d\u6027\u554f\u984c<\/p>\n<p>yum install httpd mariadb-server php php-mysql php-pear php-gd php-mbstring net-snmp net-snmp-utils rrdtool<\/p>\n<p>yum install epel-release<\/p>\n<p>yum install cacti<\/p>\n<p>\u6b64\u6b21\u5b89\u88ddcacti \u7248\u672c\u6703\u662f0.8.8g-1.el7<\/p>\n<p>\u555f\u52d5\u53ca\u521d\u59cb\u5316\u8cc7\u6599\u5eab(\u904e\u7a0b\u4e2d\u6703\u76f4\u63a5\u63d0\u662f\u8a2d\u5b9a\u8cc7\u6599\u5eabroot\u5bc6\u78bc)<\/p>\n<p>\u6307\u4ee4<\/p>\n<p>systemctl enable mariadb<br \/>\nsystemctl start mariadb<br \/>\nmysql_secure_installation<\/p>\n<p>&nbsp;<\/p>\n<p>\u5efa\u7acb\u7a7a\u767d\u8cc7\u6599\u5eab<\/p>\n<p>[root@localhost ~]# mysql -u root -p -A mysql<\/p>\n<p>Enter password:<\/p>\n<p>Welcome to the MariaDB monitor. Commands end with ; or \\g.<\/p>\n<p>Your MariaDB connection id is 12<\/p>\n<p>Server version: 5.5.47-MariaDB MariaDB Server<\/p>\n<p>Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.<\/p>\n<p>Type &#8216;help;&#8217; or &#8216;\\h&#8217; for help. Type &#8216;\\c&#8217; to clear the current input statement.<\/p>\n<p>MariaDB [mysql]&gt; create database cacti;<\/p>\n<p>Query OK, 1 row affected (0.00 sec)<\/p>\n<p><span style=\"color: #0000ff;\">MariaDB [mysql]&gt; grant all privileges on cacti.* to cacti@localhost identified by &#8216;password&#8217;;<\/span><\/p>\n<p>Query OK, 0 rows affected (0.00 sec)<\/p>\n<p>MariaDB [mysql]&gt; flush privileges;<\/p>\n<p>Query OK, 0 rows affected (0.01 sec)<\/p>\n<p>MariaDB [mysql]&gt; exit<\/p>\n<p>\u4e0a\u8ff0\u85cd\u8272\u5b57\u9ad4\u90e8\u5206\u662f\u8a2d\u5b9a\u53ef\u4ee5\u5b58\u53d6\u8cc7\u6599\u5eab\u7684\u5e33\u865f\u53ca\u5bc6\u78bc(\u5f8c\u9762\u6b65\u9a5f\u6703\u8f38\u5165)<\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0022.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image002\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image002_thumb2.jpg\" alt=\"clip_image002\" width=\"644\" height=\"303\" border=\"0\" \/><\/a><\/p>\n<p>\u532f\u5165cacti \u8cc7\u6599\u8868<\/p>\n<p>\u6307\u4ee4 : cacti-0.8.8g]# mysql -u root -p -A cacti &lt; \/usr\/share\/doc\/cacti-0.8.8g\/cacti.sql<\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0042.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image004\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image004_thumb2.jpg\" alt=\"clip_image004\" width=\"644\" height=\"100\" border=\"0\" \/><\/a><\/p>\n<p>\u8a2d\u5b9ahttpd\u670d\u52d9<\/p>\n<p>vi \/etc\/httpd\/conf.d\/cacti.conf<\/p>\n<p>&lt;Directory \/usr\/share\/cacti\/&gt;<\/p>\n<p>&lt;IfModule mod_authz_core.c&gt;<\/p>\n<p># httpd 2.4<\/p>\n<p>Require host localhost<\/p>\n<p>Require ip 192.168.3.0\/24 (\u8a2d\u5b9a\u5141\u8a31\u9023\u7dda\u7ba1\u7406\u4ecb\u9762\u7684IP)<\/p>\n<p>&lt;\/IfModule&gt;<\/p>\n<p>&lt;IfModule !mod_authz_core.c&gt;<\/p>\n<p># httpd 2.2<\/p>\n<p>Order deny,allow<\/p>\n<p>Deny from all<\/p>\n<p>Allow from localhost<\/p>\n<p>&lt;\/IfModule&gt;<\/p>\n<p>&lt;\/Directory&gt;<\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0062.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image006\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image006_thumb2.jpg\" alt=\"clip_image006\" width=\"644\" height=\"452\" border=\"0\" \/><\/a><\/p>\n<p>\u8a2d\u5b9a\u9023\u7dda\u8cc7\u6599\u5eab\u8cc7\u8a0a(\u4fee\u6539\u5e33\u865f\u5bc6\u78bc)<\/p>\n<p>vi \/etc\/cacti\/db.php<\/p>\n<p>$database_type = &#8220;mysql&#8221;;<\/p>\n<p>$database_default = &#8220;cacti&#8221;;<\/p>\n<p>$database_hostname = &#8220;localhost&#8221;;<\/p>\n<p><span style=\"color: #ff0000;\">$database_username = &#8220;cacti&#8221;;<\/span><\/p>\n<p><span style=\"color: #ff0000;\">$database_password = &#8220;password&#8221;;<\/span><\/p>\n<p>$database_port = &#8220;3306&#8221;;<\/p>\n<p>$database_ssl = false;<\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0071.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image007\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image007_thumb1.jpg\" alt=\"clip_image007\" width=\"644\" height=\"162\" border=\"0\" \/><\/a><\/p>\n<p>\u4fee\u6539php.ini<\/p>\n<p>vi \/etc\/php.ini<\/p>\n<p>\u8981\u8a18\u5f97\u5c07\u524d\u9762\u5206\u865f\u53bb\u6389<\/p>\n<p>date.timezone = Asia\/Taipei<\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0081.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image008\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image008_thumb1.jpg\" alt=\"clip_image008\" width=\"644\" height=\"441\" border=\"0\" \/><\/a><\/p>\n<p>\u8a2d\u5b9aapache \u53ca\u555f\u52d5<\/p>\n<p>\u6307\u4ee4<\/p>\n<p>systemctl enable httpd\u00a0 =&gt; \u958b\u555f\u81ea\u52d5\u555f\u52d5<br \/>\nsystemctl start httpd\u00a0\u00a0 =&gt; \u555f\u52d5apache<\/p>\n<p>\u4fee\u6539\u6392\u7a0b<\/p>\n<p>vi \/etc\/cron.d\/cacti<\/p>\n<p>\u53d6\u6d88\u8a3b\u89e3#<\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0091.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image009\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image009_thumb1.jpg\" alt=\"clip_image009\" width=\"644\" height=\"112\" border=\"0\" \/><\/a><\/p>\n<p>\u555f\u52d5snmp<\/p>\n<p>systemctl enable snmpd<br \/>\nsystemctl start snmpd<\/p>\n<p>\u7b2c\u4e00\u6b21\u767b\u5165\u8a2d\u5b9a<\/p>\n<p><a href=\"http:\/\/cacti.ip.address\/cacti\/install\/\">http:\/\/cacti.ip.address\/cacti\/install\/<\/a><\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0101.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image010\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image010_thumb1.jpg\" alt=\"clip_image010\" width=\"644\" height=\"289\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0112.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image011\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image011_thumb2.jpg\" alt=\"clip_image011\" width=\"644\" height=\"222\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0132.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image013\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image013_thumb2.jpg\" alt=\"clip_image013\" width=\"244\" height=\"128\" border=\"0\" \/><\/a><\/p>\n<p>\u9810\u8a2d\u5e33\u865f\u5bc6\u78bc admin\/admin<\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0141.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image014\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image014_thumb1.jpg\" alt=\"clip_image014\" width=\"644\" height=\"338\" border=\"0\" \/><\/a><\/p>\n<p>\u767b\u5165\u5f8c\u6703\u5f37\u8feb\u4fee\u6539\u5bc6\u78bc<\/p>\n<p><a href=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image0152.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image015\" src=\"https:\/\/blog.pmail.idv.tw\/wp-content\/uploads\/2016\/05\/clip_image015_thumb2.jpg\" alt=\"clip_image015\" width=\"644\" height=\"435\" border=\"0\" \/><\/a><\/p>\n<div class=\"21cd169d3c0f71e95b84db320302cb4a\" data-index=\"1\" style=\"float: right; margin:10px 0 10px 10px;\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-8711325745898650\"\r\n     crossorigin=\"anonymous\"><\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>CentOS7 \u5feb\u901f\u5b89\u88ddcacti \u7b46\u8a18<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[105,48],"tags":[],"class_list":["post-13583","post","type-post","status-publish","format-standard","hentry","category-cacti","category-centos"],"_links":{"self":[{"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/13583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13583"}],"version-history":[{"count":2,"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/13583\/revisions"}],"predecessor-version":[{"id":13683,"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/13583\/revisions\/13683"}],"wp:attachment":[{"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pmail.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}