请选择 进入手机版 | 继续访问电脑版
查看: 791|回复: 6

Zabbix监控之Centos基于LNMP环境安装

34

主题

34

帖子

138

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
138
羊大仙 发表于 2015-12-10 20:22:05 | 显示全部楼层 |阅读模式

 

本文描述zabbixlnmp环境中的搭建过程,为减少配置难度,mysql,php采用yum安装。系统版本是centos6.4。

本安装过程以直接高效的方式叙述。


1Yum安装mysql

mysql使用yum安装方式

yum install mysql-servermysql-devel mysql

/etc/init.d/mysqld start

 

2Yum安装php

yum安装后的php配置文件是/etc/php.ini

yum install -y php php-mysqlphp-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpcphp-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel php-fpm

 

sed -i 's/^user =.*/user =nginx/g' /etc/php-fpm.d/www.conf

sed -i 's/^group =.*/group =nginx/g' /etc/php-fpm.d/www.conf

/etc/init.d/php-fpm start

 

3、编译安装nginx

3.1 安装pcre

nginx安装需要pcre的支持。

wget  ftp://ftp.csx.cam.ac.uk/pub/soft ... re/pcre-8.33.tar.gz

yum install gcc*   #解决编译无gcc包问题

tar -zxf pcre-8.33.tar.gz

cd pcre-8.33

./configure

echo $?

make && make install

3.2 安装nginx

wget  http://nginx.org/download/nginx-1.4.7.tar.gz

useradd nginx -s /sbin/nologin-M

./configure --user=nginx--group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module--with-http_ssl_module

echo $?

make && make install

 

3.3 测试nginx

[root@qssec-centos-01nginx-1.4.7]# /usr/local/nginx/sbin/nginx -t

/usr/local/nginx/sbin/nginx:error while loading shared libraries: libpcre.so.1: cannot open shared objectfile: No such file or directory

 

echo /usr/local/lib>>/etc/ld.so.conf

ldconfig

 

[root@qssec-centos-01nginx-1.4.7]# /usr/local/nginx/sbin/nginx -t      

nginx: the configuration file/usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file/usr/local/nginx/conf/nginx.conf test is successful

#此时可以在浏览器输入nginx的IP地址。


4、配置nginx关联php

4.1 修改nginx配置文件

nginx.conf中加入如下红色内容

vi/usr/local/nginx/conf/nginx.conf

    server {

        listen       80;

        server_name  localhost;

        location / {

            root   html;

            index  index.html index.htm index.php;

        }

        location ~ \.php$ {

            root           html;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

            include        fastcgi_params;

            include        fastcgi.conf;

        }

}

#红色这段作用是把php结尾的url交给php进程处理。

 

4.2 添加phpinfo

创建phpinfo文件

cat >/usr/local/nginx/html/index.php <<EOF

<?php

phpinfo();

?>

EOF


4.3 测试Php解析

在浏览器输入测试urlhttp://IP/index.php,出现如下界面则解析成功。


5、安装zabbix server

5.1 安装zabbix server

yum -y install libcurl-develnet-snmp-devel  #视实际情况系统环境,如果后面欠缺某些库,可以再次yum

useradd zabbix -s/sbin/nologin

 

cd /usr/local/src

wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz/download

tar zxf zabbix-2.2.2.tar.gz

cd zabbix-2.2.2

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

make && make install

 

5.2 创建数据库,添加授权账号

 

create database zabbix characterset utf8;

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

delete from mysql.user whereuser="";  #删除空用户名

flush privileges;

 

5.3 导入数据库

cd /usr/local/src/zabbix-2.2.2

mysql -uzabbix -pzabbix-h127.0.0.1 zabbix < database/mysql/schema.sql

mysql -uzabbix -pzabbix-h127.0.0.1 zabbix < database/mysql/images.sql

mysql -uzabbix -pzabbix-h127.0.0.1 zabbix < database/mysql/data.sql


5.4 拷贝zabbix启动文件

cpmisc/init.d/fedora/core/zabbix_server /etc/init.d/

cpmisc/init.d/fedora/core/zabbix_agentd /etc/init.d/

 

5.5 修改配置文件及启动文件

sed -i 's/^DBUser=.*$/DBUser=zabbix/g'/usr/local/zabbix/etc/zabbix_server.conf

sed -i's/^.*DBPassword=.*$/DBPassword=zabbix/g'/usr/local/zabbix/etc/zabbix_server.conf

sed -i 's/^.*DBHost=.*$/DBHost=127.0.0.1/g'/usr/local/zabbix/etc/zabbix_server.conf

 

sed -i's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g'/etc/init.d/zabbix_server

sed -i's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g'/etc/init.d/zabbix_agentd


5.6 添加zabbix服务端口

cat >>/etc/services<<EOF

zabbix-agent 10050/tcp ZabbixAgent

zabbix-agent 10050/udp ZabbixAgent

zabbix-trapper 10051/tcpZabbix Trapper

zabbix-trapper 10051/udpZabbix Trapper

EOF


5.7 启动zabbix服务

/etc/init.d/zabbix_serverstart

/etc/init.d/zabbix_agentdstart

echo "/etc/init.d/zabbix_serverstart" >> /etc/rc.local

echo "/etc/init.d/zabbix_agentdstart" >> /etc/rc.local

 

netstat -plnt|grep zabbix

tcp        0     0 0.0.0.0:10050              0.0.0.0:*                   LISTEN      834/zabbix_agentd  

tcp        0     0 0.0.0.0:10051              0.0.0.0:*                   LISTEN      769/zabbix_server  


5.8 复制web端到nginx的工作目录

cd /usr/local/src/zabbix-2.2.2

cp -ra frontends/php//usr/local/nginx/html/zabbix

chown -R nginx.nginx  /usr/local/nginx/html/zabbix


5.9 在浏览器输入http://IP/zabbix/index.php

wKiom1PyHriSeGhTAAH0w2CGeH4096.jpg

 

5.10 修改php配置满足zabbix安装要求

sed -i 's/^\(.*\)date.timezone=.*$/date.timezone = Asia\/Shanghai/g' /etc/php.ini
sed -i 's/^\(.*\)post_max_size =.*$/post_max_size = 16M/g' /etc/php.ini
sed -i 's/^\(.*\)max_execution_time =.*$/max_execution_time = 300/g' /etc/php.ini
sed -i 's/^\(.*\)max_input_time =.*$/max_input_time = 300/g' /etc/php.ini
/etc/init.d/php-fpm restart


wKiom1PyHrbQmba2AAJQANd5LL4008.jpg

 

5.11 zabbix连接数据库

  输入上述配置的用户名密码:

  数据库名称为:zabbix

  数据库用户名:zabbix

  数据库密码:zabbix

wKiom1PyHrzBkgDFAAIu8qz0oaU461.jpg

  

5.12 登陆zabbix

    默认用户名:admin

    默认密码:zabbix

RPKPWM@A.jpg " style="float:none;" alt="wKioL1PyH9LzchKJAAF_tgbbOKI739.jpg" />

 

6、调整zabbix显示中文

点击右上角profile处出现该界面。

wKioL1PyH9aDnGw4AAGst6LFdB4478.jpg


7centos安装Zabbix client

useradd zabbix -s/sbin/nologin -M

 

tar -zxf zabbix-2.2.2.tar.gz

cd zabbix-2.2.2

./configure--prefix=/usr/local/zabbix --enable-agent

make install

 

cpmisc/init.d/fedora/core/zabbix_agentd /etc/init.d/

#修改/usr/local/zabbix/etc/zabbix_agentd.conf中的server ip

#修改/etc/init.d/server_agentd中的BASEDIR

 

[root@qssec-centos-02zabbix-2.2.2]# netstat -plnt|grep zabbix

tcp        0     0 0.0.0.0:10050              0.0.0.0:*                   LISTEN      17870/zabbix_agentd

 

8ubuntu安装Zabbix client

apt-get install zabbix-agent

vi /etc/zabbix/zabbix_agentd.conf   #修改server IP

 

如果apt-get安装不成功,可删除apt安装的zabbix-agent包:dpkg -r zabbix-agent;dpkg -P zabbix-agent,然后再apt-get安装。

 

9debian安装zabbix client

tar -zxf zabbix-2.2.2.tar.gz

cd zabbix-2.2.2/

 ls

 ./configure --prefix=/usr/local/zabbix--enable-agent

 make install

 

cpmisc/init.d/debian/zabbix-agent /etc/init.d

 

vi/usr/local/zabbix/etc/zabbix_agentd.conf  #修改server ip

vi /etc/init.d/zabbix-agent    #指定zabbix_agentd路径

 

 

 

到此zabbix server端与client端都安装完成。




本文出自 “楊雲” 博客,请务必保留此出处http://yangrong.blog.51cto.com/6945369/1541810

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

2412

主题

2667

帖子

7788

积分

论坛元老

Rank: 8Rank: 8

积分
7788
Michaappar 发表于 2017-5-26 05:23:10 | 显示全部楼层
Consommation Viagra France  Lasix Cost Medicamentos Cialis Viagra Buy Prevacid Online Cheap  Cheap Cytotec Tablets Cheaper Rx4u Acheter Cialis Pro  Order Zoloft Without Script Acheter Cialis 10 Milligrams Discount Worldwide Fedex Shipping Isotretinoin Pills  Purchase Generic Zoloft Kamagra Oral Jelly Hamburg Get Tab Worldwide Dutasteride In Internet Fedex Shop  Viagra Sample Buy Avanafil Endometrin Without Prescription  Buy Priligy Viagra Online Over The Counter Mediformin Levitra Durata Di Azione  Buy Kamagra Fish Flex Cephalexin Keflex 500mg Capsules  Order Generic Strattera Cialis 10 Mg Prezzo In Farmacia Xenical 120 Mg  Zoloft Order Caracteristicas De Propecia Acheter Vrai Cytotec  Cytotec Cost Cialis E Altri Levitra Significato  Canadian Cheap Cialis Cialis Mail Order Buy Wellbutrin Without A Perscrition  Propecia Sale Generic Tamoxifen 20mg Keflex 500mg 3 Times A Day  Nolvadex Cost Prix Propecia Suisse Zithromax Stomach Pain  Order Xenical Tablets Viagra Per Ragazzi Buy Viagra Professional Online  Propecia Price Best Sites For Viagra Gonorrhea Meds At Walmart  Order Amoxil Onlines Forum Cialis Achat Internet Cialis Viagra Effets Secondaires  Vibramycin Pills Propecia Low Cost Tigerfil 100 Mg  Best Levitra Prices Cialis Corazon Amoxicillin 875 Mg For Ear Infections  Purchase Cytotec Usa Kamagra Bericht
回复 支持 反对

使用道具 举报

70

主题

82

帖子

306

积分

中级会员

Rank: 3Rank: 3

积分
306
HaroImpera 发表于 2017-9-22 00:33:58 | 显示全部楼层
Order Generic Propecia 1mg  cialis buy online Vardenafil Cheap 5 Mg Price  
Cialis 20mg Tadalafil Achat  
Viagra Prezzo Basso  <a href=http://cialtobuy.com >viagra cialis</a> Photo Of Amoxicillin
回复 支持 反对

使用道具 举报

0

主题

276

帖子

556

积分

高级会员

Rank: 4

积分
556
chenyingying 发表于 2017-11-3 13:55:02 | 显示全部楼层
north face jackets
burberry scarves
mbt outlet
ugg outlet
moncler outlet
giuseppe zanotti sneakers
christian louboutin uk
cheap jordan shoes
soccer jerseys
michael kors uk
cheap jordan shoes
ugg schweiz
carrera sunglasses
nike uk
ugg boots
uggs classic boots
coach factory online
moncler dunjacka
coach outlet
north face jackets
tory burch outlet
kate spade outlet
d&g sunglasses
coach wallets
christian louboutin outlet
cheap nhl jerseys
hermes birkin bag
ugg boots
ugg outlet
cheap nfl jerseys
ugg outlet store
coach outlet
nike running uk
ugg boots
coach bags
ray ban sunglasses outlet
ralph lauren polo shirts
michael kors outlet
canada goose outlet
doudoune canada goose
coach factory outlet
cheap jordans
fitflops shoes
hermes belt outlet
kate spade outlet online
chicago blackhawks jersey
cheap ray ban sunglasses
manolo blahnik outlet
uggs outlet
true religion jeans
oakley sunglasses cheap
tory burch outlet
coach outlet online 70% off
michael kors
cheap oakley sunglasses
adidas outlet clearance
polo ralph lauren
montblanc pen
ray ban sunglasses
cheap nfl jerseys
fitflops sale clearance
coach factory outlet online
longchamp handbags
oakley sunglasses outlet
burberry scarf
cheap ray ban sunglasses
canada goose outlet
ugg outlet
michael kors outlet clearance
coach outlet online
ralph lauren outlet
canada goose nederland
nike jordans
coach outlet 70% off
nike air max
uggs uk
ugg factory outlet
nike nfl jerseys
longchamp bags
adidas wings
ugg outlet
north face outlet
air jordan pas cher
coach outlet online
ugg sale
louis vuitton
pandora charms
air max thea
air max 90
canada goose jackets
coach outlet
michael kors outlet clearance
nike store
converse shoes
longchamp outlet store
cheap ugg boots
north face clearance
ugg outlet online
ugg boots
oakley vault
chenyingying20171103
回复 支持 反对

使用道具 举报

70

主题

82

帖子

306

积分

中级会员

Rank: 3Rank: 3

积分
306
HaroImpera 发表于 2017-11-22 16:58:02 | 显示全部楼层
Propecia Depression Sperm Buy Cod Zentel Nadoxin Internet Achat Cialis Generique 10mg  viagra Boutique Levitra Generique My Canadian Orders  
回复 支持 反对

使用道具 举报

0

主题

1

帖子

4

积分

新手上路

Rank: 1

积分
4
IrmakCop 发表于 2017-11-24 00:44:23 | 显示全部楼层
Since the communication of proteins is single-minded, the transcriptional parallel can be examined in degree to unearth the underlying organization because reduction or increase of assured gene products. A varsity high-school wrestler presents with a "rug burn" paradigm of rash on his cold-shoulder that is not healing as expected, despite use of triple antibiotic cream.  Thither are galore welfare farms in the UK and Hibernia  5 mg proscar otc prostate cancer histology.
In into the bargain to varying the integer of entries in the transaction log, I also mea- sured the needed set looking for these queries on both a partitioned and a non-partitioned business log table. A modern scrutiny in the mouse reported that a myelosuppressive dispense of cyclophosphamide induces comeback myelopoiesis and leads to the rise of tumor-infiltrating DCs that cloak more IL-12 and less IL-10 and are fully clever of priming T-cell responses [91].  Pare Irritation  purchase avana 200 mg erectile dysfunction protocol pdf download free. If an internal examination is needed, refer the child or juvenile to the steal advanced practitioner or physician. Observe as the health mindfulness expert who is intubating the sprog follows the recommended wont because intubation using the laryngoscope to visualize the vocal cords.  Alright, ok  purchase tadapox 80mg online valsartan causes erectile dysfunction. Mitra M, Misra R, Harilal A, Sahoo SK, Krishnakumar S (2011) Enhanced in vitro anti- proliferative effects of EpCAM antibody- functionalized paclitaxel-loaded PLGA nanopar- ticles in retinoblastoma cells. Children with special salubriousness regard needs desire to be treated as usual, and they lack to practice the exact same events that other children do.  Inhibition of monocyte chemotactic protein-1 reasoning by statins  purchase 40 mg prednisone with amex allergy symptoms early pregnancy.
Plebeian types of genetic disorders that obey the autosomal reigning system of inheritance include neurofibromatosis, Huntington disease, achondroplasia, and polycystic kidney disease. GFAP appearance in lumbar spinal twine of naive and neuropathic rats treated with MK-801.  Children Container be Corpulent likewise  generic 100 mg kamagra effervescent mastercard erectile dysfunction medication and heart disease. Preventing of complications associated with immobility is a medial touch on and involves maintaining incrustation incorruptibility, preventing respiratory complications and contractures, maintaining fitting nutrition, and managing pain. In parasitic protists, mitochondria brandish all the way variations in terms of develop- ment (de Souza et al.  Metersky ML, Ma A, Houck PM, Bratzler DW Antibiotic for bacteremic pneumonia: reinforced outcome with macrolide but not fluoroquinolones  discount 20mg cialis jelly with mastercard erectile dysfunction pills at gnc. An survey of statistical methods including procedures concerning statistically accounting on missing outcomes and strategies to be employed if statistical assumptions are not satisfied (e. These models depart from other models of keen infection using the same and other viruses in the significance of the passionate response to an intense infection.  Pull what you spend  cheap 100 mg kamagra oral jelly with amex erectile dysfunction radiation treatment.
A enduring admonition of protuberance latency byzantine thousands of women who received the artificial oestrogen diethylstilbestrol as a putative pharmaceutical in the course of miscarriages and other pregnancy complications during the 1950s and 1960s. If this is not realizable, break of at least 3 feet between other children and visitors should be maintained.  From 1998 to 2003, the frequency of incursive disease among the senior has decreased by 18% (McBean et al 2006)  cheap 50mg clomiphene visa fsh 87 menopause. By 5 years of lifetime, the sprog can defer an electronic vocal thermometer in the kisser definitely sufficiency to secure a reading. Nose and Sinuses The nose, as with all facial features in a child, should be symmetric, but it can be displaced briefly nigh blood trauma in newborns.  # 7 - Damage when hungry, and sole when hungry; if it is been leastwise 3  160 mg super avana overnight delivery erectile dysfunction drugs on nhs. As the infant is exposed to various germs or illnesses, the lymph pattern passively filters plasma on account of bacteria or other foreign material before returning it to the bloodstream and go to the heart. The vital component of the analysis of these researchers is that of various disturbances in ipseity (the constant discernment of being there' accompanying all aware common sense) that can arise for a sufferer, giving a framework with which to know the disease.  No, I'm not jesting at every  discount modafinil 100mg with visa insomnia in older adults.
Surrogate end- points are not a steer match of how a philosophical feels, functions, or survives, but are considered liable to foresee a long-term thera- peutic forward for the stoical [10, 11]. Nursing handling is aimed at providing supportive tribulation and encouraging adherence to the treatment regimen.  Specified situations however, are seen on selfsame thin occasions  discount 20 mg erectafil free shipping erectile dysfunction case study. The least restrictive medium is preferred, with precise needs children participating in classes containing age-appropriate ordinary The using software is plague version. The cue flow, that being so, is optimal selection of those who are qualified to improve after surgery and to refrain from surgery in patients who are unthinkable to benefit.  Well-nigh two-thirds of those with arthritis are jr than 65  discount 20 mg apcalis sx with amex impotence merriam webster.
回复 支持 反对

使用道具 举报

0

主题

18

帖子

38

积分

新手上路

Rank: 1

积分
38
zzzzz 发表于 2017-11-27 09:25:52 | 显示全部楼层
fitflops sale
mont blanc pens
basketball shoes
coach outlet online
armani exchange
chicago bulls jersey
houston texans jerseys
gucci shoes
nike shoes
jimmy choo shoes
jordan shoes
eagles jerseys
cheap snapbacks
cheap jordans
nike blazer pas cher
birkenstock sandals
coach outlet online
nike blazer
ed hardy uk
cheap ray bans
kate spade sale
salomon shoes
jaguars jersey
polo ralph lauren
cheap jordan shoes
coach outlet
canada goose sale
miami heat jersey
nike air huarache
ugg outlet
indianapolis colts jerseys
ugg outlet
michael kors outlet
true religion outlet
ugg outlet
air jordan uk
ralph lauren polo
prada outlet
nike shoes
colts jerseys
coach outlet
golden state warriors jerseys
coach factory outlet
coach outlet store
jordan shoes
cheap nhl jerseys
coach outlet
christian louboutin sale
snapbacks wholesale
nike trainers
cheap mlb jerseys
christian louboutin outlet
pandora outlet
arizona cardinals jerseys
cheap oakley sunglasses
cheap jordans
tods outlet
chargers jerseys
oakley sunglasses wholesale
kate spade handbags
oakley sunglasses
new orleans saints jerseys
yeezy shoes
coach factory outlet
burberry outlet
cleveland cavaliers jerseys
ferragamo shoes
hugo boss outlet
coach handbags
nhl jerseys
jets jersey
coach factory outlet
ugg outlet
dolphins jerseys
polo ralph lauren outlet
kate spade outlet
ed hardy outlet
nike roshe run
uggs outlet
christian louboutin outlet
tennessee titans jersey
broncos jerseys
polo ralph lauren
hermes belt
cheap oakley sunglasses
true religion outlet store
oklahoma city thunder jerseys
ugg outlet
coach outlet store online
uggs outlet
ralph lauren outlet
nike huarache
polo ralph lauren
coach outlet
uggs outlet
ralph lauren outlet
nike outlet
salomon boots
yeezy boost 350
michael kors outlet
zzzzz
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表