Skip to content
Snippets Groups Projects
Unverified Commit 526ee9e9 authored by Pavel Vyskočil's avatar Pavel Vyskočil
Browse files

Get warning time as param

parent d27b4197
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment