Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions nagios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ This script checks the database replication

* How to run this script:
* Params:
* 1 - Login used for connection to the database
* 2 - Password used for connection to the database (the password has to be in quotes)
* 3 - List of addresses separated by space (the list has to be in quotes)
* 1 - Path to the configuration
* Requirements:
* Configuration file - Example configuration file: `mariadb_replication_check_config.sh`
* Example:
<pre>
./mariadb_replication_check.sh "USER" "PASSWORD" "Address1 Address2 Address3"
./mariadb_replication_check.sh "mariadb_check_config.sh"
</pre>
20 changes: 16 additions & 4 deletions nagios/mariadb_replication_check.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
#!/bin/bash

USER=$1
PASSWD=$2
# List of addresses separated by space
machines=$3
FILENAME=$1

if [ "$#" -ne 1 ]; then
echo "You must enter exactly 1 command line arguments!"
echo "The first param must be the file with the configuration!"
exit 127
fi

if [[ ! -f ${FILENAME} ]]; then
echo "File ${FILENAME} doesn't exist."
echo "The first param must be the file with the configuration!"
exit 127
fi

source "${FILENAME}"

count=0

for i in ${machines}; do
Expand Down
10 changes: 10 additions & 0 deletions nagios/mariadb_replication_check_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# User
USER=""

# Password
PASSWD=""

# List of addresses separated by space
machines=""
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline

6 changes: 4 additions & 2 deletions nagios/proxy_idp_auth_test_oidc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ if [ ${CESNET_RC} -eq 0 ]; then
STATUS=0
STATUS_TXT="Successful login!"
fi
RESULT="${STATUS} ${BASENAME}-${INSTANCE_NAME} aai_login_time=${AAI_LOGIN_TIME}|muni_login_time=${MUNI_LOGIN_TIME}|cesnet_login_time=${CESNET_LOGIN_TIME} ${STATUS_TXT} [AAI STATUS - ${AAI_RESULT}(${AAI_LOGIN_TIME}s);MUNI STATUS - ${MUNI_RESULT}(${MUNI_LOGIN_TIME}s); CESNET STATUS - ${CESNET_RESULT}(${CESNET_LOGIN_TIME}s)]"
else
RESULT="${STATUS} ${BASENAME}-${INSTANCE_NAME} aai_login_time=${AAI_LOGIN_TIME}|muni_login_time=${MUNI_LOGIN_TIME}|cesnet_login_time=${CESNET_LOGIN_TIME} ${STATUS_TXT} [AAI STATUS - ${AAI_RESULT}(${AAI_LOGIN_TIME}s);MUNI STATUS - ${MUNI_RESULT}(${MUNI_LOGIN_TIME}s); CESNET STATUS - ${CESNET_RESULT}(${CESNET_LOGIN_TIME}s)]"
STATUS=2
STATUS_TXT="ERROR!"
fi

RESULT="${STATUS} ${BASENAME}-${INSTANCE_NAME} aai_login_time=${AAI_LOGIN_TIME}|muni_login_time=${MUNI_LOGIN_TIME}|cesnet_login_time=${CESNET_LOGIN_TIME} ${STATUS_TXT} [AAI STATUS - ${AAI_RESULT}(${AAI_LOGIN_TIME}s);MUNI STATUS - ${MUNI_RESULT}(${MUNI_LOGIN_TIME}s); CESNET STATUS - ${CESNET_RESULT}(${CESNET_LOGIN_TIME}s)]"

echo ${RESULT}
echo ${RESULT} > ${DIR}/proxy_idp_auth_test_oidc.cache
exit 0
6 changes: 4 additions & 2 deletions nagios/proxy_idp_auth_test_saml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ if [ ${CESNET_RC} -eq 0 ]; then
STATUS=0
STATUS_TXT="Successful login!"
fi
RESULT="${STATUS} ${BASENAME}-${INSTANCE_NAME} aai_login_time=${AAI_LOGIN_TIME}|muni_login_time=${MUNI_LOGIN_TIME}|cesnet_login_time=${CESNET_LOGIN_TIME} ${STATUS_TXT} [AAI STATUS - ${AAI_RESULT}(${AAI_LOGIN_TIME}s);MUNI STATUS - ${MUNI_RESULT}(${MUNI_LOGIN_TIME}s); CESNET STATUS - ${CESNET_RESULT}(${CESNET_LOGIN_TIME}s)]"
else
RESULT="${STATUS} ${BASENAME}-${INSTANCE_NAME} aai_login_time=${AAI_LOGIN_TIME}|muni_login_time=${MUNI_LOGIN_TIME}|cesnet_login_time=${CESNET_LOGIN_TIME} ${STATUS_TXT} [AAI STATUS - ${AAI_RESULT}(${AAI_LOGIN_TIME}s);MUNI STATUS - ${MUNI_RESULT}(${MUNI_LOGIN_TIME}s); CESNET STATUS - ${CESNET_RESULT}(${CESNET_LOGIN_TIME}s)]"
STATUS=2
STATUS_TXT="ERROR!"
fi

RESULT="${STATUS} ${BASENAME}-${INSTANCE_NAME} aai_login_time=${AAI_LOGIN_TIME}|muni_login_time=${MUNI_LOGIN_TIME}|cesnet_login_time=${CESNET_LOGIN_TIME} ${STATUS_TXT} [AAI STATUS - ${AAI_RESULT}(${AAI_LOGIN_TIME}s);MUNI STATUS - ${MUNI_RESULT}(${MUNI_LOGIN_TIME}s); CESNET STATUS - ${CESNET_RESULT}(${CESNET_LOGIN_TIME}s)]"

echo ${RESULT}
echo ${RESULT} > ${DIR}/proxy_idp_auth_test_saml.cache
exit 0
1 change: 0 additions & 1 deletion nagios/proxy_idp_auth_test_script/oidc_auth_test_aai.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ BASENAME=$(basename $0)

## Get host IP
IP=($(hostname -I))
IP="78.128.216.77"


TEST_SITE=$1
Expand Down
1 change: 0 additions & 1 deletion nagios/proxy_idp_auth_test_script/saml_auth_test_aai.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ BASENAME=$(basename $0)

## Get host IP
IP=($(hostname -I))
IP="78.128.216.77"

TEST_SITE=$1
LOGIN_SITE=$2
Expand Down