RSS

Category Archives: Monitoring

How to Configure Zabbix Proxy Server on CentOS 7

How to Configure Zabbix Proxy Server on CentOS 7

To implement Zabbix Proxy for centralized and distributed monitoring is good for your remote host monitoring for zabbix.

Step: 1 To install and start Apache packages

# yum install httpd httpd-devel -y
# systemctl start httpd
# systemctl enable httpd

Step: 2 To install and start postgreSQL packages

# yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
# yum install postgresql95-server postgresql95-contrib

To Create the database cluster:

# /usr/pgsql-9.5/bin/postgresql95-setup initdb
# systemctl start postgresql-9.5
# systemctl enable postgresql-9.5

# vi /var/lib/pgsql/9.1/data/pg_hba.conf

Adjust the pg_hba.conf, allowing local access without password, replacing:

# “local” is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust

Step : 3 To Create the database and user zabbix:

# su – postgres

psql -U postgres

CREATE USER zabbix;
ALTER USER “zabbix” WITH PASSWORD ‘new_password’;
CREATE DATABASE zabbix OWNER zabbix;

 

Step: 4 To install php packages

#yum install php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml

# vi /etc/php.ini

date.timezone = “Asia/Kolkata”

# /etc/init.d/httpd restart

Setup Zabbix Apache Configuration

# vi /etc/httpd/conf.d/zabbix.conf

php_value date.timezone Asia/Kolkata

# systemctl restart httpd

 

Step: 5 To install YUM repository for zabbix

# rpm –import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX
# yum install http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

 

Step: 6 To Install Zabbix Server with PostgresSQL

# su – postgres

psql -U postgres

CREATE USER zabbix;
ALTER USER “zabbix” WITH PASSWORD ‘new_password’;
CREATE DATABASE zabbixserver OWNER zabbix;

Adjust the /etc/zabbix/zabbix_server.conf, adding:

DBUser=zabbix
DBPort=5432
DBHost=localhost
DBPassword = Password

Step: 7 To Install Zabbix Proxy with PostgresSQL

# yum install zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-proxy-pgsql

To Create Zabbix Proxy postgresSQL Database

# cd /usr/share/doc/zabbix-proxy-pgsql-3.0.10/
# zcat schema.sql.gz | psql -U zabbix -d zabbix

Step:8 Setup Zabbix Proxy Configuration

# vi /etc/zabbix/zabbix_proxy.conf

#Server=127.0.0.1
Server=10.100.100.123

#Hostname=Zabbix proxy
Hostname=proxy.server.lan

#DBName=zabbix_proxy
DBName=zabbix

# DBUser=
DBUser=zabbix

# DBPassword=
DBPassword=zabbix@123

DBPort=5432
DBHost=localhost

Step:9 To Start Zabbix Proxy Services

# systemctl enable zabbix-proxy
# systemctl start zabbix-proxy

 

 

 
Leave a comment

Posted by on July 25, 2017 in Linux, Monitoring, Zabbix

 

How to install Zabbix on CentOS

Zabbix is Free and Open Source software for Monitoring tool.
The monitoring tool for network and application monitoring via SNMP, TCP, ICMP checks.

Step-1. To install and start Apache packages

# yum install httpd httpd-devel -y
# /etc/init.d/httpd start
# chkconfig httpd on

Step-2. To install and start mysql packages

# yum install mysql mysql-server
# /etc/init.d/mysqld start
# chkconfig mysqld on
# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we’ll need the current
password for the root user.  If you’ve just installed MySQL, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
… Success!

Normally, root should only be allowed to connect from ‘localhost’.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
… Success!

By default, MySQL comes with a database named ‘test’ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
… Success!

Cleaning up…

All done!  If you’ve completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Step- 3.To install php packages

#yum install php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml

Then find and modify the timezone as below
# vi /etc/php.ini

date.timezone = “Asia/Kolkata”

# /etc/init.d/httpd restart

Step- 4. To install YUM repository for zabbix

# rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm

Step- 5. To Install Zabbix Server with MySQL

# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway

Step- 6. Setup Zabbix Apache Configuration

# vi /etc/httpd/conf.d/zabbix.conf

php_value date.timezone Asia/Kolkata

# service httpd restart

Step- 7. To Create Zabbix MySQL Database

# mysql -u root -p

mysql> CREATE DATABASE zabbix CHARACTER SET UTF8;
mysql> GRANT ALL PRIVILEGES on zabbix.* to ‘zabbix’@’localhost’ IDENTIFIED BY ‘SECRET_PASSWORD’;
mysql> FLUSH PRIVILEGES;
mysql> quit

After creating database restore the default mysql database provided by zabbix. These files can be found at /usr/share/doc/zabbix-server-mysql-<version>/create/ directory.

# mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.8/create/schema.sql
# mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.8/create/images.sql
# mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.8/create/data.sql

Step- 8. To Start Zabbix Server

# service zabbix-server start

Step- 9. To on all services using check config tool

# chkconfig –level 345 httpd on
# chkconfig –level 345 mysqld on
# chkconfig –level 345 zabbix-server on

 
Leave a comment

Posted by on September 5, 2015 in Documents, Linux, Monitoring, Zabbix