diff --git a/ansible/group_vars/server_type_oasys_web.yml b/ansible/group_vars/server_type_oasys_web.yml index 5e9be3207..120bbe200 100644 --- a/ansible/group_vars/server_type_oasys_web.yml +++ b/ansible/group_vars/server_type_oasys_web.yml @@ -55,3 +55,8 @@ collectd_monitored_services_servertype: - metric_name: service_status_app metric_dimension: tomcat-healthcheck shell_cmd: "service tomcat status" + - metric_name: service_status_app + metric_dimension: maintenance-msg + shell_cmd: "[ $( date -r /u01/app/apache/tomcat/latest/webapps/ROOT/maintenance_message.html '+%Y%m%d%H%M' ) -gt $(date -d '1 hour ago' +'%Y%m%d%H%M') ]" + +collectd_script_user: oracle diff --git a/ansible/roles/oasys-ords/defaults/main.yml b/ansible/roles/oasys-ords/defaults/main.yml index 3520481c1..1e83b166c 100644 --- a/ansible/roles/oasys-ords/defaults/main.yml +++ b/ansible/roles/oasys-ords/defaults/main.yml @@ -11,7 +11,6 @@ oasys_ords_extra_files: - "index_message.html" - "index_no_message.html" oasys_ords_s3_bucket: "hmpps/oasys-ords" -oasys_maintenance_msg: "" ords_db_port: 1521 ords_db_sid: "{{ ec2.tags['oracle-db-sid'] }}" oasys_ords_dir: "/u02/stage/ORDS/ords_stage" diff --git a/ansible/roles/oasys-ords/tasks/files.yml b/ansible/roles/oasys-ords/tasks/files.yml index 5339d9d75..bd27071ec 100644 --- a/ansible/roles/oasys-ords/tasks/files.yml +++ b/ansible/roles/oasys-ords/tasks/files.yml @@ -76,6 +76,6 @@ - name: update maintenance message ansible.builtin.cron: name: "maintenance_message" - minute: "*/2" # every 10 mins + minute: "*/10" # every 10 mins user: root job: "su oracle -c '{{ oasys_ords_get_maintenance_msg_command }} > {{ oasys_ords_maintenance_message_file }}'"