
- dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
- dnf -qy module disable postgresql
- dnf config-manager –set-disabled pgdg15 pgdg14 pgdg13 pgdg12
- dnf install -y postgresql16-server postgresql16-contrib
- /usr/pgsql-16/bin/postgresql-16-setup initdb
- nano /var/lib/pgsql/16/data/postgresql.conf # postgresql veritabanı config dosyası
- systemctl enable postgresql-16.service –now
- systemctl enable postgresql-16
- systemctl start postgresql-16
- systemctl status postgresql-16 # postgresql veritabanı servisinin çalışıp çalışmadığını kontrol etmek durum kontrolu
● postgresql-16.service – PostgreSQL 16 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-16.service; enabled; preset: disabled)
Active: active (running) since Mon 2024-10-07 23:44:59 +03; 35min ago
Docs: https://www.postgresql.org/docs/16/static/
Main PID: 28371 (postgres)
Tasks: 38 (limit: 50495)
Memory: 302.9M
CPU: 32.048s
CGroup: /system.slice/postgresql-16.service
├─28371 /usr/pgsql-16/bin/postgres -D /var/lib/pgsql/16/data/
├─28372 “postgres: logger “
├─28373 “postgres: checkpointer “
├─28374 “postgres: background writer “
├─28376 “postgres: walwriter “
├─28377 “postgres: autovacuum launcher “
├─28378 “postgres: logical replication launcher “
├─30986 “postgres: zabbix zabbix ::1(37804) idle”
├─30989 “postgres: zabbix zabbix ::1(37806) idle”
├─30990 “postgres: zabbix zabbix ::1(37818) idle”
├─30995 “postgres: zabbix zabbix ::1(37832) idle”
├─31032 “postgres: zabbix zabbix ::1(37838) idle”
├─31033 “postgres: zabbix zabbix ::1(37844) idle”
├─31034 “postgres: zabbix zabbix ::1(37854) idle”
├─31035 “postgres: zabbix zabbix ::1(37866) idle”
├─31036 “postgres: zabbix zabbix ::1(37874) idle”
├─31047 “postgres: zabbix zabbix ::1(37880) idle”
├─31106 “postgres: zabbix zabbix ::1(37908) idle”
├─31107 “postgres: zabbix zabbix ::1(37910) idle”
├─31110 “postgres: zabbix zabbix ::1(37916) idle”
├─31111 “postgres: zabbix zabbix ::1(37918) idle”
├─31112 “postgres: zabbix zabbix ::1(37920) idle”
├─31113 “postgres: zabbix zabbix ::1(37924) idle”
├─31114 “postgres: zabbix zabbix ::1(37932) idle”
├─31115 “postgres: zabbix zabbix ::1(37936) idle”
├─31116 “postgres: zabbix zabbix ::1(37938) idle”
├─31118 “postgres: zabbix zabbix ::1(37940) idle”
├─31119 “postgres: zabbix zabbix ::1(37944) idle”
├─31120 “postgres: zabbix zabbix ::1(37950) idle”
├─31121 “postgres: zabbix zabbix ::1(37964) idle”
├─31122 “postgres: zabbix zabbix ::1(37978) idle”
├─31123 “postgres: zabbix zabbix ::1(37984) idle”
├─31124 “postgres: zabbix zabbix ::1(37996) idle”
├─31125 “postgres: zabbix zabbix ::1(38002) idle”
├─31126 “postgres: zabbix zabbix ::1(38012) idle”
├─31127 “postgres: zabbix zabbix ::1(38022) idle”
├─31128 “postgres: zabbix zabbix ::1(38036) idle”
└─31129 “postgres: zabbix zabbix ::1(38052) idle”
Oct 07 23:44:59 salvadortestzabbix systemd[1]: Starting PostgreSQL 16 database server…
Oct 07 23:44:59 salvadortestzabbix postgres[28371]: 2024-10-07 23:44:59.806 +03 [28371] LOG: redirecting log output to logging collector process
Oct 07 23:44:59 salvadortestzabbix postgres[28371]: 2024-10-07 23:44:59.806 +03 [28371] HINT: Future log output will appear in directory “log”.
Oct 07 23:44:59 salvadortestzabbix systemd[1]: Started PostgreSQL 16 database server.
lines 8-52/52 (END)
- netstat -plant # mevcut bağlatılar ne durumda onu görmek için
[root@salvadortestzabbix ~]# netstat -plant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 794/sshd: /usr/sbin
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 30983/zabbix_server
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 28371/postgres
tcp 0 0 127.0.0.1:52996 127.0.0.1:10050 TIME_WAIT –
tcp 0 0 127.0.0.1:39134 127.0.0.1:10050 TIME_WAIT –
tcp 0 0 127.0.0.1:10051 127.0.0.1:43855 TIME_WAIT –
tcp 0 0 192.168.0.106:22 192.168.0.108:39114 ESTABLISHED 1119/sshd: salvador - su – postgres # postgres kullanıcısı ile veritabanı kullanıcısına geçiniz.
postgres=# CREATE DATABASE zabbix;
CREATE DATABASE
postgres=# CREATE USER zabbix WITH PASSWORD ‘1q2w3eR4’;
CREATE ROLE
postgres=# GRANT ALL PRIVILEGES ON DATABASE zabbix to zabbix;
GRANT
postgres=# ALTER DATABASE zabbix OWNER to zabbix;
ALTER DATABASE
postgres=# exit; ile çıkış yap.
- dnf install httpd # apache kurulumu yap.
- firewall-cmd –permanent –add-port=80/tcp
- firewall-cmd –reload
- rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-7.0-5.el9.noarch.rpm
- dnf clean all
- dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2
- zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix # zabbix database schema ve tabloları oluşturmak için
- nano /etc/zabbix/zabbix_server.conf # zabbix server config dosyası aşağıdaki gibi düzenlenir.
[root@salvadortestzabbix ~]# cat /etc/zabbix/zabbix_server.conf | grep -v ^# | tr -s ‘\n’
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/run/zabbix/zabbix_server.pid
SocketDir=/run/zabbix
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=1q2w3eR4
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
LogSlowQueries=3000
StatsAllowedIP=127.0.0.1
EnableGlobalScripts=0
- systemctl enable –now zabbix-server.service zabbix-agent2.service httpd php-fpm.service # servisler enable edilir ve başlatılır.
- systemctl enable –now zabbix-agent2.service
- firewall-cmd –permanent –add-port=10051/tcp
- firewall-cmd –reload
- setenforce 0 # burası önemli linux selinux disabled edilir. firewall için
- systemctl status zabbix-server.service
- nano /etc/zabbix/web/zabbix.conf.php
[root@salvadortestzabbix ~]# cat /etc/zabbix/web/zabbix.conf.php
<?php
// Zabbix GUI configuration file.
$DB[‘TYPE’] = ‘POSTGRESQL’;
$DB[‘SERVER’] = ‘localhost’;
$DB[‘PORT’] = ‘0’;
$DB[‘DATABASE’] = ‘zabbix’;
$DB[‘USER’] = ‘zabbix’;
$DB[‘PASSWORD’] = ‘1q2w3eR4’;
// Schema name. Used for PostgreSQL.
$DB[‘SCHEMA’] = ”;
// Used for TLS connection.
$DB[‘ENCRYPTION’] = true;
$DB[‘KEY_FILE’] = ”;
$DB[‘CERT_FILE’] = ”;
$DB[‘CA_FILE’] = ”;
$DB[‘VERIFY_HOST’] = false;
$DB[‘CIPHER_LIST’] = ”;
// Vault configuration. Used if database credentials are stored in Vault secrets manager.
$DB[‘VAULT’] = ”;
$DB[‘VAULT_URL’] = ”;
$DB[‘VAULT_PREFIX’] = ”;
$DB[‘VAULT_DB_PATH’] = ”;
$DB[‘VAULT_TOKEN’] = ”;
$DB[‘VAULT_CERT_FILE’] = ”;
$DB[‘VAULT_KEY_FILE’] = ”;
// Uncomment to bypass local caching of credentials.
// $DB[‘VAULT_CACHE’] = true;
// Uncomment and set to desired values to override Zabbix hostname/IP and port.
// $ZBX_SERVER = ”;
// $ZBX_SERVER_PORT = ”;
// burasi zabbix ana ekranindaki kurum bilgisi kismidir istediginiz gibi degistirebilirsiniz.!
$ZBX_SERVER_NAME = ‘ZNGILSAGLIK’;
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
// Uncomment this block only if you are using Elasticsearch.
// Elasticsearch url (can be string if same url is used for all types).
//$HISTORY[‘url’] = [
// ‘uint’ => ‘http://localhost:9200’,
// ‘text’ => ‘http://localhost:9200’
//];
// Value types stored in Elasticsearch.
//$HISTORY[‘types’] = [‘uint’, ‘text’];
// Used for SAML authentication.
// Uncomment to override the default paths to SP private key, SP and IdP X.509 certificates, and to set extra settings.
//$SSO[‘SP_KEY’] = ‘conf/certs/sp.key’;
//$SSO[‘SP_CERT’] = ‘conf/certs/sp.crt’;
//$SSO[‘IDP_CERT’] = ‘conf/certs/idp.crt’;
//$SSO[‘SETTINGS’] = [];
// If set to false, support for HTTP authentication will be disabled.
// $ALLOW_HTTP_AUTH = true;
Congratulations! You have successfully installed Zabbix frontend.
Configuration file “/etc/zabbix/web/zabbix.conf.php” created.
Congratulations! You have successfully installed Zabbix frontend.
- systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
- systemctl enable zabbix-server zabbix-agent2 httpd php-fpm
- systemctl status zabbix-server.service 3 dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
4 dnf -qy module disable postgresql
5 dnf config-manager –set-disabled pgdg15 pgdg14 pgdg13 pgdg12
6 dnf config-manager –set-disabled pgdg16
7 dnf install -y postgresql17-server postgresql17-contrib
8 /usr/pgsql-17/bin/postgresql-17-setup initdb
9 nano /var/lib/pgsql/17/data/postgresql.conf
10 systemctl enable postgresql-17.service –now
11 systemctl start postgresql-17
12 systemctl status postgresql-17
13 netstat -plant
14 su – postgres
15 dnf install httpd
16 firewall-cmd –permanent –add-port=80/tcp
17 firewall-cmd –reload
19 rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-7.0-5.el9.noarch.rpm
20 dnf clean all
21 dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2
22 zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
23 nano /etc/zabbix/zabbix_server.conf
24 nano /etc/zabbix/zabbix_server.conf | grep -v ^# | tr -s ‘\n’
25 nano /etc/zabbix/zabbix_server.conf
26 systemctl enable –now zabbix-server.service zabbix-agent2.service httpd php-fpm.service
27 dnf install zabbix-agent2
28 systemctl enable –now zabbix-agent2.service
29 firewall-cmd –permanent –add-port=10051/tcp
30 firewall-cmd –reload 1 dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
2 dnf -qy module disable postgresql
3 dnf config-manager –set-disabled pgdg15 pgdg14 pgdg13 pgdg12
4 dnf install -y postgresql16-server postgresql16-contrib
5 /usr/pgsql-16/bin/postgresql-16-setup initdb
6 nano /var/lib/pgsql/16/data/postgresql.conf
7 systemctl enable postgresql-16.service –now
8 systemctl enable postgresql-16
9 systemctl start postgresql-16
10 systemctl status postgresql-16
11 netstat -plant
12 su – postgres
13 dnf install httpd
14 firewall-cmd –permanent –add-port=80/tcp
15 firewall-cmd –reload
17 rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-7.0-5.el9.noarch.rpm
18 dnf clean all
19 dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2
20 zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
21 nano /etc/zabbix/zabbix_server.conf
22 systemctl enable –now zabbix-server.service zabbix-agent2.service httpd php-fpm.service
23 dnf install zabbix-agent2
24 systemctl enable –now zabbix-agent2.service
25 firewall-cmd –permanent –add-port=10051/tcp
26 firewall-cmd –reload
27 setenforce 0
28 systemctl status zabbix-server.service
29 nano /etc/zabbix/web/zabbix.conf.php
30 systemctl restart zabbix-server zabbix-agent httpd php-fpm
31 systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
32 systemctl enable zabbix-server zabbix-agent2 httpd php-fpm
33 systemctl status zabbix-server.service
dnf install zabbix-agent2
dnf install zabbix-agent2 zabbix-agent2-plugin-*
[root@salvadortestzabbix ~]# nano /etc/zabbix/zabbix_agent2.conf
[root@salvadortestzabbix ~]# firewall-cmd –permanent –add-port=10050/tcp
success
[root@salvadortestzabbix ~]# firewall-cmd –reload
success
[root@salvadortestzabbix ~]# cat /etc/zabbix/zabbix_agent2.conf | grep -v ^# | tr -s ‘\n’
PidFile=/run/zabbix/zabbix_agent2.pid
LogFile=/var/log/zabbix/zabbix_agent2.log
LogFileSize=0
Server=192.168.0.106
ServerActive=192.168.0.106
Hostname=Zabbix server
Include=/etc/zabbix/zabbix_agent2.d/.conf PluginSocket=/run/zabbix/agent.plugin.sock ControlSocket=/run/zabbix/agent.sock Include=/etc/zabbix/zabbix_agent2.d/plugins.d/.conf
[root@salvadortestzabbix ~]#
[root@salvadortestzabbix ~]# history
1 dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
2 dnf -qy module disable postgresql
3 dnf config-manager –set-disabled pgdg15 pgdg14 pgdg13 pgdg12
4 dnf install -y postgresql16-server postgresql16-contrib
5 /usr/pgsql-16/bin/postgresql-16-setup initdb
6 nano /var/lib/pgsql/16/data/postgresql.conf
7 systemctl enable postgresql-16.service –now
8 systemctl enable postgresql-16
9 systemctl start postgresql-16
10 systemctl status postgresql-16
11 netstat -plant
12 su – postgres
13 dnf install httpd
14 firewall-cmd –permanent –add-port=80/tcp
15 firewall-cmd –reload
16 dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2
17 rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-7.0-5.el9.noarch.rpm
18 dnf clean all
19 dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2
20 zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
21 nano /etc/zabbix/zabbix_server.conf
22 systemctl enable –now zabbix-server.service zabbix-agent2.service httpd php-fpm.service
23 dnf install zabbix-agent2
24 systemctl enable –now zabbix-agent2.service
25 firewall-cmd –permanent –add-port=10051/tcp
26 firewall-cmd –reload
27 setenforce 0
28 systemctl status zabbix-server.service
29 nano /etc/zabbix/web/zabbix.conf.php
30 systemctl restart zabbix-server zabbix-agent httpd php-fpm
31 systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
32 systemctl enable zabbix-server zabbix-agent2 httpd php-fpm
33 systemctl status zabbix-server.service
34 history
35 dnf install zabbix-agent2 zabbix-agent2-plugin-*
36 nano /etc/zabbix/zabbix_agent2.conf
37 firewall-cmd –permanent –add-port=10050/tcp
38 firewall-cmd –reload
39 cat /etc/zabbix/zabbix_agent2.conf | grep -v ^# | tr -s ‘\n’
40 cat /etc/zabbix/zabbix_server.conf | grep -v ^# | tr -s ‘\n’
41 systemctl status postgresql-16
42 netstat -plant
43 cat /etc/zabbix/web/zabbix.conf.php
44 history