Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
perun-proxy-utils
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
Perun
Perun ProxyIdP
perun-proxy-utils
Commits
159b00b5
Commit
159b00b5
authored
2 years ago
by
Johana Supíková
Browse files
Options
Downloads
Patches
Plain Diff
feat: script calling non-python monitoring scripts
parent
c47c8e9f
No related branches found
No related tags found
1 merge request
!30
feat: script calling non-python monitoring scripts
Pipeline
#278228
passed
2 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
perun/proxy/utils/nagios/check_custom_command.py
+36
-0
36 additions, 0 deletions
perun/proxy/utils/nagios/check_custom_command.py
with
36 additions
and
0 deletions
perun/proxy/utils/nagios/check_custom_command.py
0 → 100644
+
36
−
0
View file @
159b00b5
#!/usr/bin/env python3
import
argparse
import
subprocess
import
sys
"""
general script to run non-python checks by a custom-defined command
"""
def
get_args
():
"""
Supports the command-line arguments listed below.
"""
parser
=
argparse
.
ArgumentParser
(
description
=
"
Custom command to run
"
)
parser
.
add_argument
(
"
-c
"
,
"
--command
"
,
required
=
True
,
help
=
"
whole command to be executed
"
,
)
return
parser
.
parse_args
()
def
main
():
args
=
get_args
()
result
=
subprocess
.
run
(
args
.
command
,
shell
=
True
,
text
=
True
,
capture_output
=
True
)
print
(
result
.
stdout
,
end
=
""
)
return
result
.
returncode
if
__name__
==
"
__main__
"
:
sys
.
exit
(
main
())
This diff is collapsed.
Click to expand it.
Jednotné přihlášení test
@9008807
mentioned in commit
d8f3b8cc
·
2 years ago
mentioned in commit
d8f3b8cc
mentioned in commit d8f3b8ccae572112042319b5892eb3893fcf2112
Toggle commit list
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