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

prevent broken pipe message in journallog

parent b8a713af
Branches
No related tags found
1 merge request!178prevent broken pipe message in journallog
......@@ -23,12 +23,13 @@
# 2022-08-29 v1.12 <axel.hahn@iml.unibe.ch> fix: replace pipe
# 2023-02-13 v1.13 <axel.hahn@iml.unibe.ch> small shell fixes
# 2023-07-27 v1.14 <axel.hahn@unibe.ch> update help page
# 2023-09-18 v1.15 <axel.hahn@unibe.ch> prevent broken pipe message in journallog
# ======================================================================
. $(dirname $0)/inc_pluginfunctions
export self_APPVERSION=1.14
export self_APPVERSION=1.15
# ----------------------------------------------------------------------
# functions
......@@ -169,7 +170,7 @@ if [ $iUsed -gt $iMinCpuUsageToShowProcesses ]; then
echo "$topout" | sed -n "${iStart},${iEnd}p" | tr '|' ':'
echo
echo "output of ps:"
ps aux | head -1; ps aux | sort -nrk 3,3 | head -n 5 | tr '|' ':'
ps aux | head -1; ps aux | sort -nrk 3,3 2>/dev/null | head -n 5 | tr '|' ':'
echo
fi
......
......@@ -20,12 +20,13 @@
# 2023-06-13 v0.6 <axel.hahn@unibe.ch> no output on activity; update replication check
# 2023-06-16 v0.7 <axel.hahn@unibe.ch> update help text
# 2023-08-30 v0.8 <axel.hahn@unibe.ch> reverse return code in ph.hasParamoption to unix like return codes: 0=true; <>0 = false
# 2023-09-18 v0.9 <axel.hahn@unibe.ch> prevent broken pipe message in journallog
# ======================================================================
. $(dirname $0)/inc_pluginfunctions
self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] )
self_APPVERSION=0.8
self_APPVERSION=0.9
# --- other vars...
cfgfile=/etc/icingaclient/.psql.conf
......@@ -359,7 +360,7 @@ case "${sMode}" in
# --- check: max_leg
# max_leg is the maximum value of write_lag,flush_lag,replay_lag
# value as sec + "." + millisec ... or empty
MaxLag=$( cut -f 7 -d '|' <<< "${data}" | sort | tail -1 | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }' )
MaxLag=$( cut -f 7 -d '|' <<< "${data}" | sort 2>/dev/null | tail -1 | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }' )
test -z "$MaxLag" && MaxLag="0"
ph.perfadd "max-lag" "${MaxLag}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment