简体   繁体   English

sh: psql: 在 Zabbix 模板中找不到命令

[英]sh: psql: command not found in Zabbix template

There is a template for monitoring PostgreSQL有监控模板PostgreSQL

Zabbix v3.2 Zabbix v3.2

Zabbix_agent is installed on another server and monitors PostgreSQL 9.6 there. Zabbix_agent安装在另一台服务器上,在那里监控PostgreSQL 9.6。 The host is active in the Zabbix server in the web interface, there are no errors.主机在web界面中的Zabbix server中是活跃的,没有报错。 Partially zero values from the database are output to the template on the Zabbix server and there are来自数据库的部分零值是 output 到 Zabbix 服务器上的模板,并且有

sh: psql: command not found

enter image description here在此处输入图像描述

You are attempting to execute /usr/pgsql-9.6/bin/psql .您正在尝试执行/usr/pgsql-9.6/bin/psql

If that postgres directory is not in the $PATH env var, then trying just psql won't work and will produce a "command not found" diagnostic.如果该 postgres 目录不在$PATH env var 中,则仅尝试psql将不起作用,并将产生“找不到命令”诊断信息。

Either tell Zabbix to execute the full pathname, or put the postgres directory in Zabbix's PATH, or choose a directory already in Zabbix's PATH and add a symlink to it.要么告诉 Zabbix 执行完整路径名,要么将 postgres 目录放在 Zabbix 的 PATH 中,或者选择一个已经在 Zabbix 的 PATH 中的目录并向其添加符号链接。 For example:例如:

$ cd /usr/bin
$ sudo ln -s /usr/pgsql-9.6/bin/psql

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM