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

add sudo

parent 446157e9
No related branches found
No related tags found
1 merge request!186update check_journallog
......@@ -5,6 +5,7 @@
#
# requirements:
# - journalctl
# - sudo permissions to journalctl to fetch all lines of all units
#
# ----------------------------------------------------------------------
# 2023-10-12 v0.1 <axel.hahn@unibe.ch> initial version
......@@ -89,7 +90,7 @@ if [ -z "$lastLine" ]; then
else
ts=$( cut -f 1-3 -d " " <<< "$lastLine" )
typeset -i iAge; iAge=$( ph.getFileAge "$tmpfile" )
data=$( journalctl --since "$ts" )
data=$( sudo journalctl --since "$ts" )
# for next run: insert last handled line
tail -1 <<< "$data" > "$tmpfile"
......@@ -119,7 +120,7 @@ else
test $iCriticalLimit -gt 0 || sLimits+="No critical level "
echo "Limits: $sLimits"
# echo "Found $iLines new line(s) in the last $iAge sec"
echo "Raw data: Found $iLines new line(s) in the last $iAge sec"
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment