From: Roland Haeder Date: Thu, 14 Apr 2016 19:49:43 +0000 (+0200) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ab58b23da8697403b16838a5544ec1d01c86b490;p=pizzaservice-war.git Continued a bit: - user list is now "basicly finished" - added monitoring script for cron-job based monitoring --- diff --git a/monitor/.monitor-cron.sh b/monitor/.monitor-cron.sh new file mode 100644 index 00000000..fb44abae --- /dev/null +++ b/monitor/.monitor-cron.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# URL based on project name may sometimes fail, so you have to set it "statically" here: +PROJECT_URL="http://glassfish-base-url.invalid/${PROJECT_NAME}/" +PROJECT_USER="user" +PROJECT_PASSWORD="password" diff --git a/monitor/README.txt b/monitor/README.txt new file mode 100644 index 00000000..6527106e --- /dev/null +++ b/monitor/README.txt @@ -0,0 +1,24 @@ +How to use this monitoring scripts: +----------------------------------- + +1) Copy .monitor-config.sh to ${HOME}/.monitor-pizzaservice-war-cron.sh + Please note that your clone path must be 'pizzaservice-war' then. + +2) Execute "crontab -e" as same user + +3) Add line such as: + +PATH="/bla/foo/bin:/bar/bin" +SHELL="/bin/bash" + +*/10 * * * * cd ${HOME}/checkouts/pizzaservice-war/monitor/ && ./monitor-cron.sh + +Please make sure PATH and SHELL are set (maybe prevents some problems). + +4) Save the file and let it install it. + +5) You are done. + +Now every 10 minutes the connection to your glassfish is tested by a HEAD +request. Please don't set it to high as this may cause huge load on your server +even when it is only a HEAD request. diff --git a/monitor/monitor-cron.sh b/monitor/monitor-cron.sh new file mode 100755 index 00000000..8596595b --- /dev/null +++ b/monitor/monitor-cron.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Find project name +PROJECT_NAME="${PWD%/*}" +PROJECT_NAME="${PROJECT_NAME##*/}" + +# FQFN for temporary file +MONITOR_TEMP_FILE="/tmp/${PROJECT_NAME}.down" + +# Construct FQFN for configuration file +CONFIG_FILE="${HOME}/.monitor-${PROJECT_NAME}-cron.sh" + +. "${CONFIG_FILE}" || exit 255 + +MONITOR_OUTPUT=`lynx -dump -head "${PROJECT_URL}" -auth="${PROJECT_USER}:${PROJECT_PASSWORD}" | head -n 1` + +if [ "${MONITOR_OUTPUT}" != "HTTP/1.1 200 OK" ] +then + if [ ! -f "${MONITOR_TEMP_FILE}" ] + then + echo "$0: ${PROJECT_NAME} is DOWN, status: '${MONITOR_OUTPUT}'" + echo "${MONITOR_OUTPUT}" > ${MONITOR_TEMP_FILE} + exit 1 + fi +elif [ -f "${MONITOR_TEMP_FILE}" ] +then + PREVIOUS_STATUS=`cat "${MONITOR_TEMP_FILE}"` + echo "$0: ${PROJECT_NAME} is UP again, old status was: '${PREVIOUS_STATUS}'" + rm -f "${MONITOR_TEMP_FILE}" +fi + +# All fine +exit 0 diff --git a/nbproject/faces-config.NavData b/nbproject/faces-config.NavData index 0298ca52..30f79d5a 100644 --- a/nbproject/faces-config.NavData +++ b/nbproject/faces-config.NavData @@ -11,17 +11,16 @@ - - + + + - - - + @@ -29,11 +28,11 @@ - + - + diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 76447c2b..cd4bcc9e 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -381,3 +381,20 @@ ADMIN_LIST_MOBILE_PRROVIDER_ENTRY_CREATED=Erstellt: ADMIN_LINK_EDIT_DELETE_MOBILE_PROVIDER_TITLE=Aendern oder loeschen des Handyanbieters ADMIN_ADD_USER_ENTER_PASSWORD1=Passwort eingeben: ADMIN_ADD_USER_ENTER_PASSWORD2=Passwort wiederholen: +ADMIN_LIST_USER_ID=Benutzer-Id: +ADMIN_LIST_USER_NAME=Benutzername: +ADMIN_LIST_USER_GENDER=Anrede: +ADMIN_LIST_USER_FIRST_NAME=Vorname: +ADMIN_LIST_USER_FAMILY_NAME=Nachname: +ADMIN_LIST_USER_ACCOUNT_STATUS=Account-Status: +ADMIN_LIST_USER_PROFILE_MODE=Profilsichtbarkeit: +ADMIN_LIST_USER_CREATED=Angemeldet seit: +#@TODO Please fix German umlauts! +USER_ACCOUNT_STATUS_CONFIRMED=Bestaetigt +#@TODO Please fix German umlauts! +USER_ACCOUNT_STATUS_UNCONFIRMED=Unbestaetigt +USER_ACCOUNT_STATUS_LOCKED=Gesperrt +USER_PROFILE_MODE_INVISIBLE=Durchsichtig +USER_PROFILE_MODE_MEMBERS=Nur Mitglieder +#@TODO Please fix German umlauts! +USER_PROFILE_MODE_PUBLIC=Oeffentlich diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 8d7ff002..56e1c8bf 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -327,3 +327,17 @@ ADMIN_LIST_MOBILE_PRROVIDER_ENTRY_CREATED=Created: ADMIN_LINK_EDIT_DELETE_MOBILE_PROVIDER_TITLE=Edit or delete mobile provider ADMIN_ADD_USER_ENTER_PASSWORD1=Enter password: ADMIN_ADD_USER_ENTER_PASSWORD2=Repeat password: +ADMIN_LIST_USER_ID=User id: +ADMIN_LIST_USER_NAME=User name: +ADMIN_LIST_USER_GENDER=Gender: +ADMIN_LIST_USER_FIRST_NAME=First name: +ADMIN_LIST_USER_FAMILY_NAME=Family name: +ADMIN_LIST_USER_ACCOUNT_STATUS=Account status: +ADMIN_LIST_USER_PROFILE_MODE=Profile visibility: +ADMIN_LIST_USER_CREATED=Registered: +USER_ACCOUNT_STATUS_CONFIRMED=Confirmed +USER_ACCOUNT_STATUS_UNCONFIRMED=Unconfirmed +USER_ACCOUNT_STATUS_LOCKED=Locked +USER_PROFILE_MODE_INVISIBLE=Invisible +USER_PROFILE_MODE_MEMBERS=Only members +USER_PROFILE_MODE_PUBLIC=Public diff --git a/web/admin/admin_user_list.xhtml b/web/admin/admin_user_list.xhtml index b8b0e353..e8bc9179 100644 --- a/web/admin/admin_user_list.xhtml +++ b/web/admin/admin_user_list.xhtml @@ -14,7 +14,58 @@ - + + + #{msg.ADMIN_LIST_USER_ID} + + + + + + + + #{msg.ADMIN_LIST_USER_NAME} + + + + + + #{msg.ADMIN_LIST_USER_GENDER} + + + + + + #{msg.ADMIN_LIST_USER_FIRST_NAME} + + + + + + #{msg.ADMIN_LIST_USER_FAMILY_NAME} + + + + + + #{msg.ADMIN_LIST_USER_ACCOUNT_STATUS} + + + + + + #{msg.ADMIN_LIST_USER_PROFILE_MODE} + + + + + + #{msg.ADMIN_LIST_USER_CREATED} + + + + +
diff --git a/web/resources/css/cssLayout.css b/web/resources/css/cssLayout.css index dbc9c59d..bf62f151 100644 --- a/web/resources/css/cssLayout.css +++ b/web/resources/css/cssLayout.css @@ -201,3 +201,15 @@ ul.footer_nav li.footer_copyright { .okay { color: #00aa00; } + +.user_status_confirmed { + color: #00aa00; +} + +.user_status_unconfirmed { + color: #00aaaa; +} + +.user_status_unconfirmed { + color: #aa0000; +}