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

Merge branch '6683-parametrize-snmp_printer_wrapper' into 'master'

update check_journallog

See merge request !186
parents b25e185b 51fe96cd
Branches
No related tags found
1 merge request!186update check_journallog
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
# #
# requirements: # requirements:
# - journalctl # - journalctl
# - sudo permissions to journalctl to fetch all lines of all units
# #
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# 2023-10-12 v0.1 <axel.hahn@unibe.ch> initial version # 2023-10-12 v0.1 <axel.hahn@unibe.ch> initial version
# ====================================================================== # ======================================================================
. $( dirname $0 )/inc_pluginfunctions . $( dirname $0 )/inc_pluginfunctions
export self_APPVERSION=0.1 export self_APPVERSION=0.1
...@@ -89,7 +89,7 @@ if [ -z "$lastLine" ]; then ...@@ -89,7 +89,7 @@ if [ -z "$lastLine" ]; then
else else
ts=$( cut -f 1-3 -d " " <<< "$lastLine" ) ts=$( cut -f 1-3 -d " " <<< "$lastLine" )
typeset -i iAge; iAge=$( ph.getFileAge "$tmpfile" ) typeset -i iAge; iAge=$( ph.getFileAge "$tmpfile" )
data=$( journalctl --since "$ts" ) data=$( sudo journalctl --since "$ts" )
# for next run: insert last handled line # for next run: insert last handled line
tail -1 <<< "$data" > "$tmpfile" tail -1 <<< "$data" > "$tmpfile"
...@@ -119,7 +119,7 @@ else ...@@ -119,7 +119,7 @@ else
test $iCriticalLimit -gt 0 || sLimits+="No critical level " test $iCriticalLimit -gt 0 || sLimits+="No critical level "
echo "Limits: $sLimits" 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 fi
......
...@@ -8,6 +8,11 @@ This check requires access to journalctl. ...@@ -8,6 +8,11 @@ This check requires access to journalctl.
## Requirements ## Requirements
* `journalctl` binary * `journalctl` binary
* sudo permissions to `journalctl`
```txt
icingaclient ALL=(ALL) NOPASSWD: /bin/journalctl
```
## Syntax ## Syntax
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment