PostgreSQL service not running on Zabbix server
dmjaya opened this issue · comments
The "PostgreSQL service not running on {HOSTNAME}" will trigger on this expression:
<expression>{Template DB PostgreSQL:proc.num[{$PG_PROCESS_NAME}].last()}=0</expression>
The item "proc.num" is filled by your Zabbix Agent.
My guess is that you either have PostgreSQL not running or it uses a different process name in your setup than postgrs
.
<macro>
<macro>{$PG_PROCESS_NAME}</macro>
<value>postgres</value>
</macro>
Please give more details about your environment, especially what process name you are using for PostgreSQL.
Thanks a lot for the information, may I know how to find the Postgres running process name in centos.
I am not using CentOS. By looking on the rpm packages provided by postgresql, I would have guessed on postgres
, as it is in the package by this name. But then it is surprising that it is not available on your installation.
Please double check which version of the OS you are using. Is it properly installed and available in the path?
Is this folder present on your system?
/usr/pgsql-12/bin/
Did you modify the macro PG_PROCESS_NAME
? In the original template is defaults to postgres
. This is the correct name used in Ubuntu and according to the official documentation the right one.
The postmaster process is an deprecated alias:
https://www.postgresql.org/docs/12/app-postmaster.html
I think once you change the macro to use this process name postmaster
it should work in your CentOS context as well. Please try.
Hi,
Thanks a lot, now database service is up.
One question is it possible to use this template to monitor multiple remote databases in different locations? if it is yes how to write macros on the frontend.
Many Thanks.
Sure. Just use the template like other templates in Zabbix to assign to your hosts. You can configure each host individually in Zabbix with different macros (Configuration/Host/Macros).
I don't know why CentOS is using a different (outdated) process name. I will add a hint to the readme to highlight the possibility to easily configure the process name.
See Zabbix documentation for further details on how to monitor different hosts.
Noted and I'll check it. I appreciate your support only you gave this much support.
Thanks Again.