【postgres】
dnf -y install postgresql15-server postgresql15-server-develpostgresql-setup initdb
passwd postgres
vi `find / -name pg_hba.conf` << __EOF__
#local all all peer
local all all trust
#host all all 127.0.0.1/32 ident
host all all 10.0.0.0/16 password
host all all 127.0.0.1/32 password
__EOF__
find / -name postgresql.conf
vi /var/lib/pgsql/data/postgresql.conf <<__EOF__
listen_addresses = '*'
port = 5432
log_timezone = 'Asia/Tokyo'
timezone = 'Asia/Tokyo'
lc_messages = 'ja_JP.utf8' # locale for system error message
lc_monetary = 'ja_JP.utf8' # locale for monetary formatting
lc_numeric = 'ja_JP.utf8' # locale for number formatting
lc_time = 'ja_JP.utf8'
__EOF__
systemctl start postgresql
systemctl start postgresql
systemctl enable postgresql
【zabbix】
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/amazonlinux/2023/x86_64/zabbix-release-latest.amzn2023.noarch.rpm
dnf clean all
dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-agent2
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
vi /etc/zabbix/zabbix_server.conf
vi /var/lib/pgsql/data/postgresql.conf <<__EOF__
listen_addresses = '*'
port = 5432
log_timezone = 'Asia/Tokyo'
timezone = 'Asia/Tokyo'
lc_messages = 'ja_JP.utf8' # locale for system error message
lc_monetary = 'ja_JP.utf8' # locale for monetary formatting
lc_numeric = 'ja_JP.utf8' # locale for number formatting
lc_time = 'ja_JP.utf8'
__EOF__
systemctl start postgresql
systemctl start postgresql
systemctl enable postgresql
【zabbix】
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/amazonlinux/2023/x86_64/zabbix-release-latest.amzn2023.noarch.rpm
dnf clean all
dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-agent2
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
vi /etc/zabbix/zabbix_server.conf
DBPassword=xxxxx
vi /etc/php-fpm.d/zabbix.conf <<__EOF__
php_value[date.timezone] = Asia/Tokyo
vi /etc/php-fpm.d/zabbix.conf <<__EOF__
php_value[date.timezone] = Asia/Tokyo
__EOF__
systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
systemctl enable zabbix-server zabbix-agent2 httpd php-fpm
systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
systemctl enable zabbix-server zabbix-agent2 httpd php-fpm
Admin/zabbix
【agent2】
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/amazonlinux/2023/x86_64/zabbix-release-latest.amzn2023.noarch.rpm
dnf install zabbix-agent2
vi /etc/zabbix/zabbix_agent2.d/plugins.d/z99-local.conf <<__EOF__
LogFileSize=1
Server=10.0.19.119
ServerActive=10.0.19.119:10051
Hostname=Zabbix server
#HostMetadata=Rockylinux
HostMetadataItem=system.uname
#ControlSocket=/run/zabbix/agent.sock
AllowKey=system.run[*]
__EOF__
systemctl start zabbix-agent2
systemctl enable zabbix-agent2
dnf install zabbix-get
zabbix_get -s 10.0.19.119 -k agent.version