Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-checks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
icinga-checks
Commits
373436cb
Commit
373436cb
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Plain Diff
Merge branch '6683-parametrize-snmp_printer_wrapper' into 'master'
update check_journallog See merge request
!186
parents
b25e185b
51fe96cd
Branches
Branches containing commit
No related tags found
1 merge request
!186
update check_journallog
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
check_journallog
+3
-3
3 additions, 3 deletions
check_journallog
docs/20_Checks/check_journallog.md
+5
-0
5 additions, 0 deletions
docs/20_Checks/check_journallog.md
with
8 additions
and
3 deletions
check_journallog
+
3
−
3
View file @
373436cb
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
docs/20_Checks/check_journallog.md
+
5
−
0
View file @
373436cb
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment