De Wiki inetshell
Saltar a: navegación, buscar

Instalación de Zabbix Server[editar]

CentOS 7[editar]

https://www.zabbix.com/forum/showthread.php?t=57691


Installation on a new server :
First Server steps:
yum update -y
yum upgrade -y
yum install wget epel-release php-mbstring yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

and then :
yum install php-mbstring php-bcmath

yum install mod_ssl



# add this to .bashrc :
vi .bashrc

HISTTIMEFORMAT="%d/%m/%y %T "

# disable selinux:
vi /etc/selinux/config
change SELINUX=enforcing to SELINUX=disabled

#then run on CLI and run:
setenforce 0


# installing Zabbix server:
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

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


#start MariaDb:
systemctl enable mariadb
systemctl start mariadb


#make SQL secure (optional)

mysql_secure_installation


#Set the below parameters in the PHP config file (/etc/php.ini )


vi /etc/php.ini

change this values:
[CODE]max_execution_time = 600
max_input_time = 600
memory_limit = 256M
post_max_size = 32M
upload_max_filesize = 16M
date.timezone = America/Mexico_City


Se omitio esto para logserver01
#firewall settings:
yum install firewalld
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --permanent --add-port=10051/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=22/tcp
firewall-cmd --reload
systemctl restart firewalld

# Now start services:

systemctl start zabbix-server
systemctl enable zabbix-server
systemctl enable httpd
systemctl restart httpd

# to avoid future DB issues (DB growing too fast)we will set innodb per table:


#Backup mysql:

mysqldump --all-databases -p > mysqlall.sql


#Shutdown mysql

service mariadb stop


# Add the following lines to /etc/my.cnf.d/server.conf

[mysqld]
innodb_file_per_table
innodb_flush_method=O_DIRECT
innodb_log_file_size=1G
innodb_buffer_pool_size=4G
innodb_data_file_path=ibdata1:10M:autoextend


Whatever your set for innodb_buffer_pool_size, make sure innodb_log_file_size is 25% of innodb_buffer_pool_size.


#Delete ibdata1, ib_logfile0 and ib_logfile1 (see update below before deleting!)

rm -rf /var/lib/mysql/ib*


#Restart mysql

service mariadb restart


#now we will set zabbix DB:


mysql -p
>> create database zabbixdb;
>> grant all privileges on zabbixdb.* to za[email protected] identified by 'PASSWORD';
>> flush privileges;
>>exit


#building zabbixdb:
cd /usr/share/doc/zabbix-server-mysql-3.4.2/
gunzip create.sql.gz
mysql -u root -p zabbixdb < create.sql


# now we will set zabbix server DB Parameters at zabbix_server.conf:

<pre>
vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbixdb
DBUser=zabbix
DBPassword=XXXXXXX


  1. restart server:
 systemctl restart zabbix-server
  1. enabling Zabbix agent and installing Zabbix_get:
 systemctl enable zabbix-agent
 systemctl start zabbix-agent
  1. wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-get-3.2.4-2.el7.x86_64.rpm
  1. rpm -Uvh zabbix-get-3.2.4-2.el7.x86_64.rpm
 yum install zabbix-get

after this been done go to http://127.0.0.1/zabbix it will reload zabbix first settings page just follow its orders and make sure all DB settings there is correct and all packages is marked as green OK.

Login with : user: admin password: zabbix

Good Luck!


AGENT

  1. installing Zabbix server:
 rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
 yum install zabbix-agent 
vi /etc/zabbix/zabbix_agentd.conf

Server=192.168.255.1
ServerActive=192.168.255.1
#Hostname=

systemctl enable zabbix-agent
systemctl start zabbix-agent

Habilitar Zabbix con SNMP[editar]

 yum install net-snmp net-snmp-utils