日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

zabbix的安装监控windows,linux操作流程

發布時間:2024/4/14 linux 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 zabbix的安装监控windows,linux操作流程 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

CentOS默認源里沒有nginx軟件 :wget http://www.atomicorp.com/installers/atomic

sh ./atomic #安裝YUM源

yum check-update #更新yum軟件包

一、安裝nginx

yum install nginx

service nginx start

chkconfig nginx on

二、安裝mysql

yum install mysql mysql-server mysql-devel

service mysqld start

chkconfig mysqld on

三、安裝php

#安裝PHP及組件,使PHP支持 MySQL、PHP支持FastCGI模式

yum install php php-mysql php-gd libjpeg* php-pear php-xml php-mbstring

php-mcrypt php-mhash libmcrypt libmcrypt-devel php-imap php-ldap php-odbc php-bcmath php-xmlrpc php-fpm

service mysqld restart

service nginx restart

service php-fpm start

四、配置nginx支持php

vi /etc/nginx/nginx.conf ?#修改運行用戶

user nginx;

vi /etc/nginx/conf.d/default.conf #開啟php支持

index index.php index.html index.htm;

location ~ \.php$ {

root html; #取消FastCGI server部分location的注釋

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/ $fastcgi_script_name; #$document_root設置為網站根目錄

include fastcgi_params;

}

改成這樣:

location ~ \.php$ {

? ? ? ? root ? ? ? ? ? /usr/share/nginx/html;

? ? ? ? fastcgi_pass ? 127.0.0.1:9000;

? ? ? ? fastcgi_index ?index.php;

? ? ? ? fastcgi_param ?SCRIPT_FILENAME ?/$document_root$fastcgi_script_name;

? ? ? ? include ? ? ? ?fastcgi_params;

? ? }

并找到 index index.php index.html index.htm; 添加index.php

1、配置php

date.timezone = Asia/Shanghai #設置時區

expose_php = OFF #禁止顯示版本信息

2、配置php-fpm

vi /etc/php-fpm.d/www.conf

user = nginx

group = nginx

3、測試

chown -R nginx.nginx /usr/share/nginx/html/ #設置目錄所有者

chmod 774 -R /usr/share/nginx/html/ #設置目錄權限

service mysqld restart

service nginx restart

service php-fpm restart

cd /usr/share/nginx/html/

vi index.php

<?Php phpinfo();?>

http://127.0.0.1 #可以看到相關的配置信息!

編輯安裝zabbix

1、修改php.ini,以達到zabbixserver的要求

# vim ?/etc/php.ini

date.timezone = Asia/Shanghai

max_input_time = 300

post_max_size = 32M

max_execution_time = 300

memory_limit = 128M

mbstring.func_overload = 2

2、創建zabbix用戶

3、創建zabbix庫,并且給庫創建用戶設置密碼。

set password =password('你的密碼');

grant all on zabbix.* to zabbix@localhost identified by 'zabbix';

flush privileges;

4、編譯zabbix(確定安裝mysql mysql-devel mysql-server) (需要安裝依賴庫yum -y install net-snmp-devel curl-devel)

./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl

5、在/etc/services中添加

zabbix-agent ? ?10050/tcp ? ? ? ? ? ? ? # Zabbix Agent

zabbix-agent ? ?10050/udp ? ? ? ? ? ? ? # Zabbix Agent

zabbix-server ? 10051/tcp ? ? ? ? ? ? ? # zabbix Trapper

zabbix-server ? 10051/udp ? ? ? ? ? ? ? # zabbix Trapper

6、導入數據庫并授權

ls database/mysql/

data.sql ?p_w_picpaths.sql ?schema.sql

mysql -uzabbix -pzabbix zabbix < schema.sql

mysql -uzabbix -pzabbix zabbix < p_w_picpaths.sql

mysql -uzabbix -pzabbix zabbix < data.sql

7、創建相關的目錄和連接

# mkdir /var/log/zabbix

# chown zabbix.zabbix /var/log/zabbix

# ln -s /usr/local/zabbix/etc/ /etc/zabbix

# ln -s /usr/local/zabbix/bin/* /usr/bin/

# ln -s /usr/local/zabbix/sbin/* /usr/sbin/

8、把zabbix server加入到系統服務

# cp zabbix-2.4.2/misc/init.d/fedora/core/zabbix_* /etc/init.d

# vim /etc/init.d/zabbix_server

BASEDIR=/usr/local/zabbix

# vim /etc/init.d/zabbix_agentd

BASEDIR=/usr/local/zabbix

9、修改配置文件

# vim /etc/zabbix/etc/zabbix_server.conf

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

LogFile=/var/log/zabbix/zabbix_server.log ----自己搜索后再確定


10、設置zabbix監控自己

# vim /etc/zabbix/etc/zabbix_agentd.conf

LogFile=/var/log/zabbix/zabbix_agentd.log

Server=127.0.0.1,x.x.x.x ? ?被動模式?

ServerActive=x.x.x.x:10051 ? 主動模式

Hostname=主機名

UnsafeUserParameters=1

11、拷貝網頁文件到nginx網站目錄

# cp -r zabbix-2.4.2/frontends/php/ /www

# chown -R nginx.nginx /www

12、啟動zabbix_server和zabbix_agentd并設置開機自啟動

# service zabbix_server start

# chkconfig zabbix_server on

# service zabbix_agentd start

# chkconfig zabbix_agentd on

另外一種啟動方式:

/usr/local/zabbix/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agent.conf /usr/local/zabbix/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf

監控windows主機

直接解壓放置到C:\磁盤目錄中

安裝啟動:

zabbix_agent.exe的路徑 -c ?zabbix_agentd.win.conf -i 安裝

zabbix_agent.exe的路徑 -c ?zabbix_agentd.win.conf -s 啟動 -d 卸載


監控linux服務器:

????關閉selinux

groupadd zabbix -g 201

????useradd -g zabbix -u 201 -m zabbix

????./configure --prefix=/usr/local/zabbix --sysconfdir=/etc/zabbix --enable-agent

修改/etc/zabbix/zabbix_agentd.conf文件

zabbix_agent.conf是用超級服務(xinetd)的方式來啟動的,

zabbix_agentd.conf是以獨立進程的方式來啟動的.

注釋:

server是被動模式,不要127也行,

serverActive是主動模式

啟動:

/usr/local/zabbix/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agent.conf

添加:

????在server端可以用命令:/usr/local/zabbix/bin/zabbix_get -s 192.168.5.138 -p 10050 -k system.uname進行測試zabbix是否能獲取服務端上的數據。

如果打開了防火墻防火墻需要打開的端口:

????agent 客戶端打開:10050?

????server 打開:10050 10051 3306 80 9000

轉載于:https://blog.51cto.com/9267277/1702470

總結

以上是生活随笔為你收集整理的zabbix的安装监控windows,linux操作流程的全部內容,希望文章能夠幫你解決所遇到的問題。

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