I am trying to setup monitoring for my PostgreSQL installation with zabbix ang pg_monz.
I've followed this standard installation guide(http://pg-monz.github.io/pg_monz/index-en.html#install). Everything seems working ok, besides PostgreSQL service running item, script that comes with pg_monz returns 0, however DB is running and other parameters are monitored.
What could be the issue here?
pgsql_simple.sh script #!/bin/bash
PGSHELL_CONFDIR="$1"
# Load the psql connection option parameters.
source $PGSHELL_CONFDIR/pgsql_funcs.conf
psql -t -A -h $PGHOST -p $PGPORT -U $PGROLE $DBNAME -c "select 1;" 2>/dev/null
if [ $? -ne 0 ]; then
echo 0
fi
zabbix userparameter:
UserParameter=psql.running[*],"$1"/pgsql_simple.sh "$2"