cacti监控

一、 使用RPM包配置LANP
1、 安装并配置apache、mariadb
1)
安装apache和mariadb数据库

[[email protected] ~]# rm -rf /etc/yum.repos.d/CentOS-*
[[email protected] ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 写保护,将以只读方式挂载
[[email protected] ~]# yum -y install httpd mariadb mariadb-server
2)
安装php依赖工具

[[email protected] ~]# yum -y install zlib freetype libjpeg fontconfig gd libxml2-devel php-gd
3)
安装php

[[email protected] ~]# yum -y install php php-mysql
4)
修改php主配置文件

[[email protected] ~]# vim /etc/php.ini
879 date.timezone = Asia/Shanghai
5)
创建php测试文件

[[email protected] ~]# vim /var/www/html/index.php

<?php phpinfo(); ?>

6)
修改apache配置文件

[[email protected] ~]# vim /etc/httpd/conf/httpd.conf
163
164 DirectoryIndex index.html index.php
165
7)
启动apache服务

[[email protected] ~]# systemctl start httpd
[[email protected] ~]# systemctl enable httpd
8)
启动mariadb服务

[[email protected] ~]# systemctl start mariadb
[[email protected] ~]# systemctl enable mariadb
9)
Mariadb数据库设置密码

[[email protected] ~]# mysqladmin -uroot password
New password:
Confirm new password:
10)
客户端访问

cacti监控
2、 安装snmp和rrdtool工具
1)
安装snmp

[[email protected] ~]# yum -y install net-snmp-utils net-snmp
2)
设置开机自动启动

[[email protected] ~]# systemctl enable snmpd
3)
安装rrdtoo依赖工具

[[email protected] ~]# yum -y install cairo-devel zlib-devel libxml2 libxml2-devel glib2 glib2-devel libpng libpng-devel freetype freetype-devel libart_lgpl pango pango-devel perl-CPAN
4)
安装rrdtool工具

cacti监控
[[email protected] ~]# tar zxvf rrdtool-1.7.2.tar.gz -C /usr/src/
[[email protected] ~]# cd /usr/src/rrdtool-1.7.2/
[[email protected] rrdtool-1.7.2]# ./configure --prefix=/usr/local/ && make && make install
3、 部署英文版cacti连接mariadb
1)
创建管路cacti账户

[[email protected] ~]# useradd -M -s /sbin/nologin cacti
2)
安装cacti英文版、移动cacti到网站根目录

cacti监控
[[email protected] ~]# tar zxvf cacti-0.8.8b.tar.gz
[[email protected] ~]# mv cacti-0.8.8b /var/www/html/cacti
3)
设置管理网站的所有者

[[email protected] ~]# chown -R cacti:cacti /var/www/html/cacti/
4)
创建数据库cacti

[[email protected] ~]# mysql -uroot [email protected]
MariaDB [(none)]> create database cacti default character set utf8;
Query OK, 1 row affected (0.00 sec)
5)
设置授权cacti账户使用密码cacti访问cacti数据库

MariaDB [(none)]> grant all on cacti.* to ‘cacti’@‘localhost’ identified by ‘[email protected]’;
Query OK, 0 rows affected (0.00 sec)
6)
修改cacti配置文件连接数据库

[[email protected] ~]# vim /var/www/html/cacti/include/config.php
$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cacti”;
$database_password = “[email protected]”;
$database_port = “3306”;
$database_ssl = false
7)
导入数据到cacti数据库中

[[email protected] ~]# mysql -u cacti -p cacti < /var/www/html/cacti/cacti.sql
Enter password:
8)
客户端访问cacti

cacti监控
cacti监控
cacti监控
默认账户admin密码admin
cacti监控
修改密码
cacti监控
cacti监控
4、 部署中文版cacti
1)
创建管理cacti账户

[[email protected] ~]# useradd -M -s /sbin/nologin cacti
2)
安装中文版移动到cacti网站根目录

cacti监控
[[email protected] ~]# tar zxvf cacti-0.8.8b-cn-zutb.tar.gz
[[email protected] ~]# mv cacti/* /var/www/html/
mv:是否覆盖"/var/www/html/index.php"? y
3)
设置管理网站的所有者

[[email protected] ~]# chown -R cacti:cacti /var/www/html/
4)
创建数据库cacti

[[email protected] ~]# mysql -uroot [email protected]
MariaDB [(none)]> create database cacti default character set utf8;
Query OK, 1 row affected (0.00 sec)
5)
设置授权cacti账户使用密码cacti访问cacti数据库

MariaDB [(none)]> grant all on cacti.* to ‘cacti’@‘localhost’ identified by ‘[email protected]’;
Query OK, 0 rows affected (0.00 sec)
6)
修改cacti配置文件连接数据库

$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cacti”;
$database_password = “[email protected]”;
$database_port = “3306”;
$database_ssl = false;
7)
修改cacti.sql配置文件删除第一行数据

[[email protected] ~]# vim /var/www/html/cacti.sql
cacti监控
8)
导入数据到cacti数据库中

[[email protected] ~]# mysql -u cacti -p cacti < /var/www/html/cacti.sql
Enter password:
9)
客户端访问中文版cacti

cacti监控
二、 配置cacti监控Linux、Cisco网络设备
1、 监控Linux、监控服务器本地
1)
修改anmp配置文件

[[email protected] ~]# vim /etc/snmp/snmpd.conf
42 com2sec notConfigUser 192.168.100.10 public
64 access notConfigGroup “” any noauth exact all none none
88 view all included .1 80
2)
重新启动snmp客户端

[[email protected] ~]# systemctl restart snmpd
3)
客户端配置监控

cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
4)
设置手动更新cacti数据

[[email protected] ~]# /usr/bin/php /var/www/html/poller.php –force
cacti监控
6)
设置计划任务自动更新监控数据

[[email protected] ~]# crontab -e
/5 * * * * /usr/bin/php /var/www/html/poller.php –force
2、监控Linux客户端
1)
安装snmp

[[email protected] ~]# rm -rf /etc/yum.repos.d/CentOS-

[[email protected] ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 写保护,将以只读方式挂载
[[email protected] ~]# yum -y install net-snmp
2)
修改snmp配置文件

[[email protected] ~]# vim /etc/snmp/snmpd.conf
42 com2sec notConfigUser 192.168.100.10 public
64 access notConfigGroup “” any noauth exact all none none
88 view all included .1 80
3)
设置服务开机自动启动

[[email protected] ~]# systemctl start snmpd
[[email protected] ~]# systemctl enable snmpd
4)
客户端监控

cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
5)
设置手动更新cacti数据

[[email protected] ~]# /usr/bin/php /var/www/html/poller.php –force
cacti监控
3、监控Cisco网络设备
1)
配置IP地址网关

cacti监控
cacti监控
cacti监控
R1#configure terminal
R1(config)#interface fastEthernet 0/1
R1(config-if)#no switchport
R1(config-if)#ip address 192.168.100.30 255.255.255.0
R1(config-if)#no shutdown
2)
配置snmp管理

R1(config)#snmp-server community public ro
3)
客户端监控

cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
cacti监控
4)
设置手动更新cacti数据

[[email protected] ~]# /usr/bin/php /var/www/html/poller.php --force
cacti监控

相关文章:

  • 2021-09-26
  • 2022-12-23
  • 2021-06-18
  • 2022-01-15
  • 2021-07-23
  • 2021-10-11
猜你喜欢
  • 2022-01-19
  • 2021-07-17
  • 2021-10-16
  • 2021-06-12
  • 2021-10-26
相关资源
相似解决方案