码迷,mamicode.com
首页 > 系统相关 > 详细

Linux监控和安全运维--cacti安装部署

时间:2015-07-27 00:37:09      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:cacti安装部署

cacti安装

[root@client~]# rpm -ivh http://www.aminglinux.com/bbs/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm

//安装epel扩展源

[root@client ~]# yum install -y  httpd php php-mysql mysql mysql-server mysql-devel php-gd  libjpeg libjpeg-devel libpng libpng-devel

//安装httpdphpmysql

 

[root@client ~]# yum install -y cacti  net-snmp  net-snmp-utils  rrdtool

//安装cacti  net-snmp  rrdtool

 

 

[root@client ~]# /etc/init.d/mysqld start

[root@client ~]# /etc/init.d/httpd start

[root@client ~]# /etc/init.d/snmpd  start

 

 

[root@client ~]# vim /etc/httpd/conf.d/cacti.conf

<Directory /usr/share/cacti/>

        <IfModule mod_authz_core.c>

                # httpd 2.4

                Require host localhost

        </IfModule>

        <IfModule !mod_authz_core.c>

                # httpd 2.2

                Order deny,allow

                 Allow from all

                Allow from localhost

        </IfModule>

</Directory>

 

 

[root@client ~]# /etc/init.d/httpd  restart

 

 

 

[root@client ~]# mysql -uroot  -e "create database cacti"

[root@client ~]# mysql -uroot -e "grant all on cacti.* to ‘cacti‘@‘127.0.0.1‘ identified by ‘cacti‘;"

[root@client ~]# mysql -uroot cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql

 

 

 

 

[root@client ~]# vim /usr/share/cacti/include/config.php

$database_type = "mysql";

$database_default = "cacti";

$database_hostname = "127.0.0.1";

$database_username = "cacti";

$database_password = "cacti";

$database_port = "3306";

$database_ssl = false;

 

 

web访问192.168.137.21/cacti进入cacti安装的图形页面

技术分享

next-----next------finish

User Name: admin

Password:admin

//输入用户名密码登入

 

Password:admin

Confirm:admin

//修改密码

 

登入成功

技术分享

 

 

 

 

 

[root@client ~]# /usr/bin/php /usr/share/cacti/poller.php

 

 

[root@client ~]# vim /etc/php.ini

date.timezone =‘Asia/Chongqing‘

 

 

[root@client ~]# crontab  -e

*/5 * * * *  /usr/bin/php /usr/share/cacti/poller.php

 

等待5分钟以上,任务计划执行后,有监控信息参数,产生为图片信息。

技术分享

 

 

 

以上监控的为本机

cacti增加客户端监控,安装客户端(增加一个linux服务器)

打开一台客户机

[root@client ~]# yum install -y net-snmp

[root@client ~]#  vim /etc/snmp/snmpd.conf

syslocation 137.21                         //可写本机IP

syscontact Root 123@456.com               //管理员的邮箱

 

[root@client ~]# service  snmpd  start

 

 

 

 

在网页上增加该客户机的监控

技术分享

console-------Device-------Add----

Description  可写本机ip(或自定义)

 Hostname  可写本机ip

 Host Template  ucd/net  SNMP Host

 SNMP Version  Version 2

 

 ----create------Create Graphs for this Host---------

Graph Types: SNMP - Interface Statistics

选中网卡-----create

技术分享

 

 

 

 

Graph Types: Graph Template Based

Create: ucd/net - CPU Usage         

Create: ucd/net - Load Average    

Create: ucd/net - Memory Usage

三项全选,监控CPULoadMemory

create

技术分享

 

 

将这台设备的监控加入tree

Graph Trees------- Default Tree--------- Add------

技术分享

Host-----选中刚加的设备---create

技术分享

 

graphs---------Default Tree----192.168.137.21

技术分享

查看监控数据产生

 

本文出自 “Linux学习笔记” 博客,请务必保留此出处http://9656134.blog.51cto.com/9646134/1678497

Linux监控和安全运维--cacti安装部署

标签:cacti安装部署

原文地址:http://9656134.blog.51cto.com/9646134/1678497

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!