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
91c7be7d
Commit
91c7be7d
authored
11 months ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
check requirements: use iml help and add link to docs
parent
f9bb0125
No related branches found
No related tags found
1 merge request
!270
Update docs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
check_requirements
+5
-12
5 additions, 12 deletions
check_requirements
docs/20_Checks/check_requirements.md
+89
-0
89 additions, 0 deletions
docs/20_Checks/check_requirements.md
with
94 additions
and
12 deletions
check_requirements
+
5
−
12
View file @
91c7be7d
...
...
@@ -11,13 +11,13 @@
#
# 2023-02-13 v1.0 ah initial version with check for processes, tcp/ udp
# 2023-02-15 v1.1 ah add label
# 2024-06-07 v1.2 ah use iml help and add link to docs
# ======================================================================
.
"
$(
dirname
$0
)
/inc_pluginfunctions"
self_APPNAME
=
$(
basename
$0
|
tr
[
:lower:]
[
:upper:]
)
self_APPVERSION
=
1.1
self_APPVERSION
=
1.2
self
=
$(
basename
$0
)
...
...
@@ -38,15 +38,8 @@ PROCESSES=
# show help
function
showHelp
(){
cat
<<
EOF
______________________________________________________________________
$self_APPNAME
v
$self_APPVERSION
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
______________________________________________________________________
cat
<<
EOH
$(
ph.showImlHelpHeader
)
Check if a list requirements regarding processes and network
connections do exist.
...
...
@@ -89,7 +82,7 @@ $self -p httpd -p mysqld -t 22 -t 80 -t 443 -t 3306
$self
-l "webservice" -p httpd -t 80 -t 443 -l "database" -p mysqld -t 3306
Use output with multiple sections
EO
F
EO
H
}
# show a label to divide the output in multiple sections
...
...
This diff is collapsed.
Click to expand it.
docs/20_Checks/check_requirements.md
0 → 100644
+
89
−
0
View file @
91c7be7d
# Check_requirements
## Introduction
**check_requirements**
is a plugin to run different check to show the ability to run an application. You can these checks
*
Check if a process exists
*
Check an open udp or tcp port (local or on given host/ ip)
You can insert a label to create multiple blocks.
## Requirements
*
`ps`
*
`top`
## Syntax
```
txt
______________________________________________________________________
CHECK_REQUIREMENTS
v1.2
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_requirements.html
______________________________________________________________________
Check if a list requirements regarding processes and network
connections do exist.
The check returns OK if all given requirements match.
SYNTAX:
check_requirements [-h] [-v] [PARAMETERS]
OPTIONS:
-h|--help show this help.
-v|--verbose show more data: processes and port numbers from
/etc/services; add it as first param
PARAMETERS:
-c|--connect TYPE TARGET PORT
check if connect to a server to a given port
is reachable
TYPE string one of tcp|udp
TARGET string target host
PORT int port number
-l|--label STRING add label to divide the output in multiple sections
-p|--process STRING check if a process with given regex exists in the
output of 'ps aux'
-t|--tcp PORT check if connect on local tcp port is reachable;
This is a shortcut for '-c tcp localhost PORT'
The parameters can be repeated multiple times. Checks will be executed in
the given order.
EXAMPLES
check_requirements -p httpd -p mysqld -t 22 -t 80 -t 443 -t 3306
Check if
- a process httpd and a process mysqld exist
- localhost listens to ports 22, 80, 443 and 3306
check_requirements -l "webservice" -p httpd -t 80 -t 443 -l "database" -p mysqld -t 3306
Use output with multiple sections
```
### Parameters
(none)
## Examples
Check a webservice as process and 2 ports:
``check_requirements -p nginx -t 443 -t 80``
```
txt
OK: 3 Requirement checks - errors: 0
STATUS TYPE RESULT
OK process nginx (2 x)
OK connection tcp to localhost on port 443
OK connection tcp to localhost on port 80
```
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