Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install zabbix 1.8.2 in Centos 5.4

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to install zabbix 1.8.2 in Centos 5.4. the content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

I. Environmental preparation

First install mysql+nginx (or apache) + php, not to mention here.

Compiling directories still follows my usual rules:

/ ─ / usr

│ ├─ / usr/server

│ │ ├─ / usr/server/ect # places general configuration files

│ │ ├─ / usr/server/bin # place bin executor

│ │ ├─ / usr/server/sbin # places sbin service programs

-prefix directory of the │ │ ├─ / usr/server/xxx # program

│ │ │

Second, install fping

Fping is an enhanced ping tool that can ping multiple hosts at the same time.

Fping's official website is: http://www.fping.com

Web03# wget http://fping.sourceforge.net/download/fping.tar.gzweb03# tar zxf fping.tar.gzweb03# cd fping-2.4b2_toweb03#. / configureweb03# make & & make install

After installation, there are only 2 files together:

/ usr/local/sbin/fping # execution file / usr/local/man/man8/fping.8 # man file

Set fping permissions:

Web03# chown root:zabbix / usr/local/sbin/fpingweb03# chmod 710 / usr/local/sbin/fpingweb03# chmod ug+s / usr/local/sbin/fping

Then install traceroute:

Web03# yum install traceroute

Third, install net-snmp

Net-snmp 's official website is: http://www.net-snmp.org

Web03# wget http://nchc.dl.sourceforge.net/sourceforge/net-snmp/net-snmp-5.4.2.1.tar.gzweb03# tar zxf net-snmp-5.4.2.1.tar.gzweb03# cd net-snmp-5.4.2.1web03#. / configure-prefix=/usr/server/snmpd-bindir=/usr/server/bin-sbindir=/usr/server/sbin-disable-debugging-enable-developer--with-default-snmp-version= "2 "--enable-mfd-rewrites-- with-mib-modules=" mibII ucd_snmp agentx notification target utilities disman/event disman/schedule host ip-mib/ipv4InterfaceTable tunnel "--with-sys-contact=" ie81@163.com "--with-sys-location=" location "--with-logfile=" / var/log/snmpd.log "- with-persistent-directory=" / var/net-snmp "web03# make & & make install

--

Note: if you add these mib-modules, there will be a problem: ucd-snmp/lmSensors snmpv3mibs mibII/interfaces

So it was removed.

--

After installation, the following relevant execution files are generated under / usr/server/bin/:

Encode_keychange mib2c-update snmpcheck snmpget snmpset snmptranslate snmpwalkfixproc net-snmp-config snmpconf snmpgetnext snmpstatus snmptrap tkmibipf-mod.pl snmpbulkget snmpdelta snmpinform snmptable snmpusm traptoemailmib2c snmpbulkwalk snmpdf snmpnetstat snmptest snmpvacm

The following background service programs will be generated under / usr/server/sbin/:

Snmpd snmptrapd

Now copy the configuration file:

Web03# cp EXAMPLE.conf / usr/server/snmpd/share/snmp/snmpd.conf

Edit the configuration file:

Web03# vi / usr/server/snmpd/share/snmp/snmpd.conf found the following two lines [about 61-62 lines]: com2sec local localhost COMMUNITYcom2sec mynetwork NETWORK/24 COMMUNITY is the string authentication of snmpd, and one line represents a permission setting, which can be changed to: com2sec local localhost public01com2sec local 119.146.191.170 web03com2sec local 192.168.1.0 web03 24 web03

Then copy the backup script snmpd to the / etc/init.d directory (see backup files). You can start snmpd:

Web03# / etc/init.d/snmpd startStarting snmpd: [OK]

Then test:

Web03# snmpwalk-v 2c-c public01 127.0.0.1 if # the last if represents the network information.

If any information comes out, it means OK.

4. Start installing zabbix-server: (and install zabbix agent on this machine)

Zabbix's official website is: http://www.zabbix.com

Currently, the highest stable version is 1.8.2.

1. Add users:

Web03# groupadd-g 36 zabbixweb03# useradd-u 36-g 36-s / sbin/nologin-M zabbixweb03# id zabbixuid=36 (zabbix) gid=36 (zabbix) groups=36 (zabbix)

2. Download and decompress:

Web03# wget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/1.8.2/zabbix-1.8.2.tar.gzweb03# tar zxf zabbix-1.8.2.tar.gzweb03# cd zabbix-1.8.2

3. Set up mysql database

1) add databases and users:

Web03# mysql-u root-pEnter password: mysql > create database zabbix;mysql > CREATE USER 'coos'@'localhost' IDENTIFIED BY' coos';mysql > GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER,SHOW VIEW,CREATE VIEW,LOCK TABLES ON `zabbix`. * TO 'coos'@'localhost';mysql > exitBye

2) Import data:

Change web03# mysql-u coos-pcoos zabbix to / usr/server/zabbixZABBIX_SUCKERD=$BASEDIR/bin/zabbix_server = = > change bin to sbin

② modifies the client startup script:

Web03# vi / etc/init.d/zabbix_agentd_ctlBASEDIR=/opt/zabbix = = > modify to / usr/server/zabbixZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd = = > modify bin to sbin

It's ready to start now:

Add the library paths of net-snmpd and mysql to ldconfig before startup, otherwise an error will be reported:

Web03# grep'/ usr/server/snmpd/lib' / etc/ld.so.conf | | echo "/ usr/server/snmpd/lib" > / etc/ld.so.confweb03# grep `mysql_config-- libs | egrep-o /. + lib/ mysql` / etc/ld.so.conf | | echo `mysql_config-- libs | egrep-o /. + lib/mysql `> > / etc/ld.so.confweb03# ldconfig

Start:

Web03# / etc/init.d/zabbix_server_ctl startweb03# / etc/init.d/zabbix_agentd_ctl start

Then check the listening port and process:

Web03# netstat-tunlp | grep zabbixtcp 00 0.0.0.0 grep zabbixtcp 10050 0.0.0.0 LISTEN 8911/zabbix_agentdtcp 00 0.0.0.0 grep zabbixtcp 10051 0.0.0.0 LISTEN 8871/zabbix_server

5) configure the web interface:

Copy the web page file to the web path:

Web03# cp-r frontends/php / home/web/test/zabbixweb03# cd / home/web/test/zabbix/confweb03# cp zabbix.conf.php.example zabbix.conf.phpweb03# chown-R www: / home/web/test/zabbixweb03# vi zabbix.conf.php modifies the username and password of db in it.

Edit the php.ini file:

Max_execution_time = 300 = = > modified to 600 # approximately 255lines.

Max_input_time = 120 = = > modified to 600 # about 256lines.

Memory_limit = 128m = = > modified to 256m # about 258 lines.

Post_max_size = 8m = = > modified to 32m # about 439 lines.

Upload_max_filesize = 10m = = > modified to 16m # about 555 lines.

; date.timezone = = > remove the comment and add Asia/Shanghai # about 662 lines after =.

Then restart php-fpm,apache and restart httpd.

Then use a browser to visit: http://10.1.1.8/zabbix

The installation wizard will appear, and you can fill it out step by step.

Finally, the default administrator user and password is: admin/zabbix. After entering, you can change the user's password.

There is also a guest user who cannot be deleted by default. You can go in and change the user name, and then set a password or delete it.

5. Install zabbix client zabbix-agentd under Centos 5.3:

In fact, the server has already explained how to install the client. But here in order to separate, fortunately, the machines that need to be monitored install the client separately, so do it again:

1. Add users:

Web02# groupadd-g 36 zabbixweb02# useradd-u 36-g 36-s / sbin/nologin-M zabbixweb02# id zabbixuid=36 (zabbix) gid=36 (zabbix) groups=36 (zabbix)

2. Download and decompress, and compile the client:

Web02# wget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/1.8.2/zabbix-1.8.2.tar.gzweb02# tar zxf zabbix-1.8.2.tar.gzweb02# cd zabbix-1.8.2web02#. / configure-- prefix=/usr/server/zabbix-- enable-agentweb02# make & & make install

3. Configure the service:

Web02# mkdir / etc/zabbixweb02# touch / etc/zabbix/zabbix_agentd.confweb02# vi / etc/zabbix/zabbix_agentd.conf

Add the following:

# This is config file for zabbix_agentd

# To get more information about ZABBIX, go http://www.zabbix.com

Server=10.1.1.8

# ServerPort=11051

Hostname=web02

# ListenIP=

# ListenPort=10050

BufferSize=1024

TimeOut=5

StartAgents=3

DebugLevel=2

PidFile=/var/tmp/zabbix_agentd.pid

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

LogFileSize=10

EnableRemoteCommands=1

# UnsafeUserParameters=1

Include=/etc/zabbix/zabbix_command.conf

Finally, set up the log directory:

Web02# mkdir / var/log/zabbixweb02# chown-R zabbix: / var/log/zabbix/

Create a custom file to place custom monitoring commands:

Web03# touch / etc/zabbix/zabbix_command.conf

4. Then add the port file:

Web03# vi / etc/services is added at the end: zabbix-agent 10050/tcp # Zabbix Agentzabbix-agent 10050/udp # Zabbix Agent

5. Copy the startup script:

Web02# cp misc/init.d/redhat/zabbix_agentd_ctl / etc/init.d/

Modify the client startup script:

Web02# vi / etc/init.d/zabbix_agentd_ctlBASEDIR=/opt/zabbix = = > modify to / usr/server/zabbixZABBIX_AGENTD=$BASEDIR/bin/zabbix_agentd = = > modify / bin to / sbin

Start:

Web02# / etc/init.d/zabbix_agentd_ctl start

View listening ports and processes:

Web02# netstat-tunlp | grep zabbixtcp 00 0.0.0.0 grep zabbixtcp 10050 0.0.0.0 LISTEN 15356/zabbix_agentd above is how to install zabbix 1.8.2 in Centos 5.4.Do you learn any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report