Вы находитесь на странице: 1из 17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

(http://www.akashif.co.uk/feed/rss)

Technology Blog
(http://www.akashif.co.uk)
just writing my knowledge.

Delete a Team Project Collection


(http://www.akashif.co.uk/windowsserver-2008/delete-a-team-projectcollection)
To delete a team project collection completely, You need to take 3 Actions Delete
collection Delete Database Delete Sharepoint Site Delete collection Open Team
Foundation
[...](http://www.akashif.co.uk/windows-server-2008/delete-a-team-project-collection)
Read more

Home (http://www.akashif.co.uk) CentOS


(http://www.akashif.co.uk/tech/centos) Installin
g Zabbix 2.x on CentOS

Installing Zabbix 2.x


on CentOS
http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

Recent Posts
Task Scheduler stops running scheduled tasks
(http://www.akashif.co.uk/windows-server-

1/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

Zabbix 2.0.6 on
CentOS 6.4 using
source

2008/task-scheduler-stops-running-

This article is a modified version of a


good article install Zabbix 1.8
(https://www.zabbix.com/wiki/howto/i
nstall/centos/centosinstall)

File cannot be loaded because the execution

Download and extract Zabbix


1
2
3

scheduled-tasks)
PowerShell execute SQL Server SP wtih
Parameters
(http://www.akashif.co.uk/powershell/powershellexecute-sql-server-sp-wtih-parameters)
of scripts is disabled on this system
(http://www.akashif.co.uk/windows-server2008/file-cannot-be-loaded-because-theexecution-of-scripts-is-disabled-on-this-

wgethttp://sourceforge.net/projectssystem)
/zabbix/files/ZABBIX%20Latest%20Stable/2.0.6/zabbix2.0.6.tar.gz/download
tarzxvfzabbix2.0.6.tar.gz
Delete a Team Project Collection
cdzabbix2.0.6
(http://www.akashif.co.uk/windows-server-

Setting up the user accounts

2008/delete-a-team-project-collection)

The Zabbix server and client both need a


user account that they can run on, so
may as well set this up first. This also
needs to be done on every monitored
machine that is running the Zabbix agent:

How to import .pst file data in Microsoft

1
2

First install all the dependencies with


yum using the command

import-pst-file-data-in-microsoft-outlook-2013)

Categories
CentOS
(http://www.akashif.co.uk/tech/centos)
Kannel
(http://www.akashif.co.uk/tech/kannel)
MySQL
(http://www.akashif.co.uk/tech/mysql)

yuminstallzlibdevelmysqldevelglibcdevelcurldevelgccautomakemysqllibidndevelopenssldevelnetsnm

Configure the EPEL repository from


You need to go to EPEL
(http://fedoraproject.org/wiki/EPEL/F

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

(http://www.akashif.co.uk/windows/how-to-

groupaddg130zabbix
useraddu130gzabbixc'Zabbixmonitoring'zabbix

I have added the -u 130 parameter


this ensures that the zabbix user gets
created with the same user ID on every
server that we created it on, as well as
with the zabbix group (which will be
group id 130).
Dependencies

Outlook 2013

Php (http://www.akashif.co.uk/tech/php)
PowerShell

(http://www.akashif.co.uk/tech/powershell)
SQL Server

2/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

AQ#howtouse) and download relevant


rpm for your centos, for my case i
downloaded and installed for EL6 as I
am using centOS 6.4
1
2

(http://www.akashif.co.uk/tech/sql-server)
Windows
(http://www.akashif.co.uk/tech/windows)
Windows Server 2008

suc'rpmUvhhttp://download.fedor
aproject.org/pub/epel/6/i386/epelrelease68.noarch.rpm
(http://www.akashif.co.uk/tech/windowsyumenablerepo=epelinstalliksemeliksemeldevel
server-2008)

Install Zabbix 2.0.6


Navigate to directory where you have
extracted zabbix, and use following to
configure
1

./configureenableserverwith
mysql
withnetsnmpwithjabberwithlibcurlwithopenipmienable
Recent
Comments

You should be able to see something


like this
1
2
3
4
5
6
7

Enableserver:yes
Withdatabase:MySQL
WEBMonitoringvia:cURL
NativeJabber:yes
SNMP:netsnmp
IPMI:openipmi
Enableagent:yes

if Everything is fine then make and install.


1
2

make
makeinstall

You are done with installation,


Creating the MySQL DB
If you have MySql pre installed and you
have set the root user and password
you just need to login and create
database, you just skip next step
start Mysql
1

servicemysqldstart

if you are starting your MySql first time


you need to set the root password.
1

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

mysqladminurootpassword

Soeren on CURL ERROR 7 Failed to connect to


Permission denied
(http://www.akashif.co.uk/php/curl-error-7failed-to-connect-to-permissiondenied/comment-page-1#comment-205)
phpdreamer on CURL ERROR 7 Failed to
connect to Permission denied
(http://www.akashif.co.uk/php/curl-error-7failed-to-connect-to-permissiondenied/comment-page-1#comment-204)
Ali Kashif on CURL ERROR 7 Failed to connect
to Permission denied
(http://www.akashif.co.uk/php/curl-error-7failed-to-connect-to-permissiondenied/comment-page-1#comment-203)
Michael on CURL ERROR 7 Failed to connect
to Permission denied
(http://www.akashif.co.uk/php/curl-error-7failed-to-connect-to-permissiondenied/comment-page-1#comment-202)
Ali Kashif on Installing Zabbix 2.x on CentOS
(http://www.akashif.co.uk/centos/installingzabbix-2-x-on-centos/comment-page-

3/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

Login to Mysql and create Database and


user
1
2
3
4

mysqlurootp
createdatabasezabbixcharacter
grantallprivilegesonzabbix.*
quit;

Create Database Schema.


Mysql scripts are located in database
directory in your source, please make
sure to execute mysql script in this
order.
1
2
3
4

1#comment-191)

Archives
March 2014
(http://www.akashif.co.uk/2014/03)
February 2014

(http://www.akashif.co.uk/2014/02)
cddatabase/mysql/
2013
mysqluzabbixzabbix<schema.sqlDecember
p
mysqluzabbixzabbix<images.sql(http://www.akashif.co.uk/2013/12)
p
mysqluzabbixzabbix<data.sqlp
November 2013

Once we are done with installation and


Mysql, it is time to configure the Zabbix
and run it.

(http://www.akashif.co.uk/2013/11)

Configure Zabbix
zabbix 2.0.6 installation will place its conf
file at following location (atleast for me

September 2013

(http://www.akashif.co.uk/2013/08)

/usr/local/etc/zabbix_server.conf

we need to edit this file and add


Database details in. we need to locate
followings in the conf file
1
2
3

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

(http://www.akashif.co.uk/2013/10)
(http://www.akashif.co.uk/2013/09)
August 2013
July 2013 (http://www.akashif.co.uk/2013/07)
January 2013
(http://www.akashif.co.uk/2013/01)
December 2012
(http://www.akashif.co.uk/2012/12)

DBName=
DBUser=
DBPassword=

edit the zabbix_server.conf


1
2
3
4

October 2013

Tags

nano/usr/local/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=yourzabbixmysqlpassword

CentOS

4/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

Permissions and Running Zabbix


Server
It is recommended to change the file
permissions for the Zabbix config so not
every user can just read the password
out of our file
1
2

/usr/local/sbin/zabbix_agentd
/usr/local/sbin/zabbix_server

if all went well you shouldnt get any


error messages.
just to make sure that zabbix is running
try this
1

pse|grepzabbix

Creating startup scripts


i have noticed that zabbix 2.0.6 do not
contain start-up script for centos so i
copied from zabbix 1.8 and a small
modification made it run on centos6.4
here is the start-up script
1
2
3
4
5
6
7
8
9
10
11
12
13
14

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

CURL ERROR 7 (http://www.akashif.co.uk/tags/curlerror-7)

Kannel

(http://www.akashif.co.uk/tags/kannel)
chmod400/etc/zabbix/zabbix_server
.conf
chownzabbix/etc/zabbix/zabbix_server.conf
Linux Monitoring

Now we can execute the script


zabbix_agentd and zabbix_server which
are found in /usr/local/sbin/
1
2

(http://www.akashif.co.uk/tags/centos)

(http://www.akashif.co.uk/tags/linuxmonitoring)

MySQL

(http://www.akashif.co.uk/tags/mysql)
openSMPP
(http://www.akashif.co.uk/tags/opensmpp)
Outlook (http://www.akashif.co.uk/tags/outlook)
Parallels Desktop
(http://www.akashif.co.uk/tags/parallels-desktop) php
(http://www.akashif.co.uk/tags/php-2) PowerShell

(http://www.akashif.co.uk/tags/powershell)
Remote Desktop
(http://www.akashif.co.uk/tags/remote-desktop)

Server 2008

#!/bin/bash
(http://www.akashif.co.uk/tags/server#
#chkconfig:5545
2008) Sharepoint
#description:zabbix_server
(http://www.akashif.co.uk/tags/sharepoint) SMSC
#probe:false

(http://www.akashif.co.uk/tags/smsc) SQLbox
#Sourcefunctionlibrary.
(http://www.akashif.co.uk/tags/sqlbox) SQL
./etc/rc.d/init.d/functions

Server
#Sourcenetworkingconfiguration.
./etc/sysconfig/network
(http://www.akashif.co.uk/tags/sql
#Checkthatnetworkingisup.Ifyouarerunningwithoutanetwork,commentthisout.
server)
squid (http://www.akashif.co.uk/tags/squid)
["${NETWORKING}"="no"]&&exit
0

5/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

TFS
RETVAL=0
progdir="/usr/local/sbin/"
(http://www.akashif.co.uk/tags/tfs)
prog="zabbix_server"
Windows

start(){
(http://www.akashif.co.uk/tags/windows)
#Startdaemons.
zabbix (http://www.akashif.co.uk/tags/zabbix)
if[n"`/sbin/pidof$prog`"];
then
echon"$prog:alreadyrunning"
failure$"$progstart"
echo
return1
fi
echon$"Starting$prog:"
#wecan'tseemtousedaemonhereemulateitsfunctionality
suc$progdir$prog$USER
RETVAL=$?
usleep100000
if[z"`/sbin/pidof$progdir$prog`"];then
RETVAL=1
fi
[$RETVALne0]&&failure$"$progstartup"
[$RETVALeq0]&&touch/var/lock/subsys/$prog&&success$"$progstartup"
echo
return$RETVAL
}
stop(){
RETVAL=0
pid=
#Stopdaemons.
echon$"Stopping$prog:"
pid=`/sbin/pidofs$prog`
if[n"$pid"];then
killTERM$pid
else
failure$"$progstop"
echo
return1
fi
RETVAL=$?
[$RETVALne0]&&failure$"$progstop"
[$RETVALeq0]&&rmf/var/lock/subsys/$prog&&success$"$progstop"
echo
return$RETVAL
}
restart(){
stop
sleep5

6/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

start
}

#Seehowwewerecalled.
case"$1"in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
[f/var/lock/subsys/$prog]&&restart
;;
*)
echo$"Usage:$0{start|stop|restart|condrestart}"
exit1
esac

exit$?

copy the above script


1

nano/etc/init.d/zabbix_server

paste above copied content and save it.


You also need to create zabbix Agent
Startup script
1
2
3
4
5
6
7
8
9
10
11
12
13
14

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

#!/bin/bash
#
#chkconfig:5545
#description:zabbix_agentd
#probe:false

#Sourcefunctionlibrary.
./etc/rc.d/init.d/functions

#Sourcenetworkingconfiguration.
./etc/sysconfig/network

#Checkthatnetworkingisup.Ifyouarerunningwithoutanetwork,commentthisout.
["${NETWORKING}"="no"]&&exit0

7/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

RETVAL=0
progdir="/usr/local/sbin/"
prog="zabbix_agentd"

start(){
#Startdaemons.
if[n"`/sbin/pidof$prog`"];then
echon"$prog:alreadyrunning"
failure$"$progstart"
echo
return1
fi
echon$"Starting$prog:"
#wecan'tseemtousedaemonhereemulateitsfunctionality
suc$progdir$prog$USER
RETVAL=$?
usleep100000
if[z"`/sbin/pidof$progdir$prog`"];then
#Thechildprocesseshavediedafterfork()ing,e.g.
#becauseofabrokenconfigfile
RETVAL=1
fi
[$RETVALne0]&&failure$"$progstartup"
[$RETVALeq0]&&touch/var/lock/subsys/$prog&&success$"$progstartup"
echo
return$RETVAL
}
stop(){
RETVAL=0
pid=
#Stopdaemons.
echon$"Stopping$prog:"
pid=`/sbin/pidofs$prog`
if[n"$pid"];then
killTERM$pid
else
failure$"$progstop"
echo
return1
fi
RETVAL=$?
[$RETVALne0]&&failure$"$progstop"
[$RETVALeq0]&&rmf/var/lock/subsys/$prog&&success$"$progstop"
echo
return$RETVAL
}
restart(){

8/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

stop
#waitforforkeddaemonstodie
usleep1000000
start
}

#Seehowwewerecalled.
case"$1"in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
[f/var/lock/subsys/$prog]&&restart
;;
*)
echo$"Usage:$0{start|stop|restart|condrestart}"
exit1
esac

exit$?

Copy the above agent start-up script


and edit
1

nano/etc/init.d/zabbix_agentd

paste the copied text in and save,


**Please note**: In above scripts you
might need to change the progdir.
progdir is the physical path of zabbix
server binary. you can use whereis to
locate it
1
2

whereiszabbix_server
/usr/local/sbin/zabbix_server

Now let us add it to the services with


1
2

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

chkconfigaddzabbix_server
chkconfigaddzabbix_agentd

9/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

all that is left, it to tell the system on


which runlevels it should start them, we
are going to use runlevel 3 and 5.
1
2

chkconfiglevel35zabbix_serveron
chkconfiglevel35zabbix_agentdon

to verify that the changes have been


made, we can use chkconfig to list all
configurations with
1

chkconfiglist

or to just show the zabbix services we


can customize our output with grep
1

chkconfiglist|grepzabbix

All that is left to be done, is to make


these scripts executable, this is done
with the following command
1
2

chmod755/etc/init.d/zabbix_server
chmod755/etc/init.d/zabbix_agentd

Now we can control our scripts with


1

servicezabbix_server{start|stop|restart|condrestart}

Installing the Web


frontend
1

yuminstallphpmysqlphpgdphpbcmathphpmbstringphpxml

batter to add mysql and httpd to startup


1
2
3
4

/sbin/chkconfigaddhttpd
/sbin/chkconfighttpdon
/sbin/chkconfigaddmysqld
/sbin/chkconfigmysqldon

copy the frontend to your httpd root


1

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

cprfrontends/php//var/www/html/

10/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

mv/var/www/html/php//var/www/html/zabbix

access the zabbix frontend


1

http://(http://)[SERVERIP]/zabbix

you will see the a wizard and follow that.

(http://www.akashif.co.uk/wpcontent/uploads/2013/07/welcome.p
ng)

(http://www.akashif.co.uk/wpcontent/uploads/2013/07/check_for_
pre_install.png)

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

11/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

(http://www.akashif.co.uk/wpcontent/uploads/2013/07/mysql.png)

(http://www.akashif.co.uk/wpcontent/uploads/2013/07/host_name.
png)

(http://www.akashif.co.uk/wpcontent/uploads/2013/07/summary.p
ng)

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

12/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

(http://www.akashif.co.uk/wpcontent/uploads/2013/07/conf_write_
fail.png)
Please Note you will face this error, this
write fail for zabbix conf.
do this
1
2

cd/var/www/html/zabbix/
chmod777conf

then press retry and you will see this


screen.

(http://www.akashif.co.uk/wpcontent/uploads/2013/07/conf_write_
ok.png)

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

13/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

(http://www.akashif.co.uk/wpcontent/uploads/2013/07/DashBoard.
png)
You are done.

CentOS
(http://www.akashif.co.uk/tech/centos)
Linux Monitoring
(http://www.akashif.co.uk/tags/linuxmonitoring), zabbix
(http://www.akashif.co.uk/tags/zabbix)

R.COM/INTENT/TWEET?STATUS=INSTALLING ZABBIX 2.X ON


INYURL.COM/PNUSESS) (HTTP://WWW.FACEBOOK.COM/SHARER/SHARER.PHP?
ASHIF.CO.UK/CENTOS/INSTALLING-ZABBIX-2-X-ON-CENTOS&T=INSTALLING ZABBIX
HTTPS://PLUS.GOOGLE.COM/SHARE?
AKASHIF.CO.UK/CENTOS/INSTALLING-ZABBIX-2-X-ON-CENTOS)
COM/PIN/CREATE/BUTTON/?
AKASHIF.CO.UK/CENTOS/INSTALLING-ZABBIX-2-X-ON-CENTOS)
OANY.COM/EMAIL?LINKURL=HTTP://WWW.AKASHIF.CO.UK/CENTOS/INSTALLINGTOS&LINKNAME=INSTALLING ZABBIX 2.X ON CENTOS)
OANY.COM/SHARE_SAVE#URL=HTTP://WWW.AKASHIF.CO.UK/CENTOS/INSTALLINGTOS&LINKNAME=INSTALLING ZABBIX 2.X ON CENTOS)

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

14/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

Similar posts

Install and configure SNMP on CentOS


(http://www.akashif.co.uk/centos/ins
tall-and-configure-snmp-on-centos)
I needed to Monitor My CentOS 6.4 Box,
many monitoring so...

MySQL Illegal mix of collations


Install and configure SNMP on CentOS

(http://www.akashif.c
o.uk/mysql/mysqlillegal-mix-ofcollations)

(http://www.akashif.c
o.uk/centos/installand-configure-snmpon-centos)

(ht
tp:
/
/
w
osaekkap
w
2013-07-30
w.
(http://www.akashif.co.uk/centos/installingak
zabbix-2-x-on-centos/comment-page1#comment-182) as
hif
.c
i have the problem.
o. if i add new host
and show sms Get
uk value from agent
failed: cannot connect
to
/c
[[xx.xx.xx.xx]:10050]:
[4]
Interrupted
en
system call can to
you help me. if you
need please sents/
back to my email.
and i will sent picture
in to you.
st
thank you.
all
br.
in
Tom
gza

2 Comments

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

15/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

za
Rep ly (/ cent o s/ inst alling - zab b ix - 2 - x - o ncent o s?r ep lyt o co m= 1b8 2 # r esp o nd )

bi
x2xAli Kashif
on
2013-07-31 ce
(http://www.akashif.co.uk/centos/installingnt
zabbix-2-x-on-centos/comment-pageos
1#comment-191)
/f
ee
i think you need to disable SELINUX,
d)
please try 2 things
1) flush current iptables
iprables -F
and also you need to follow this to
disable SELINUX,
http://www.akashif.co.uk/php/curl
-error-7-failed-to-connect-topermission-denied
(http://www.akashif.co.uk/php/curl
-error-7-failed-to-connect-topermission-denied)
above blog is written for different
purpose, but the process is same to
disable SELINUX.
try that. i suspect this will solve your
issue
Rep ly (/ cent o s/ inst alling - zab b ix - 2 - x - o ncent o s?r ep lyt o co m= 1 91 # r esp o nd )

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

16/17

3/6/2014

Technology Blog Installing Zabbix 2.x on CentOS

Leave a Reply
Your email address will not be published.
Required fields are marked *
Name *

Email *

Website

Comment

You may use these HTML (HyperText


Markup Language) tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""

Post Comment

evolve (http://theme4press.com/evolve/) theme by Theme4Press Powered by WordPress (http://wordpress.org)

http://www.akashif.co.uk/centos/installing-zabbix-2-x-on-centos

17/17

Вам также может понравиться