rra下的rrd數(shù)據(jù)庫(大小..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

監(jiān)控 cacti zabbix(2)

發(fā)布時間:2020-06-16 11:58:51 來源:網(wǎng)絡(luò) 閱讀:791 作者:當(dāng)當(dāng)要加油 欄目:MySQL數(shù)據(jù)庫

監(jiān)控(1):(cactizabbix
前提:cacti配置完成
cacti
監(jiān)控其他主機(采集數(shù)據(jù):crontab定時調(diào)用(poller.php)snmp采集存儲數(shù)據(jù)rrdtool -->rra下的rrd數(shù)據(jù)庫(大小時固定,循環(huán)記錄數(shù)據(jù),不會增大,以后不斷做數(shù)據(jù)更新)繪制圖表:http(80) -->php -->mysql(前提:初始化數(shù)據(jù))-->web(php動態(tài)的去mysql數(shù)據(jù)庫里面去取信息但真正采集來的數(shù)據(jù)在rrd里面 mysql里面保存的是所有節(jié)點的信息除了采集來的信息其他的都保存在mysql里面))真實繪制圖像的時候,調(diào)用rrdtool命令 cacti的缺陷:沒有報警對硬件沒有監(jiān)控(eg:溫度傳感器等但可以安裝插件)

被監(jiān)控主機安裝: net-snmp net-snmp-utils

vim/etc/snmp/snmpd.conf
測試:
 snmpwalk -v 1 -c public localhost.1.3.6.1.4.1.2021.10.1.3
 snmpwalk -v 1 -c public 172.25.42.250.1.3.6.1.4.1.2021.10.1.3

監(jiān)控 cacti zabbix(2)

監(jiān)控 cacti zabbix(2)


將被監(jiān)控主機加入 cacti
監(jiān)控 cacti zabbix(2)
 

按秒監(jiān)控:crontab+sleep
eg:* * * * * sleep 10;commit
eg:* * * * * sleep 20;commit
eg:* * * * * sleep 30;commit
eg:* * * * * sleep 40;commit
eg:* * * * * sleep 50;commit

cacti加強版tarzxf cacti-spine-0.8.8h.tar.gz
cd cacti-spine-0.8.8h
yum install mysql-devel net-snmp-devel gcc -y
./configure
make && make install
cd /usr/local/spine/etc
cp spine.conf.dist /etc/spine.conf

監(jiān)控 cacti zabbix(2)
Vim /etc/spine.conf

監(jiān)控 cacti zabbix(2)

su - cacti
/usr/local/spine/bin/spine


 

監(jiān)控 cacti zabbix(2)

監(jiān)控 cacti zabbix(2)


zabbix:
兩臺虛擬機:
dd5(server)
yum installzabbix-server-2.4.5-1.el6.x86_64.rpm zabbix-server-mysql-2.4.5-1.el6.x86_64.rpmzabbix-web-2.4.5-1.el6.noarch.rpm zabbix-web-mysql-2.4.5-1.el6.noarch.rpmzabbix-2.4.5-1.el6.x86_64.rpm fping-2.4b2-16.el6.x86_64.rpmphp-bcmath-5.3.3-26.el6.x86_64.rpm iksemel-1.4-2.el6.x86_64.rpm ../php-mbstring-5.3.3-26.el6.x86_64.rpm

dd4:yum install zabbix-agent-2.4.5-1.el6.x86_64.rpm -yzabbix-2.4.5-1.el6.x86_64.rpm

dd5:(server)
配置 mysql 數(shù)據(jù)庫
mysql
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by'westos';
mysql> quit;

監(jiān)控 cacti zabbix(2)
mysql -uzabbix -pwestos zabbix < schema.sql
mysql -uzabbix -pwestos zabbix < p_w_picpaths.sql
mysql -uzabbix -pwestos zabbix < data.sql

配置 zabbix server
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName= zabbix
DBPassword=westos

監(jiān)控 cacti zabbix(2)

監(jiān)控 cacti zabbix(2)


監(jiān)控本機:
rpm -ivhzabbix-agent-2.4.5-1.el6.x86_64.rpm
vim /etc/zabbix/zabbix_agent.conf

監(jiān)控 cacti zabbix(2)
/etc/init.d/zabbix-agent start

查看:

Dd4:
rpm -ivh zabbix-agent-2.4.5-1.el6.x86_64.rpm
vim /etc/zabbix/zabbix_angent.conf

監(jiān)控 cacti zabbix(2)

監(jiān)控 cacti zabbix(2)

/etc/init.d/zabbix-serverstart
 


監(jiān)控 cacti zabbix(2)

監(jiān)控 cacti zabbix(2)

監(jiān)控 cacti zabbix(2)


兩種模式:(都可自動發(fā)現(xiàn)主機)

自動檢測: (適合批量處理)

自動加載:(可用性更高)

監(jiān)控server 上的 mysql 服務(wù)
/etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf文件中指定了 zabbix agent 如何獲取 mysql
服務(wù)的各種信息,并在/var/lib/zabbix 目錄中新建“.my.cnf”文件,用以指定 zabbix agent 如何登陸數(shù)據(jù)庫,默認(rèn)使用的是 zabbix 用戶,可以在 zabbix_server.conf 文件中找到密碼。
監(jiān)控 cacti zabbix(2)

# mkdir/var/lib/zabbix
# vim /var/lib/zabbix/.my.cnf
[mysql]
host = localhost
user = zabbix
password = westos
socket = /var/lib/mysql/mysql.sock
[mysqladmin]
host = localhost
user = zabbix
password = westos
socket = /var/lib/mysql/mysql.sock


 

 


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI