diff --git a/scripts/lib/check/9100_monitor_agent_omsagent_azure.check b/scripts/lib/check/9100_monitor_agent_omsagent_azure.check index 4afc60b..acde1d9 100644 --- a/scripts/lib/check/9100_monitor_agent_omsagent_azure.check +++ b/scripts/lib/check/9100_monitor_agent_omsagent_azure.check @@ -6,12 +6,10 @@ function check_9100_monitor_agent_omsagent_azure { local -i _retval=99 - # https://github.com/microsoft/OMS-Agent-for-Linux # https://learn.microsoft.com/en-us/azure/azure-monitor/agents/azure-monitor-agent-migration # MODIFICATION SECTION>> local -r sapnote='#2015553' - local -r _goodversion='1.19.0' # MODIFICATION SECTION<< #2015553 - SAP on Microsoft Azure: Support prerequisites @@ -32,33 +30,13 @@ function check_9100_monitor_agent_omsagent_azure { # CHECK if [[ ${_retval} -eq 99 ]]; then - local normalized_goodversion - local normalized_fullversion + logCheckError 'Azure Log Analytics (OMS) agent is known for stability and performance issues in HANA environments.' + logCheckError 'The legacy Log Analytics agent is deprecated as of August 31, 2024.' + logCheckError 'https://learn.microsoft.com/en-us/azure/azure-monitor/agents/log-analytics-agent' + logCheckError 'OMS is replaced by Azure Monitor Agent (AMA) - https://learn.microsoft.com/en-us/azure/azure-monitor/agents/agents-overview' - local _fullversion - _fullversion=$(rpm -q --queryformat "%{VERSION}.%{RELEASE}" omsagent) - - #normalize good version - LIB_FUNC_NORMALIZE_RPM "${_goodversion}" - normalized_goodversion="${LIB_FUNC_NORMALIZE_RPM_RETURN}" - - #normalize full version - LIB_FUNC_NORMALIZE_RPM "${_fullversion}" - normalized_fullversion="${LIB_FUNC_NORMALIZE_RPM_RETURN}" - - logCheckWarning 'Azure Log Analytics (OMS) agent is known for stability and performance issues in HANA environments.' - logCheckWarning 'OMS is replaced by Azure Monitor Agent (AMA) - https://learn.microsoft.com/en-us/azure/azure-monitor/agents/agents-overview' - - # returns 0 if equal, 1 if first is higher, 2 if second is higher - LIB_FUNC_COMPARE_VERSIONS "${normalized_fullversion}" "${normalized_goodversion}" - - if [[ $? -ne 2 ]]; then - logCheckWarning 'Azure Log Analytics (OMS) agent version seems to be at least the latest' "(SAP Note ${sapnote:-}) (is: ${_fullversion})" - _retval=1 - else - logCheckError 'Azure Log Analytics (OMS) agent must be updated or better migrated to AMA' "(SAP Note ${sapnote:-}) (is: ${_fullversion}, should be: >=${_goodversion})" - _retval=2 - fi + logCheckError 'Azure Log Analytics (OMS) agent must be migrated to AMA' "(SAP Note ${sapnote:-})" + _retval=2 fi diff --git a/scripts/tests/check/9100_monitor_agent_omsagent_azure_test.sh b/scripts/tests/check/9100_monitor_agent_omsagent_azure_test.sh deleted file mode 100644 index 5319ccc..0000000 --- a/scripts/tests/check/9100_monitor_agent_omsagent_azure_test.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env bash -set -u # treat unset variables as an error - -PROGRAM_DIR="$( cd "${BASH_SOURCE[0]%/*}" && pwd )" -readonly PROGRAM_DIR - -#mock PREREQUISITE functions -LIB_FUNC_IS_CLOUD_MICROSOFT() { return 0 ; } -LIB_FUNC_NORMALIZE_RPM() { : ; } - -LIB_FUNC_COMPARE_VERSIONS() { return "$compare_version_rc" ; } -rpm() { return "${rpm_rc}" ; } - -LIB_FUNC_NORMALIZE_RPM_RETURN='' #doesn't matter -declare -i compare_version_rc -declare -i rpm_rc - - -test_rpm_not_installed() { - - #arrange - rpm_rc=1 - - #act - check_9100_monitor_agent_omsagent_azure - - #assert - assertEquals "CheckSkipped? RC" '3' "$?" -} - -test_rpm_ok() { - - #arrange - rpm_rc=0 - compare_version_rc=1 - - #act - check_9100_monitor_agent_omsagent_azure - - #assert - assertEquals "CheckWarning? RC" '1' "$?" -} - -test_rpm_old() { - - #arrange - rpm_rc=0 - compare_version_rc=2 - - #act - check_9100_monitor_agent_omsagent_azure - - #assert - assertEquals "CheckError? RC" '2' "$?" -} - - -oneTimeSetUp() { - - #shellcheck source=../saphana-logger-stubs - source "${PROGRAM_DIR}/../saphana-logger-stubs" - - #shellcheck source=../../lib/check/9100_monitor_agent_omsagent_azure.check - source "${PROGRAM_DIR}/../../lib/check/9100_monitor_agent_omsagent_azure.check" - -} - -# oneTimeTearDown - -setUp() { - - rpm_rc= - compare_version_rc= - -} - -# tearDown - -#Import Libraries -# - order is important - sourcing shunit triggers testing -# - that's also the reason, why it could not be done during oneTimeSetup - -#Load and run shUnit2 -#shellcheck source=../shunit2 -source "${PROGRAM_DIR}/../shunit2"