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

cacti安装

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

//安装epel扩展源

[[email protected] ~]# yum install -y  httpd php php-mysql mysql mysql-server mysql-devel php-gd  libjpeg libjpeg-devel libpng libpng-devel

//安装httpd、php、mysql

[[email protected] ~]# yum install -y cacti  net-snmp  net-snmp-utils  rrdtool

//安装cacti  net-snmp  rrdtool

[[email protected] ~]# /etc/init.d/mysqld start

[[email protected] ~]# /etc/init.d/httpd start

[[email protected] ~]# /etc/init.d/snmpd  start

[[email protected] ~]# 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>

[[email protected] ~]# /etc/init.d/httpd  restart

[[email protected] ~]# mysql -uroot  -e "create database cacti"

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

[[email protected] ~]# mysql -uroot cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql

[[email protected] ~]# 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

//修改密码

登入成功

[[email protected] ~]# /usr/bin/php /usr/share/cacti/poller.php

[[email protected] ~]# vim /etc/php.ini

date.timezone =‘Asia/Chongqing‘

[[email protected] ~]# crontab  -e

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

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

以上监控的为本机

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

打开一台客户机

[[email protected] ~]# yum install -y net-snmp

[[email protected] ~]#  vim /etc/snmp/snmpd.conf

syslocation 137.21                         //可写本机IP

syscontact Root [email protected]               //管理员的邮箱

[[email protected] ~]# 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

三项全选,监控CPU、Load、Memory

create

将这台设备的监控加入tree

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

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

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

查看监控数据产生

时间: 2024-08-10 23:26:04

Linux监控和安全运维--cacti安装部署的相关文章

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

zabbix服务端安装 [[email protected] conf.d]# rpm -ivh http://www.aminglinux.com/bbs/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm [[email protected] conf.d]# yum install -y  httpd mysql mysql-libs php php-mysql mysql-server php-bcmath php-g

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

nagios安装 [[email protected] ~]# rpm -ivh http://www.aminglinux.com/bbs/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm [[email protected] ~]# yum install -y httpd nagios nagios-plugins nagios-plugins-all nrpe nagios-plugins-nrpe [[email 

第四阶段 :安全与监控 Linux监控和安全运维

监控介绍 monitor  cacti(rrdtool) 画图 监控网络设备 流量 展现历史数据功能 nagios 监控服务的状态 磁盘 内存 不会记录数据 一目了然 可自己写脚本 zabbix cacti安装 rpm -ivh http://www.lishiming.net/data/attachment/forum/epel-release-6-8_32.noarch.rpm yum install  epel-release yum install -y  httpd php php-m

Linux监控和安全运维 2.0 zabbix配置邮件告警

1.发邮件启动postfix /etc/init.d/postfix start mail -s "test" 836503270@qq.com < /etc/inittab mailq 查看发送结果 2.配置发邮件文件 mkdir -p /home/zabbix/bin vim /home/zabbix/bin/baojing.sh #! /bin/bash echo "$3" |/bin/mail -s "$2" $1 chmod +x

自动化运维工具安装部署 chef (二) - server的安装

经过一个晚上的下载,终于下载好了 安装前先抓个虚拟机镜像 原始文档 https://docs.chef.io/install_server.html 开始安装 安装完成 初始化下 [[email protected]_server chef]# chef-server-ctl reconfigure 初始化失败鸟.... common_name is required 用vi改了 /etc/hosts,ping了一下自己配置的FQDN名,通的,再次重新配置一样错误 谷歌了下错误,输入 hostn

自动化运维工具安装部署 chef (四) - node的安装

原文在此 https://docs.chef.io/nodes.html 节点分好几种 又加了一台机器 [[email protected] ~]# cat /etc/hosts先确保hosts里面都有解析 [[email protected] chef]# scp chefdk-2.4.17-1.el7.x86_64.rpm [email protected]:/root/chef 先安装DK rpm –ivh chefdk-2.4.17-1.el7.x86_64.rpm? 安装之后验证下 e

自动化运维工具安装部署 chef (六)命令行总结

抽空继续chef的实验,理解了它的架构,测试环境重新推到重来 server yum install vsftpd -y vi /etc/vsftp/ftp_user vi /etc/vsftp/user_list systemctl stop firewalld systemctl disable firewalld setenforce 0 vi /etc/selinux/config systemctl restart vsftpd systemctl enable vsftpd vi /e

自动化运维工具安装部署 chef (五) - node的注册和troubleshooting

上次卡在了pem认证,找了官网文档,解决了401认证错误 修改 knife.rb current_dir = File.dirname(__FILE__) log_level :info log_location STDOUT node_name "admin" client_key "#{current_dir}/admin.pem" chef_server_url "https://chefserver/organizations/pactera&qu

无监控,不运维!运维监控工具平台建设总结

本文摘自微信公众号<高效运维> 运维行业有句话:"无监控.不运维",是的,一点也不夸张,监控俗称"第三只眼".没了监控,什么基础运维,业务运维都是"瞎子".所以说监控是运维这个职业的根本. 尤其是在现在DevOps这么火的时候,用监控数据给自己撑腰,这显得更加必要,有人说运维是背锅侠,那么,有了监控,有了充足的数据,一切以数据说话,运维还需要背锅吗,所以作为一个运维工程师,如何构建一套监控系统是你的第一件工作. 一.常见的运维监控工具