Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS 7 installs cacti 1.1.x

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

As the cacti 1.1.x series has changed a lot since it was released, it integrates a lot of plug-ins and has its own automatic discovery function, so recording it is more suitable for copying and pasting.

Environment: CentOS 7.4

Installation premise

A. Install the system patch

Yum update-y

B. Enable ntp to ensure the correct time

Yum install chrony-ysystemctl enable chronydsystemctl start chronyd

C. Disable selinux and restart takes effect

Sed-I's impulse SELINUX.GOLINUXANGUXG / etc/selinux/configreboot

1. Install mariadb 10.1

Cacti 1.1.0 requires mysql > = 5.6, so choose mariadb 10.1 here

Yum install centos-release-openstack-ocata-yyum install mariadb-server-y

2. Adjust mariadb parameters (refer to configuration)

[mysqld] .character-set-server = utf8mb4collation-server = utf8mb4_unicode_cimax_heap_table_size = 128Mmax_allowed_packet = 32Mtmp_table_size = 64Mjoin_buffer_size = 64Minnodb_buffer_pool_size = 1024Minnodb_doublewrite = offinnodb_flush_log_at_timeout = 3

Restart mariadb to let the configuration take effect

Systemctl enable mariadbsystemctl start mariadb

Import time zone information

Mysql_tzinfo_to_sql / usr/share/zoneinfo/ | mysql-u root mysql

3. Install lamp

Yum install httpd php php-mysqlnd php-mbstring php-ldap php-process php-gd php-snmp php-pecl-zendopcache php-xml wget net-snmp-utils rrdtool-yecho "ServerTokens Prod" > > / etc/httpd/conf/httpd.confecho "ServerSignature Off" > > / etc/httpd/conf/httpd.confsed-I's bank date.timezone.timezone date.timezone = PRC/g' / etc/php.inimkdir-p / var/lib/php/sessionchown-R apache:apache / var/lib/php/sessionsystemctl enable httpdsystemctl start httpd

4. Download cacti

Cd / var/wwww/htmlwget http://www.cacti.net/downloads/cacti-1.1.0.tar.gztar zxvf cacti-1.1.0.tar.gzmv cacti-1.1.0 cacticd cactichown-R apache:apache resource scripts log cache

5. Build a database for cacti

Mysql-u root-e "drop database if exists cacti" mysql-u root-e "delete from mysql.user where Host = 'localhost' and User =' cactiuser'" mysql-u root-e "create database `cacti` default character set utf8mb4 collate utf8mb4_unicode_ci" mysql-u root-e "grant all on cacti.* to 'cactiuser'@'localhost' identified by' cactiuser'" mysql-u root-e "grant select on mysql.time_zone_name to 'cactiuser'@'localhost'" mysql-u root-e "flush privileges" mysql-u root cacti

< /var/www/html/cacti/cacti.sql 6、安装向导 访问http://ip/cacti 进入安装向导 7、修改密码 默认用户密码admin/admin,首次登陆要求改密码,密码长度和复杂度都比较严格,点赞。 8、定时任务 设置定时任务,在/etc/crontab 文件中添加一行 */5 * * * * root /usr/bin/php -q /var/www/html/cacti/poller.php >

/ dev/null

9. Configure automatic discovery (optional)

The function is similar to zabbix.

A. Define snmp options, such as snmp v2jigme community for abcb, define scanning network segments, such as 192.168.0.0Comp24, scan regularly, and automatically add machines that are alive on snmp ports to cacti,c, define rules, put scanned machines into different tree according to operating system classification, and draw different diagrams.

10. Install spine (optional)

Spine is a c-written program with much higher performance than the default poller.php.

Yum install gcc libtool make autoconf mysql-devel net-snmp-devel help2man wget-ywget tar zxvf cacti-spine-1.1.0.tar.gzcd cacti-spine-1.1.0./bootstrap./configure-- with-mysqlmakecp spine / usr/local/bin/cp spine.conf.dist / etc/spine.conf

Remember to modify it as needed in the / etc/spine.conf file.

Reinstall

If you need to reinstall, simply delete the database and reinitialize it (steps 5-7)

Sinicization

Cacti 1.1.x supports Chinese, but the Sinicization is not complete. Students with itchy hands can follow the following methods:

1. Installation

Yum install gettext-y

2. Decompile mo file to po file

Cd / var/www/html/cacti/locales/LC_MESSAGES/usr/bin/msgunfmt chinese_china_simplified.mo-o chinese_china_simplified.po

3. Modify the file with a text editor

4. Compile po file to mo file

/ usr/bin/msgfmt chinese_china_simplified.po-o chinese_china_simplified.mo

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report