日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

zabbix 安装使用

發(fā)布時間:2025/5/22 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 zabbix 安装使用 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
zabbix是一個基于WEB界面的提供分布式系統(tǒng)監(jiān)視以及網(wǎng)絡監(jiān)視功能的企業(yè)級的開源解決方案。 zabbix能監(jiān)視各種網(wǎng)絡參數(shù),保證服務器系統(tǒng)的安全運營;并提供靈活的通知機制以讓系統(tǒng)管理員快速定位/解決存在的各種問題。 zabbix由2部分構成,zabbix server與可選組件zabbix agent。 zabbix server可以通過SNMP,zabbix agent,ping,端口監(jiān)視等方法提供對遠程服務器/網(wǎng)絡狀態(tài)的監(jiān)視,數(shù)據(jù)收集等功能,它可以運行在Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X等平臺上。

server1:(centos7以上)ip=172.25.8.11

server1中:

yum install -y php-bcmath-5.4.16-42.el7.x86_64.rpm php-mbstring-5.4.16-42.el7.x86_64.rpm zabbix-agent-3.4.6-1.el7.x86_64.rpm zabbix-server-mysql-3.4.6-1.el7.x86_64.rpm zabbix-web-3.4.6-1.el7.noarch.rpm zabbix-web-mysql-3.4.6-1.el7.noarch.rpm fping-3.10-1.el7.x86_64.rpm iksemel-1.4-2.el7.centos.x86_64.rpm

yum install -y mariadb mariadb-server

systemctl start mariadb

mysql

create database zabbix character set utf8 collate utf8_bin;??? ##創(chuàng)建zabbix庫

grant all privileges on zabbix.* to zabbix@localhost identified by 'westos';? ##授權

cd /usr/share/doc/zabbix-server-mysql-3.4.6/

ll create.sql.gz

zcat create.sql.gz | mysql -uzabbix -pwestos Zabbix??? ##導入庫

mysql

use zabbix

show tables;

?

cd /etc/zabbix/

?

vim zabbix_server.conf

DBPassword=westos

?

cd /etc/httpd/conf.d/

?

ll zabbix.conf

vim zabbix.conf

?

?

systemctl start zabbix-server

vim /etc/php.ini

date.timezone = Asia/Shanghai

systemctl start httpd

?

?

物理機firefox訪問172.25.4.11/zabbix

登陸

ZABBIX

Username Admin

Password zabbix

點擊右上角小人頭更改為中文

systemctl start zabbix-agent

主機中 zabbix server 啟用主機

?

server2:

[root@test2 ~]# rpm -ivh zabbix-agent-3.4.6-1.el7.x86_64.rpm

[root@test2 ~]# vim /etc/zabbix/zabbix_agentd.conf (需要本地解析)

?

Server=182.25.8.11

ServerActive=172.25.8.11

HostName=test2?

主機的幾種添加方式:

[root@test2 ~]# systemctl start zabbix-agent.service

[root@test2 ~]# netstat -antlp

?

172.25.4.11/Zabbix

手動添加

添加主機

點擊配置—>主機—>創(chuàng)建主機

?

?

添加模版

自動發(fā)現(xiàn):

配置–>自動發(fā)現(xiàn)–>創(chuàng)建發(fā)現(xiàn)規(guī)則

?

?

?

?

自動注冊

?

?

?

?

Api;

通過api查看,刪除,添加監(jiān)控

cd ?? vim zabbix.api
curl -s -X POST -H 'Content-Type: application/json' -d ' { "jsonrpc": "2.0", "method": "user.login", "params": {
??????? "user":"Admin",
??????? "password": "zabbix" }, "id": 1,
??? "auth": null }' http://172.25.8.1/zabbix/api_jsonrpc.php | python -m json.tool
chmod +x zabbix.api [root@server1 mnt]# ./zabbix.api
{
??? "id": 1,
??? "jsonrpc": "2.0",
??? "result": "1309609a9fa442ac3ac560b45da35b01"
} 將獲得的resault寫入api

[root@test1 ~]# vim zabbicG.api ? ? ##獲取主機信息

[root@test1 ~]# ./zabbicG.api ? ? ? ? ?

curl -s -X POST -H 'Content-Type: application/json' -d '

{

??? "jsonrpc": "2.0",

??? "method": "host.get",

??? "params": {

??????? "output": ["host"]

??? },

??? "id": 1,

??? "auth": "1309609a9fa442ac3ac560b45da35b01"

}' http://172.25.8.11/zabbix/api_jsonrpc.php | python -m json.tool

?

?

?

[root@test1 ~]# vim zabbixD.zpi ???##刪除監(jiān)控

url -s -X POST -H 'Content-Type: application/json' -d '

{

??? "jsonrpc": "2.0",

??? "method": "host.delete",

??? "params": [

????? 10257

??? ],

??? "id": 1,

??? "auth": "1309609a9fa442ac3ac560b45da35b01"

}' http://172.25.8.11/zabbix/api_jsonrpc.php | python -m json.tool

?

?

?

[root@test1 ~]# vim zabbix.zpi ???##創(chuàng)建監(jiān)控

curl -s -X POST -H 'Content-Type: application/json' -d '

{

??????? "jsonrpc": "2.0",

??? "method": "host.create",

??? "params": {

??????? "host": "test2",

??????? "interfaces": [

??????????? {

??????????????? "type": 1,

??????????????? "main": 1,

??????????????? "useip": 1,

??????????????? "ip": "172.25.8.12",

??????????????? "dns": "",

??????????????? "port": "10050"

??????????? }

??????? ],

??????? "groups": [

??????????? {

??????????????? "groupid": "2"

??????????? }

??????? ],

??????? "templates": [

??????????? {

??????????????? "templateid": "10001"

??????????? }

??????? ]

??? },

?? ?"id": 1,

??? "auth": "1309609a9fa442ac3ac560b45da35b01"

}' http://172.25.8.11/zabbix/api_jsonrpc.php | python -m json.tool

?

轉載于:https://www.cnblogs.com/zhengyipengyou/p/9826673.html

總結

以上是生活随笔為你收集整理的zabbix 安装使用的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。