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
805463ca
Commit
805463ca
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
ad doc page
parent
3ab9de15
Branches
Branches containing commit
No related tags found
1 merge request
!161
Add systemdunit
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/20_Checks/_index.md
+1
-0
1 addition, 0 deletions
docs/20_Checks/_index.md
docs/20_Checks/check_systemdunit.md
+69
-0
69 additions, 0 deletions
docs/20_Checks/check_systemdunit.md
with
70 additions
and
0 deletions
docs/20_Checks/_index.md
+
1
−
0
View file @
805463ca
...
@@ -49,6 +49,7 @@ There is one include script used by all checks:
...
@@ -49,6 +49,7 @@ There is one include script used by all checks:
*
check_ssl
*
check_ssl
*
check_ssl_certs
*
check_ssl_certs
*
check_systemdservices
*
check_systemdservices
*
[
check_systemdunit
](
check_systemdunit.md
)
*
check_timesync
*
check_timesync
*
check_uptime
*
check_uptime
*
hello
*
hello
This diff is collapsed.
Click to expand it.
docs/20_Checks/check_systemdunit.md
0 → 100644
+
69
−
0
View file @
805463ca
# Check Systemd unit
## Introduction
This check shows the status of a systemd unit.
A unit is everything listed by systemctl command - services, timers, targets, ...
## Requirements
*
`systemctl`
binary
## Syntax
```
txt
______________________________________________________________________
CHECK_SYSTEMDUNIT
v1.0
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_systemdunit.html
______________________________________________________________________
Check a unit using systemctl status.
The status is unknown if the command systemctl is not found.
The status is critical if the service does not exist or is not running.
SYNTAX:
check_systemdunit [-h] UNIT
OPTIONS:
-h this help
UNIT Name of a unit - see output of 'systemctl'
EXAMPLES:
check_systemdunit mysql.service
show status of service mysql
```
## Examples
``$ ./check_systemdunit nginx``
returns
```
txt
OK: ● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: disabled)
Active: active (running) since Tue 2023-09-05 08:04:45 CEST; 8h ago
Process: 577 ExecStart=/usr/bin/nginx -g pid /run/nginx.pid; error_log stderr; (code=exited, status=0/SUCCESS)
Main PID: 612 (nginx)
Tasks: 2 (limit: 18881)
Memory: 3.0M
CPU: 38ms
CGroup: /system.slice/nginx.service
├─612 "nginx: master process /usr/bin/nginx -g pid /run/nginx.pid; error_log stderr;"
└─613 "nginx: worker process"
...
```
If a service does not exist:
``./check_systemdunit justadummy``
returns
```
txt
CRITICAL: Unit justadummy.service could not be found.
```
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