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
526ee9e9
Unverified
Commit
526ee9e9
authored
6 years ago
by
Pavel Vyskočil
Browse files
Options
Downloads
Patches
Plain Diff
Get warning time as param
parent
d27b4197
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+4
-2
4 additions, 2 deletions
README.md
proxy_idp_auth_test_active.sh
+10
-4
10 additions, 4 deletions
proxy_idp_auth_test_active.sh
with
14 additions
and
6 deletions
README.md
+
4
−
2
View file @
526ee9e9
...
...
@@ -56,7 +56,7 @@ Plugins are located in /usr/lib/check_mk/plugins/
## Nagios active scripts
Active scripts are located in Nagios machine
### proxy_idp_auth_test_
nagios
.sh
### proxy_idp_auth_test_
active
.sh
This script checks the login via active ProxyIdP machine
*
How to run this script:
...
...
@@ -65,9 +65,11 @@ This script checks the login via active ProxyIdP machine
*
2 - The url of login form of used IdP
*
3 - Login
*
4 - Password
*
5 - Roundtrip time (in seconds)
-
Default value = 10
*
Example:
<pre>
./proxy_idp_auth_test_active.sh "https://aai-playground.ics.muni.cz/simplesaml/nagios_check.php?proxy_idp=cesnet" "https://idp2.ics.muni.cz/idp/Authn/UserPassword" "login" "passwd"
./proxy_idp_auth_test_active.sh "https://aai-playground.ics.muni.cz/simplesaml/nagios_check.php?proxy_idp=cesnet" "https://idp2.ics.muni.cz/idp/Authn/UserPassword" "login" "passwd"
10
</pre>
### mariadb_replication_check.sh
...
...
This diff is collapsed.
Click to expand it.
proxy_idp_auth_test_active.sh
+
10
−
4
View file @
526ee9e9
...
...
@@ -18,7 +18,13 @@ login=$3
password
=
$4
# How long is normal for total roundtrip (seconds)
warningTime
=
10
# Default value is 10
if
[[
$#
-eq
5
]]
;
then
warningTime
=
$5
else
warningTime
=
10
fi
# End function
end
()
...
...
@@ -37,10 +43,10 @@ timeStat=$(echo "scale=4;$totalTime / 1000000000" | bc -l)
# If OK, but time > 5s s, set to WARNING
if
[[
$status
-eq
0
&&
$totalTime
-gt
$((
$warningTime
*
1000000000
))
]]
;
then
status
=
1
statustxt
=
"WARN - Successful login, but was too long."
statustxt
=
"WARN - Successful login, but was too long.
Login time:
${
timeStat
}
s. Warning time:
${
warningTime
}
s.
"
fi
echo
$statustxt
echo
"
$statustxt
Login time:
${
timeStat
}
s."
exit
$status
}
...
...
@@ -92,7 +98,7 @@ lastURL=$(echo ${html} | sed -e 's/.*LAST_URL:\(.*\)$/\1/')
if
[[
$lastURL
==
$testSite
]]
;
then
result
=
$(
echo
${
html
}
|
sed
-e
's/.*<body>\s*Result-\(.*\)<.*$/\1/'
)
if
[[
$result
==
"OK "
]]
;
then
end 0
"OK - Successful login"
end 0
"OK - Successful login
.
"
else
end 2
"CRIT - Bad result:
$result
."
fi
...
...
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