Skip to content
Snippets Groups Projects
Commit 74250085 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

psql: add output

parent a39e1e9b
No related branches found
No related tags found
1 merge request!111psql: add output
...@@ -247,7 +247,7 @@ case "${sMode}" in ...@@ -247,7 +247,7 @@ case "${sMode}" in
"conflicts") "conflicts")
deltaunit=min deltaunit=min
descr="Detected conflicts (from pg_stat_database_conflicts)" descr="(from pg_stat_database_conflicts)"
renderCounters "select \ renderCounters "select \
sum(confl_tablespace) as confl_tablespace, \ sum(confl_tablespace) as confl_tablespace, \
sum(confl_lock) as confl_lock, \ sum(confl_lock) as confl_lock, \
...@@ -260,6 +260,9 @@ case "${sMode}" in ...@@ -260,6 +260,9 @@ case "${sMode}" in
typeset -i iTotal; iTotal=$( echo "$out" | awk '{ sum+=$7} END { print sum;}' ) typeset -i iTotal; iTotal=$( echo "$out" | awk '{ sum+=$7} END { print sum;}' )
if [ $iTotal -gt 0 ]; then if [ $iTotal -gt 0 ]; then
ph.setStatus "critical" ph.setStatus "critical"
descr+=" ... $iTotal conflicts detected"
else
descr+=" ... OK, nothing was found"
fi fi
descr+=" - currently $iTotal per ${deltaunit}" descr+=" - currently $iTotal per ${deltaunit}"
;; ;;
...@@ -298,6 +301,9 @@ case "${sMode}" in ...@@ -298,6 +301,9 @@ case "${sMode}" in
typeset -i iTotal; iTotal=$( echo "$out" | awk '{ sum+=$7} END { print sum;}' ) typeset -i iTotal; iTotal=$( echo "$out" | awk '{ sum+=$7} END { print sum;}' )
if [ $iTotal -gt 0 ]; then if [ $iTotal -gt 0 ]; then
ph.setStatus "critical" ph.setStatus "critical"
descr+="... $iTotal Problems and troublemakers were found"
else
descr+=" ... OK, nothing was found"
fi fi
descr+=" - currently $iTotal per ${deltaunit}" descr+=" - currently $iTotal per ${deltaunit}"
;; ;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment