Prerequisites
Prerequisites in Uptime & Downtime Report Configuration.
Prerequisites#
- Shell access to the HEAL primary node and to the database migration directory under the HEAL installation home (
a1home). - OpenSearch admin credentials, and the OpenSearch coordinator IP address and port.
- Grafana admin access for adding data sources and importing dashboards.
- The report packages
Uptime_sql_files.zipandDowntime_Report.tar.gz. These are delivered with the HEAL release package — contact HEAL Support (support@healsoftware.ai) if you do not have them. - Consul key-value entries for OpenSearch and the Percona database populated on the primary node (the downtime script reads its connection details from Consul — see the key list below).
Configure the Uptime Report#
The uptime report requires new KPI definitions in the HEAL database, followed by a manual KPI-to-instance mapping in the Control Center for existing instances.
Register the uptime KPIs#
-
Navigate to the migration directory:
a1home/Appsone_Service/migration-db/appsone -
Copy the SQL files from
Uptime_sql_files.zipinto theappsonedirectory.Note: Copy only the files that are missing from the directory.
-
Navigate to the migration root:
a1home/Appsone_Service/migration-db -
Execute the migrate command, substituting your database IP, port, and credentials:
env 'MIGRATION-DIR=./appsone' SUBNAME=//<db ip>:<port>/appsone username=<db username> password=<db password> java -jar migrate-db.jar --migrate -
Deploy the latest CA (Control Agent) build.
Map the KPIs in the Control Center#
Note: For existing instances, map the new KPIs to each instance manually in the Control Center so that data collection starts for them. Instances discovered after the migration pick the KPIs up automatically.
- Select the required Account and navigate to Setup > Monitoring > Services.
- Select the specific service.
- On the Manage Service page, click Metric Details (Host level).
- On the Edit Metric Details page, locate any KPI that shows No under Mapped to instance and click the KPI.
- Under Bulk actions, select Edit Details.
- Click the mapping toggle button to map the KPI to the instance, then click Save.
- Repeat for every uptime KPI listed below.
-
Restart the Redis microservice so the new mappings take effect:
nomad stop heal-redis-microservice nomad run heal-redis-microservice.nomad
Map all of the following KPIs:
- Uptime — supported on RHEL, CentOS, Solaris, AIX, HP-UX, and Windows.
- The following network KPIs, supported on RHEL only: Received Bytes, Received Errors, Received Dropped, Received Overruns, Transmitted Bytes, Transmitted Errors, Transmitted Dropped, Transmitted Overruns, and Transmitted Collisions.
Configure the Downtime Report#
The downtime report is driven by a wrapper script that reads uptime and maintenance data from OpenSearch and application metadata from the HEAL database. Before running it, add the uptime index template and its ISM retention policy to OpenSearch.
Add the OpenSearch index template#
On the OpenSearch node, register the uptime data collection template. Replace <username>, <password>, <OpenSearch IP>, and <port> with your actual values, and replace <template body> with the contents of the heal_uptime_data_collection_template.json file from the report package:
curl -ku <username>:<password> -XPUT "https://<OpenSearch IP>:<port>/_template/heal_uptime_data_collection_template" -H 'Content-Type: application/json' -d '<template body>'
Add the ISM policy for the uptime indexes#
Still on the OpenSearch node, register the ISM policy. Replace <policy body> with the contents of the ism_heal_uptime_indexes.json file from the report package:
curl -ku <username>:<password> -XPUT "https://<OpenSearch IP>:<port>/_plugins/_ism/policies/ism_heal_uptime_indexes" -H 'Content-Type: application/json' -d '{<policy body>}'
Set up the downtime report script#
- Access the primary node and copy
Downtime_Report.tar.gz(delivered with the HEAL release package) to it. -
Untar the file and open
config.sh. The file contains the following parameters:# Wrapper script sleep time before iterating through each app name, # below value is in seconds WRAPPER_SLEEP_INTERVAL=300 # Time diff threshold configure below TIME_THRESHOLD=1 #START_TIME="`date -d"yesterday" "+%Y-%m-%d 00:00:00"`" #END_TIME="`date -d"yesterday" "+%Y-%m-%d 23:59:59"`" # Account Name ACCOUNT_NAME="<account name>" APP_NAMES="<application name>" ## Provide Opensearch/Elastic Search URL ## Ex: OPENSEARCH_URL="http://192.0.2.8:9211" OPENSEARCH_IP=$(consul kv get service/opensearch/node1/ip) OPENSEARCH_PORT=$(consul kv get service/opensearch/port/cordinator/http) OPENSEARCH_URL="https://${OPENSEARCH_IP}:${OPENSEARCH_PORT}" ## Provide credentials. Leave blank if not applicable OPENSEARCH_USER=$(consul kv get service/opensearch/username) OPENSEARCH_PASS=$(consul kv get service/opensearch/password/encrypted | base64 -d) # Mysql details DB_IP=$(consul kv get service/perconadb/ip) DB_USER=$(consul kv get service/perconadb/username) DB_PORT=$(consul kv get service/perconadb/port) MYSQL_PWD=$(consul kv get service/perconadb/password_ui | base64 -d) export MYSQL_PWD # This field determines whether instanceIdentifier or instanceName is # used to query the heal_maintenence_data index. # If instanceIdentifier's value is the instance name, set NAME below. # If instanceIdentifier's value is the instance identifier itself, set ID below. MAINT_INDEX_ID_VALUE_FLAG="ID" # FILE_CLEANUP_DETAILS CLEANUP_DAYS=5ACCOUNT_NAMEandMAINT_INDEX_ID_VALUE_FLAGare mandatory fields:ACCOUNT_NAME— the HEAL account name to report on.MAINT_INDEX_ID_VALUE_FLAG— determines whether the script queries theheal_maintenance_dataindex byinstanceIdentifieror byinstanceName. At the time the script was written, some deployments stored the instance name in theinstanceIdentifierfield. If theinstanceIdentifiervalues in your index hold instance names, setNAME; if they hold the instance identifier itself, setID.APP_NAMES(optional) — if multiple application names are provided, the script executes the downtime report for each one in turn. If left blank, the script fetches all applications for the account from the database and runs the report for all of them.- To run the report on demand for a specific window, execute the wrapper script with
START_TIMEandEND_TIMEarguments:
./downtime_wrapper.sh START_TIME=<"YYYY-MM-DD HH:MM:SS"> END_TIME=<"YYYY-MM-DD HH:MM:SS">For example:
./downtime_wrapper.sh START_TIME="1970-01-01 00:00:00" END_TIME="1970-01-01 23:59:59"Note: The maximum time range for a single run is 7 days.
When the wrapper script executes, it resolves its connections from the following required Consul key-value pairs:
service/opensearch/node1/ipservice/opensearch/port/cordinator/httpservice/opensearch/usernameservice/opensearch/password/encrypted(base64-decoded by the script)service/perconadb/ipservice/perconadb/usernameservice/perconadb/portservice/perconadb/password_ui(base64-decoded by the script)
Schedule the report as a daily cron job#
To collect downtime data continuously every day, run the same wrapper script from cron with the time window derived automatically.
-
In
config.sh, uncomment theSTART_TIMEandEND_TIMElines so each run covers the previous day:START_TIME="`date -d"yesterday" "+%Y-%m-%d 00:00:00"`" END_TIME="`date -d"yesterday" "+%Y-%m-%d 23:59:59"`" -
Open the crontab for editing:
crontab -e -
Add the following line to run the report daily at 04:00:
0 4 * * * cd <path of downtime report> && ./downtime_wrapper.shNote: The schedule can be adjusted as per your requirements.