diff options
author | mboelen <michael@cisofy.com> | 2015-11-22 21:35:34 +0300 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2015-11-22 21:35:34 +0300 |
commit | c3054de0feeac83470e17c6b0d7f843ba34f602b (patch) | |
tree | bc9cea91989d566b0f1b975b659cee3872811e9a /include/data_upload | |
parent | 391f67e7c24552c484fda79bc8a0ac69be906e5c (diff) |
Added details to logging if upload fails
Diffstat (limited to 'include/data_upload')
-rw-r--r-- | include/data_upload | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/data_upload b/include/data_upload index 844e04d5..e33b79f5 100644 --- a/include/data_upload +++ b/include/data_upload @@ -93,14 +93,18 @@ output "Settings file: ${SETTINGS_FILE}" UPLOAD=`${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "collector_version=${PROGRAM_VERSION}" ${LICENSE_SERVER_URL} 2> /dev/null` EXITCODE=$? if [ ${EXITCODE} -gt 0 ]; then - if [ ${EXITCODE} -eq 60 ]; then + if [ ${EXITCODE} -eq 7 ]; then + logtext "Result: could not contact license server." + logtext "Details: used URL ${LICENSE_SERVER_URL}" + logtext "Suggestion: check if the upload host is correctly configured." + elif [ ${EXITCODE} -eq 60 ]; then echo "${RED}Self-signed certificate used on Lynis Enterprise node${NORMAL}" echo "If you want to accept a self-signed certificate, use the -k option in the profile." echo "Example: ${WHITE}config:upload_options:-k:${NORMAL}" logtext "Result: found self-signed certificate, however cURL -k option not used." else - echo "${RED}Upload Error: ${NORMAL}cURL exited with code ${EXITCODE}" - logtext "Result: cURL exited with code ${EXITCODE}" + echo "${RED}Upload Error: ${NORMAL}cURL exited with code ${EXITCODE}. See ${LOGFILE} for details." + logtext "Result: cURL exited with code ${EXITCODE}." fi logtext "Result: quitting, can't check license" ExitFatal |