Skip to content
Snippets Groups Projects

check_systemdunit add -r REGEX

Merged Hahn Axel (hahn) requested to merge add-systemdunit into master
2 files
+ 55
8
Compare changes
  • Side-by-side
  • Inline

Files

+ 11
2
@@ -16,7 +16,7 @@ A unit is everything listed by systemctl command - services, timers, targets, ..
______________________________________________________________________
CHECK_SYSTEMDUNIT
v1.1
v1.2
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
@@ -30,13 +30,18 @@ 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|-l|-s] UNIT
check_systemdunit [-h|-l|-s|-r] UNIT
OPTIONS:
-h this help
-l list all units
-s list service units
-r handle UNIT as a regex and search for a single unit. A uniq regex
is needed to match a single unit. The initial idea was to match a
servie that has different service names on differen os eg.
- apache2 vs httpd
- mysld vs mariadb
UNIT Name of a unit - see output of 'systemctl'
@@ -49,6 +54,10 @@ EXAMPLES:
check_systemdunit nginx.service
show status of nginx webservice
check_systemdunit -r "(apache2|httpd)\.service"
Detect name of Apache httpd service by given regex and show status
of the found service name
```
## Examples
Loading