lesovsky / zabbix-extensions

Zabbix additional monitoring modules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PostgreSQL service not running on Zabbix server

dmjaya opened this issue · comments

Hi.
I have a issue when monitoring postgres 12 DB in zabbix 4.4. please refer the below image could you please check why this happens.

image

Thanks,

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/

Thanks for valuable information, I'm using "CentOS Linux release 7.7.1908 (Core)" and /usr/pgsql-12/bin/ path is available. Please refer to the macro value on the UI side.

image

And my Postgres database service is Up and running.

image

Many Thanks.

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.