搭建企业cacti服务器

              作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

今天搭建了cacti,为了方便监控我的交换机~因为查了很多zabbix的资料关于监控交换机的教程~我都屡屡失败~一怒之下就有了

搭建cacti的想法~其实在图形这方面,其不必zabbix差哟,在搭建的过程中花费了我不少时间解决问题,还是要多谢很多网友帮我解决

问题呢~从这次搭建过程中我深深得到了一个体会~就是要看日志!日志能告诉我们错误的原因在哪~然后把这个错误铁道百度上去就好~

好了,废话不多说~开始我们的搭建教程吧,注意,搭建该服务器的时候我用的是已经搭建好的LNMP。至于怎么搭建LNMP环境我就不多说说了~可以参考我的另外一篇文章相信写

了搭建的过程~

1.安装SNMP(简单网络管理协议)

[root@bogon yinzhengjie]# yum -y install  net-snmp-*   perl-SNMP_Session libvirt-snmp   cluster-snmp

2.安装rrdtool,这个软件是cacti的核心,因为cacti就是用它来绘图的哟

[root@bogon yinzhengjie]# yum -y install rrdtool

3.下载cacti包(在这里我提供了百度云的下载链接,也可以去官网下载最新版本的包哟~)

链接:http://pan.baidu.com/s/1boK3MXL 密码:lcv9

[root@bogon yinzhengjie]# yum -y install lrzsz

使用rz命令上传到服务器/yinzhengjie的目录下

4.拷贝cacti的包到html目录下,方便后期来通过nginx来访问web界面~

[root@bogon yinzhengjie]# unzip  cacti.zip

[root@bogon yinzhengjie]# cd  cacti

[root@bogon cacti]# tar -zxvf cacti-0.8.7g.tar.gz

[root@bogon yinzhengjie]# mv /yinzhengjie/cacti/cacti-0.8.7g /usr/local/nginx/html/cacti

5.更改文件的授权

[root@bogon yinzhengjie]# cd /usr/local/nginx/html/

[root@bogon html]# chown  -R root:root cacti

[root@bogon html]# useradd -s /sbin/nologin cactiuser

[root@bogon html]# cd cacti/

[root@bogon cacti]# chown  cactiuser:cactiuser  rra  log

6.数据库授权

[root@bogon cacti]# mysql -pyinzhengjie

mysql> create database cactidb DEFAULT CHARACTER SET utf8;
mysql>grant all on  cactidb.*  to  cactiuser@"localhost" identified by  "123456";

mysql> exit

7. 将监控模板导入到cactidb的数据库里面

[root@bogon yinzhengjie]# sed -i  '/MyISAM/s/TYPE/engine/' /usr/local/nginx/html/cacti/cacti.sql

[root@bogon yinzhengjie]# mysql -pyinzhengjie cactidb < /usr/local/nginx/html/cacti/cacti.sql

8.修改php链接数据库信息的脚本

[root@bogon yinzhengjie]# vim /usr/local/nginx/html/cacti/include/config.php

9.删除session_unregister()这个函数

[root@bogon yinzhengjie]# vim /usr/local/nginx/html/cacti/lib/functions.php

将 session_unregister($var_name);
改为:

unset($_session_unregister[$var_name]);

10.编辑cacti虚拟主机

[root@bogon yinzhengjie]# mkdir -pv /usr/local/nginx/conf/cacti/
mkdir: 已创建目录 "/usr/local/nginx/conf/cacti/"

[root@bogon yinzhengjie]# more /usr/local/nginx/conf/cacti/cacti.conf
server {
listen 8028;
server_name web;
access_log /usr/local/nginx/html/cacti/log/cacti.log;
index index.php;
root /usr/local/nginx/html/cacti;
location /{
try_files $uri $uri/ /index.php?$args;
}
location ~ ^(.+.php)(.*)$ {
fastcgi_split_path_info ^(.+.php)(.*)$;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
[root@bogon yinzhengjie]#

11.编辑nginx配置文件

[root@bogon yinzhengjie]# more /usr/local/nginx/conf/nginx.conf
user nginx;
worker_processes 1;

pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;
include cacti/*.conf;

}
[root@bogon yinzhengjie]#

12重启nginx服务

[root@bogon yinzhengjie]# /etc/init.d/nginx restart
Stop Nginx... [OK]
Starting Nginx... [OK]
[root@bogon yinzhengjie]#

13.在浏览器里访问cacti服务器的监控页面

在浏览器的地址栏输入:http://172.30.1.60:8028/

Duang~至此~咱们的cacti服务器就搭建完成了哟~

对了~登陆成功会强制要求你输入新的账号密码~你自定义即可~在这里我没有截图~没法啊···手速太快了!

搭建企业cacti服务器的更多相关文章

  1. 用Windows Server 2003搭建企业内部邮件服务器

    公司要搭建一个邮件服务器,方便内部邮件的发送.而且要求每位员工都可以使用自己的账号和密码.领导将这份工作交给我,不过,这可难不倒我.只要借助Windows Server 2003就可以轻松建起内部邮件 ...

  2. 快速搭建企业subversion

    快速搭建企业subversion 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 我们公司用的版本控制控制系统就是subversion(简称SVN),不得不说这是一款比较好使的管理工 ...

  3. 【转】使用JIRA搭建企业问题跟踪系统【个人推荐】

    免责声明:     本文转自网络文章,转载此文章仅为个人收藏,分享知识,如有侵权,请联系博主进行删除.     原文作者:Judy Shen的专栏     原文地址:使用JIRA搭建企业问题跟踪系统 ...

  4. 搭建Windows SVN服务器及TortoiseSVN使用帮助和下载

    搭建Windows SVN服务器: 用的SVN服务器通常为外部,例如Google Code的服务器,不过,做为一个程序开发人员,就算自己一个人写程序,也应该有一个SVN版本控制系统,以便对开发代码进行 ...

  5. SOLR搭建企业搜索平台

    一. SOLR搭建企业搜索平台  运行环境:  运行容器:Tomcat6.0.20  Solr版本:apache-solr-1.4.0  分词器:mmseg4j-1.6.2  词库:sogou-dic ...

  6. (转)搭建企业内部yum仓库(centos6+centos7+epel源)

    搭建企业内部yum仓库(centos6+centos7+epel源) 原文:https://www.cnblogs.com/nulige/p/6081192.html https://www.linu ...

  7. Windows Server 搭建企业无线认证(Radius认证方案)

    认证协议介绍: 扩展认证协议EAP(Extensible Authentication Protocol) 是一个在无线网络或点对点连线中普遍使用的认证框架.它被定义在RFC 3748中,并且使RFC ...

  8. 使用BaGet 搭建私有nuget 服务器

    使用BaGet 搭建私有nuget 服务器 netNugetBaGet 引言 为了增强代码的安全性和企业团队开发的高效性,搭建私有的package 包管理服务器是很有必要的,搭建私有的类库管理服务有以 ...

  9. Jenkins 搭建企业实战案例 (发布与回滚)

    让我们的代码部署变得easy,不再难,Jenkins是一个可扩展的持续集成引擎,是一个开源软件项目,旨在提供一个开放易用的软件平台,使软件的持续集成变成可能.Jenkins非常易于安装和配置,简单易用 ...

随机推荐

  1. but this usually doesn’t gain you anything.

    High Performance My SQL, Third Edition Date and Time Types My SQL has many types for various kinds o ...

  2. Static Random-Access Memory Dynamic Random-Access Memory

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION RAM technology is div ...

  3. nginx php解析过慢

    nginx 报错 upstream timed out (110: Connection timed out)解决方案 error.log报错如下: 2013/05/18 21:21:36 [erro ...

  4. hibernate多SessionFactory配置

    <bean id="aDataSource" class="org.apache.commons.dbcp.BasicDataSource" destro ...

  5. fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

    给对话框添加类, 报错 CalibrateMFCDlg.h(6) : error C2504: “CDialog”: 未定义基类 等多个错误 加上 #include "afxwin.h&qu ...

  6. BeanNameViewResolver

    As described in the documentation, BeanNameViewResolver resolves Views declared as beans. Usually yo ...

  7. 【Java 基础篇】【第七课】组合

    我所理解的组合就是在一个类当中又包含了另一个类的对象. 这样的方式就是组合吧: 电池是一个类,有电量 手电筒需要电池 看代码吧: // 电池类 class Battery { // 充电 public ...

  8. fprintf与fwrite函数用法与差异

    在C语言中有两个常见的保存文件的函数:fprintf 与 fwrite.其主要用法与差异归纳如下: 一.fprintf函数. 1.以文本的形式保存文件.函数原型为 int fprintf(FILE* ...

  9. C/C++ 笔试、面试题目大汇总(二)

    一.找错题 试题1: void test1() { charstring[10]; char* str1 ="0123456789"; strcpy( string, str1 ) ...

  10. Vim-Vundle-plugins-scripts

    配置文件.vimrc set tabstop= set softtabstop= set shiftwidth= set noexpandtab set autoindent set cindent ...