【移动应用开发技术】监控cactinagioszabbix (一)cacti_第1页
【移动应用开发技术】监控cactinagioszabbix (一)cacti_第2页
【移动应用开发技术】监控cactinagioszabbix (一)cacti_第3页
【移动应用开发技术】监控cactinagioszabbix (一)cacti_第4页
【移动应用开发技术】监控cactinagioszabbix (一)cacti_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

【移动应用开发技术】监控cactinagioszabbix(一)cacti

cacti重图形,有数据历史,需用到数据库支持,支持web配置,默认不支持告警,可以加插件;nagios重状态和结果,没有数据历史,不成图像,不支持web配置,可以自己开发脚本定制个性化监控,支持多种插件;zabbix有数据历史,可成图像,支持web配置,可以自动发现;第一部分:监控软件Cacti搭建一、环境准备

1、安装epel扩展源

关闭selinux

临时关闭setenforce0

vim/etc/selinux/config

SELINUX=disbabled1[root@cacti

~]#

yum

install

-y

epel-release

2、搭建lamp环境12345678910111213141516171819202122232425262728293031323334353637[root@cacti

~]#

yum

install

-y

httpd

php

php-mysql

mysql

mysql-server

mysql-devel

php-gd

libjpeg

libjpeg-devel

libpng-devel[root@cacti

~]#

/etc/init.d/httpd

start正在启动

httpd:

[确定][root@cacti

~]#

/etc/init.d/mysqld

start初始化

MySQL

数据库:

Installing

MySQL

system

tables...OKFilling

help

tables...OK

To

start

mysqld

at

boot

time

you

have

to

copysupport-files/mysql.server

to

the

right

place

for

your

system

PLEASE

REMEMBER

TO

SET

A

PASSWORD

FOR

THE

MySQL

root

USER

!To

do

so,

start

the

server,

then

issue

the

following

commands:

/usr/bin/mysqladmin

-u

root

password

'new-password'/usr/bin/mysqladmin

-u

root

-h

cacti

password

'new-password'

Alternatively

you

can

run:/usr/bin/mysql_secure_installation

which

will

also

give

you

the

option

of

removing

the

testdatabases

and

anonymous

user

created

by

default.

This

isstrongly

recommended

for

production

servers.

See

the

manual

for

more

instructions.

You

can

start

the

MySQL

daemon

with:cd

/usr

;

/usr/bin/mysqld_safe

&

You

can

test

the

MySQL

daemon

with

mysql-test-run.plcd

/usr/mysql-test

;

perl

mysql-test-run.pl

Please

report

any

problems

with

the

/usr/bin/mysqlbug

script!

[确定]正在启动

mysqld:

[确定]

3、安装cacti监控主机1234567891011121314151617181920212223242526272829303132333435363738[root@cacti

~]#

yum

install

-y

cacti

net-snmp

net-snmp-utils

rrdtool

net-snmp-devel

net-snmp-libs

lm-sensors

php-xml

zlib

libpng

freetype

cairo-devel

pango-devel

gd

[root@cacti

~]#

/etc/init.d/snmpd

start正在启动

snmpd:

[确定][root@cacti

~]#

mysql

-u

rootWelcome

to

the

MySQL

monitor.

Commands

end

with

;

or

\g.Your

MySQL

connection

id

is

4Server

version:

5.1.73

Source

distribution

Copyright

(c)

2000,

2013,

Oracle

and/or

its

affiliates.

All

rights

reserved.

Oracle

is

a

registered

trademark

of

Oracle

Corporation

and/or

itsaffiliates.

Other

names

may

be

trademarks

of

their

respectiveowners.

Type

'help;'

or

'\h'

for

help.

Type

'\c'

to

clear

the

current

input

statement.mysql>

create

database

cacti;

mysql>

grant

all

on

cacti.*

to

'cactiuser'@'localhost'

identified

by

'cactiuser';Query

OK,

0

rows

affected

(0.00

sec)

mysql>

exitBye[root@cacti

~]#

mysql

-u

root

cacti

<

/usr/share/doc/cacti-0.8.8b/cacti.sql[root@cacti

~]#

vim

/usr/share/cacti/include/config.php$database_type

=

"mysql";$database_default

=

"cacti";$database_hostname

=

"localhost";$database_username

=

"cactiuser";$database_password

=

"cactiuser";$database_port

=

"3306";$database_ssl

=

false;

[root@cacti

~]#

vim

/etc/httpd/conf.d/cacti.confDeny

from

all

修改为

Allow

from

all[root@cacti

~]#

/etc/init.d/httpd

restart停止

httpd:

[确定]正在启动

httpd:

[确定]4、通过浏览器访问

如果访问不了,请检查主机的iptables和selinuxhttp://IP/cacti/

点两下“next”和一次”Finish“即可输入admin

admin登录,重新设置新的密码5查看默认主机执行poller.php,生成图形,加入计划任务/usr/bin/php/usr/share/cacti/poller.php添加cron任务cront-e

增加:*/5****

/usr/bin/php/usr/share/cacti/poller.php6添加需要被监控的主机接下来我们添加被监控的主机在被监控的主机上安装修改syslocation以及syscontact,其中syslocation可以写本机ip,syscontact写管理员邮箱view

systemview

included

..2.1.1修改为:view

systemview

included

..2.1(如果不改,可能找不到网卡)7启动snmp

/etc/init.d/snmpdstart8管理cacti后台点console,再点Device,在右上角点”Add“

Description

写本机ip或你自定义一个名字Hostname

写本机ipHostTemplate

选ucd/net

SNMPHostSNMPVersion

选Version2点右下角的create点右上角的”CreateGraphsforthisHost“GraphTypes:

选择SNMP-InterfaceStatisticsGraphTypes:

再选择GraphTemplateBased在下面的框中,选择你要监控的项目,比如ucd/net-LoadAverage在右侧小方块中打对勾,然后点右下角的create9添加实时监控后台选中”DefaultTree“点右上角的AddTreeItemType选择”Host“Host选择我们刚刚增加的那个机器ip点右下角的create10点左上角的Graphs在左侧可以看到DefautTree下面已经增加了我们刚刚添加的主机,图形一开始不会那么快出来,要等一小会才可以。参考文章:/admin/html/201310/1956.html

Cacti安装高效轮询器spine(转)Cacti默认轮询器cmd.php执行效率有点低,spine为C语言编写的组件,性能要好许多。编译安装spine需以下软件支持:1net-snmp-devel2mysql3mysql-devel4openssl-devel5gcc安装spine要和Cacti的版本相匹配,本文以最新版cacti0.8.8a安装为例。1cd/usr/local/src/2wget

/downloads/spine/cacti-spine-0.8.8a.tar.gz3tar-zxvfcacti-spine-0.8.8a.tar.gz4cdcacti-spine-0.8.8a

编译:5./configure6make&&makeinstatll配置spine:1cd/usr/local/spine/etc/2mvspine.conf.dist

/etc/spine.conf3vispine.conf填写数据库信息,即Cacti数据库。DB_Host

localhostDB_Database

cactiDB_User

rootDB_Pass

cactiDB_Port

3306设置spine路径,Console——Settings——Pathscacti设置spine路径/usr/local/spine/bin/spine更改cacti轮询器为spine,Console——Settings——Pollercacti更改轮询器为s

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论