There is a template for monitoring PostgreSQL
Zabbix v3.2
Zabbix_agent is installed on another server and monitors PostgreSQL 9.6 there. The host is active in the Zabbix server in the web interface, there are no errors.
Partially zero values from the database are output to the template on the Zabbix server and there are
sh: psql: command not found
enter image description here
You are attempting to execute /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.
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.
For example:
$ cd /usr/bin
$ sudo ln -s /usr/pgsql-9.6/bin/psql
Related
Am new to docker, started learning today.
I am using Windows Terminal to run the docker command.
I ran this command - docker run postgres:10.20
Got an error stating -
Error: Database is uninitialized and superuser password is not specified.
You must specify POSTGRES_PASSWORD to a non-empty value for the
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
connections without a password. This is *not* recommended.
See PostgreSQL documentation about "trust":
https://www.postgresql.org/docs/current/auth-trust.html
Can anybody help me on how to add password to that command in the Terminal, Apart from running an environment to add password in docker-compose.yaml.
Am beginner to stack overflow as well and was not allowed to add image to provide a reference. Assistance needed
All you need to do is:
docker run -e POSTGRES_PASSWORD=password postgres:10.20
Here is the documentation for setting environment variables for docker run: https://docs.docker.com/engine/reference/run/#env-environment-variables
I a rails app running on my local environment using postgresql. This morning I spun up a new one and after install the pg gem, etc. I am running into the following error when trying to run
psql
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: database "jackcollins" does not exist
What's strange is the db name "jackcollins" is from my other rails app.
I ran
pgrep -l postgres
and the output was
20902 postgres
20919 postgres
20920 postgres
20921 postgres
20922 postgres
20923 postgres
20924 postgres
I'm unsure how to proceed so that these apps can both run their own postgres instance.
I had the same problem as you, after making attempts to reinstall, rm -rf xxx.pid, etc., I ended up executing the following command and was eventually able to connect to the PostgreSQL database.
brew install postgresql
an error message appears
run createdb (because macs don't create username databases after installing PostgreSQL)
execute psql to connect successfully.
Regarding the error, you are trying to connect to jackcollins, please can you test trying to connect using the database flag?:
psql -d your_database_name
If you type
psql --help
in the terminal, you will see that the default database is your username. Unless you have that database in PostgreSQL, you will get an error. Instead, you can run the command
psql -d your_database_name
Also, if you want to log in as a specific user (by default it is a current user):
psql -d your_database_name -U your_username -W
The last -W is for password. Hope, it helps!
In the absence of -d <database_name> psql will use the OS user name as the database name. As in many things it better to be explicit rather then implicit, especially when working on a new instance. In addition use -h <host_name>, -p <port_number> and -U <user_name>. Then you know who you are connecting as, as well as how. It is spelled out here psql and since psql is a libpq program in more detail here Key words.
cp -f data/*.csv ${NEO4J_IMPORT}/
cd "${NEO4J_HOME}"
time bin/cypher-shell < $tmp_dir/create_graph.cypher
I am seeing a script to create a neo4j database, but running into a problem:
cp: /person.csv: Read-only file system
Connection refused
I am on Mac and can echo the NEO4J_HOME variable, but no NEO4J_IMPORT. Should I set my own NEO4J_IMPORT environment variable when using cypher-shell to create a graph? Where to set the NEO4J_IMPORT environment variable, if it is a must?
NEO4J_IMPORT need not be in env.
Probably neo4j instance is down or running or running on non standard port. Try this one.
In neo4j home path and make sure file has sufficient permission.
cat query.cypher | bin/cypher-shell -u neo4j -p neo4j -a localhost:7687 --format plain
https://neo4j.com/docs/operations-manual/3.5/tools/cypher-shell/#cypher-shell-syntax
I fellow the instruction from official Akeneo Doc. I try to get API connection list.
php bin/console pim:oauth-server:list-clients --env=prod
Every time I run this command in terminal, it throws error.
Could not open input file: bin/console
I tried for both version 1.7 and 2.0. It's still same.
Do i need to open terminal in certain folder to run?
Akeneo Server is on docker.
First I find Id of my container (for me, it's Akeneo)
docker container ls
my Akeneo Id on docker is
"0de07xxxxxxx"
I exac my container my this command
docker exec -it "0de07xxxxxxx" bash
and I find my path folder by find command.
find / -name app
Now i can run php command to get api connection list.
and yeah i do need to open terminal in akeneo folder to run php command lines.
I'm trying to login to my AWS account with a docker loginstring from aws ecr get-login --region eu-west-1 -- however, when I do, I get this:
Warning: failed to get default registry endpoint from daemon (error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/info: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.). Using system default: https://index.docker.io/v1/
error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/auth: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running
The peculiar thing is this was just working last week. I'm using Cygwin on Windows 10. I've verified that Docker is running in services.msc -- I'm not entirely sure what to check now.
If you want to run docker commands in cygwin on Windows 10, then call the following command from cygwin:
docker-machine env --shell=bash
It will show the environment variables needed by docker:
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.xx.xx:2376"
export DOCKER_CERT_PATH="C:\Users\...\machines\default"
export DOCKER_MACHINE_NAME="default"
export COMPOSE_CONVERT_WINDOWS_PATHS="true"
# Run this command to configure your shell:
# eval $(docker-machine env --shell=bash)
Run the following command to set the environment variables:
eval $(docker-machine env --shell=bash)
It looks like you are trying to open a pipe to the service by passing a windows pipe path to cygwin. It gets interpreted as an http path by cygwin.
This is probably happening because the docker command finds the cygwin python before it finds the windows python. There are several solutions. The simplest is to switch back to a windows context to execute the docker command. If docker is actually docker.bat then start it with cmd.exe /c docker.bat otherwise cmd.exe /c docker.exe. You may also try cmd.exe /c start /w /i docker.bat. Or some variation.
You do not want to execute any docker command directly in cygwin as it will likely not know how to translate between windows paths and the linux paths it expects.