From e8db18db1b295c8eb382c4d75e95e05a9fe7208a Mon Sep 17 00:00:00 2001 From: Bill Buchan Date: Wed, 8 May 2024 14:26:42 +0100 Subject: [PATCH 1/2] Add New Metric Extensions for Alfresco Messaging --- .../collection/ME#24#ALFRESCO_QUEUE_LAG.xml | 9 +++++++ .../delius/alfresco_queue_lag/mea.xml | 6 +++++ .../metadata/ME#24#ALFRESCO_QUEUE_LAG.xml | 26 +++++++++++++++++++ .../scripts/alfresco_queue_lag.sh | 21 +++++++++++++++ .../collection/ME#24#FAILED_PDT_THREAD.xml} | 4 +-- .../delius/failed_pdt_thread/mea.xml | 6 +++++ .../metadata/ME#24#FAILED_PDT_THREAD.xml} | 14 +++++----- .../scripts/pdt_thread_status.sh} | 3 ++- .../delius/failed_prf_thread/mea.xml | 6 ----- 9 files changed, 79 insertions(+), 16 deletions(-) create mode 100644 ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/collection/ME#24#ALFRESCO_QUEUE_LAG.xml create mode 100644 ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/mea.xml create mode 100644 ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/metadata/ME#24#ALFRESCO_QUEUE_LAG.xml create mode 100644 ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/scripts/alfresco_queue_lag.sh rename ansible/roles/oracle-oms-setup/files/metric_extensions/delius/{failed_prf_thread/collection/ME#24#FAILED_PRF_THREAD.xml => failed_pdt_thread/collection/ME#24#FAILED_PDT_THREAD.xml} (64%) create mode 100644 ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/mea.xml rename ansible/roles/oracle-oms-setup/files/metric_extensions/delius/{failed_prf_thread/metadata/ME#24#FAILED_PRF_THREAD.xml => failed_pdt_thread/metadata/ME#24#FAILED_PDT_THREAD.xml} (64%) rename ansible/roles/oracle-oms-setup/files/metric_extensions/delius/{failed_prf_thread/scripts/prf_thread_status.sh => failed_pdt_thread/scripts/pdt_thread_status.sh} (72%) delete mode 100644 ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/mea.xml diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/collection/ME#24#ALFRESCO_QUEUE_LAG.xml b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/collection/ME#24#ALFRESCO_QUEUE_LAG.xml new file mode 100644 index 000000000..c17d19a53 --- /dev/null +++ b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/collection/ME#24#ALFRESCO_QUEUE_LAG.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/mea.xml b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/mea.xml new file mode 100644 index 000000000..4952d73de --- /dev/null +++ b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/mea.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/metadata/ME#24#ALFRESCO_QUEUE_LAG.xml b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/metadata/ME#24#ALFRESCO_QUEUE_LAG.xml new file mode 100644 index 000000000..df5a25d36 --- /dev/null +++ b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/metadata/ME#24#ALFRESCO_QUEUE_LAG.xml @@ -0,0 +1,26 @@ + + + +Maximum lag time in minutes that Alfresco messages have been queued. + + + + + +MINUTE +RATE + + + + + + +/bin/bash +%scriptsDir%/alfresco_queue_lag.sh +%scriptsDir% +| +NAME + + + + \ No newline at end of file diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/scripts/alfresco_queue_lag.sh b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/scripts/alfresco_queue_lag.sh new file mode 100644 index 000000000..c96cd861b --- /dev/null +++ b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/alfresco_queue_lag/scripts/alfresco_queue_lag.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Calculate the maximum number of minutes an alfresco +# message has been waiting to be processed. + +. ~/.bash_profile + +# Exit without failure if database is not up +srvctl status database -d $ORACLE_SID >/dev/null || exit 0 + +sqlplus -s / as sysdba < + - + diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/mea.xml b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/mea.xml new file mode 100644 index 000000000..22b9e937c --- /dev/null +++ b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/mea.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/metadata/ME#24#FAILED_PRF_THREAD.xml b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/metadata/ME#24#FAILED_PDT_THREAD.xml similarity index 64% rename from ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/metadata/ME#24#FAILED_PRF_THREAD.xml rename to ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/metadata/ME#24#FAILED_PDT_THREAD.xml index e6062f4b6..2decb2fcc 100644 --- a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/metadata/ME#24#FAILED_PRF_THREAD.xml +++ b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/metadata/ME#24#FAILED_PDT_THREAD.xml @@ -1,22 +1,22 @@ - + - -Detect failure of custom performance monitoring threads + +Detect failure of Parallel Data Threads - + - + - + @@ -24,7 +24,7 @@ /bin/bash -%scriptsDir%/prf_thread_status.sh +%scriptsDir%/pdt_thread_status.sh %scriptsDir% | NAME diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/scripts/prf_thread_status.sh b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/scripts/pdt_thread_status.sh similarity index 72% rename from ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/scripts/prf_thread_status.sh rename to ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/scripts/pdt_thread_status.sh index fb2d715a6..d466a6661 100644 --- a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/scripts/prf_thread_status.sh +++ b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/scripts/pdt_thread_status.sh @@ -15,7 +15,8 @@ SET HEAD OFF SET PAGES 0 SELECT component_id||'|'||thread_id||'|'||status FROM delius_app_schema.pdt_thread -WHERE component_id BETWEEN 500 AND 505 +WHERE component_id BETWEEN 500 AND 505 -- Performance Monitoring Threads +OR component_id BETWEEN 100 AND 107 -- Alfresco Message Queue Threads ORDER BY component_id, thread_id; EXIT EOSQL \ No newline at end of file diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/mea.xml b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/mea.xml deleted file mode 100644 index c3e9bb669..000000000 --- a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_prf_thread/mea.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 281093d22fcf8ad48ebfe95e28ca4cbe7a5f7aaf Mon Sep 17 00:00:00 2001 From: Bill Buchan Date: Tue, 14 May 2024 14:30:13 +0100 Subject: [PATCH 2/2] Fix naming in error message --- .../failed_pdt_thread/collection/ME#24#FAILED_PDT_THREAD.xml | 2 +- .../delius/failed_pdt_thread/scripts/pdt_thread_status.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/collection/ME#24#FAILED_PDT_THREAD.xml b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/collection/ME#24#FAILED_PDT_THREAD.xml index 136867725..9a6cd4a7b 100644 --- a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/collection/ME#24#FAILED_PDT_THREAD.xml +++ b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/collection/ME#24#FAILED_PDT_THREAD.xml @@ -3,7 +3,7 @@ - + \ No newline at end of file diff --git a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/scripts/pdt_thread_status.sh b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/scripts/pdt_thread_status.sh index d466a6661..634945e49 100644 --- a/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/scripts/pdt_thread_status.sh +++ b/ansible/roles/oracle-oms-setup/files/metric_extensions/delius/failed_pdt_thread/scripts/pdt_thread_status.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Get status code for PRF threads (2=failed) +# Get status code for PDT threads (2=failed) # . ~/.bash_profile @@ -15,7 +15,7 @@ SET HEAD OFF SET PAGES 0 SELECT component_id||'|'||thread_id||'|'||status FROM delius_app_schema.pdt_thread -WHERE component_id BETWEEN 500 AND 505 -- Performance Monitoring Threads +WHERE component_id BETWEEN 500 AND 505 -- Performance Monitoring Threads (PRF) OR component_id BETWEEN 100 AND 107 -- Alfresco Message Queue Threads ORDER BY component_id, thread_id; EXIT