2.2 ahffi

Use the ahffi command to manage AHF Fleet Insights.

A binary with the name ahffi will be available in the install location once Fleet Insights installation is successful.

Syntax

ahffi [OPTIONS]
Option Description

-h, --help

Prints this help message and exits.

version

Prints application version info.

start

Starts all Fleet Insight processes.

stop

Stops all Fleet Insight processes.

restart

Restarts all Fleet Insight processes.

status

Gets the running status of Fleet Insight processes.

info

Prints the app URL and command used to register clients.

diagnose

Runs ahffi diagnostics.

create-generic-user <username>

Creates generic registration user.

uninstall [-q] [-c] [-b]

Uninstalls Fleet Insights application.
  • -q: Uninstall the application in [q]uiet mode (no prompts, default options are to keep backup)
  • -c: [c]leanup all AHF Fleet Insights related files and database entries in quite mode
  • -b: keep a [b]ackup in the database
Upon successful run, the uninstaller:
  • Uninstalls the application.
  • Deletes the metadata file ~/.ahffi that contains the install location info.

update-password {db_user|registration_user}

Updates password for the specified user.

updateproperty -k <key> -v <value>

Updates a single application property.

updateproperty -p <propery file>

Updates application properties as read from a specified text file.

importcert -cert <cert file> -key <key file>

Use this command option to import your own SSL certificates for running the application instead of using the default certificates.

Upon successful run:
  • Imported certificate is copied to the ahf_install_loc/ahf_service/certs/ directory.
  • If the certificate already exists, the existing certificate is backed up with .default extension.
  • The ahf_install_loc/ahf_service/third_party/nginx/conf/ahfs_nginx_with_ssl.conf file must have correct configuration for certificates.
  • Application is automatically restarted.

Example 2-4 ahffi restart

./ahffi restart
2023-06-26 17:54:11 UTC: [testnode] [180200] [MANAGE_APP] [INFO] The specified component flag: restart is not valid, using the default value 'all'
2023-06-26 17:54:11 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Component chosen as all
2023-06-26 17:54:11 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Action chosen as restart
None of the queried jobs are present in crontab
2023-06-26 17:54:12 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Successfully removed job(s) for all from crontab
2023-06-26 17:54:17 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Killed the existing Fleet Insights processes
2023-06-26 17:54:20 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Killed the existing collection processing engine processes
2023-06-26 17:54:21 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Killed the existing ahf_service processes for componet(s): all.
2023-06-26 17:54:21 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Starting Fleet Insights
2023-06-26 17:54:22 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Started Fleet Insights successfully
2023-06-26 17:54:22 UTC: [testnode] [180200] [MANAGE_APP] [INFO] The path to manage_app.log is /scratch/ahfs_local/install_test/ahf_service/log/manage_app.log
2023-06-26 17:54:23 UTC: [testnode] [180200] [MANAGE_APP] [INFO] The path to nginx access.log is /scratch/ahfs_local/install_test/ahf_service/third_party/nginx/logs/access.log
2023-06-26 17:54:23 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Starting the collection processing engine
2023-06-26 17:54:24 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Collection processing engine is running
2023-06-26 17:54:24 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Started the collection processing engine successfully
All jobs are present in crontab
2023-06-26 17:54:25 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Successfully added job(s) for all from crontab
2023-06-26 17:54:25 UTC: [testnode] [180200] [MANAGE_APP] [INFO] Started the ahf_service processes for componet(s): all.

Example 2-5 ahffi status

./ahffi status
2023-06-26 18:11:13 UTC: [testnode] [313565] [MANAGE_APP] [INFO] The specified component flag: status is not valid, using the default value 'all'
2023-06-26 18:11:13 UTC: [testnode] [313565] [MANAGE_APP] [INFO] Component chosen as all
2023-06-26 18:11:13 UTC: [testnode] [313565] [MANAGE_APP] [INFO] Action chosen as status
2023-06-26 18:11:14 UTC: [testnode] [313565] [MANAGE_APP] [INFO] Fleet Insights is running
2023-06-26 18:11:14 UTC: [testnode] [313565] [MANAGE_APP] [INFO] Collection processing engine is running
2023-06-26 18:11:14 UTC: [testnode] [313565] [MANAGE_APP] [INFO] Container Manager isn't enabled in this install
2023-06-26 18:11:14 UTC: [testnode] [313565] [] [INFO] All AHF Service processes for componet(s): all are running.

Example 2-6 ahffi info

./ahffi info
Application URL : https://demo.oracle.system.com:5000/ahfservice
Registration command : ahf configuration set --type fleet-insights --user-name <registration_user> --url https://demo.oracle.system.com:5000

Example 2-7 ahffi diagnose

./ahffi diagnose
Running diagnose tool
  adding: testnode.06-26-2023-18-25-33-UTC.ahffi_logs/ (stored 0%)
  adding: testnode.06-26-2023-18-25-33-UTC.ahffi_logs/ahffi_log_files.txt (deflated 85%)
  adding: testnode.06-26-2023-18-25-33-UTC.ahffi_logs/os_detail_file.txt (deflated 78%)
  adding: testnode.06-26-2023-18-25-33-UTC.ahffi_logs/wallet_utils.err (deflated 95%)
...
...
...
  adding: testnode.06-26-2023-18-25-33-UTC.ahffi_logs/consumer_daemon.log.1 (deflated 96%)
  adding: testnode.06-26-2023-18-25-33-UTC.ahffi_logs/consumer_daemon.log (deflated 96%)
/scratch/ahfs_local/install_test
DIAGNOSE_AHFFI ran successfully
Diagnostic info can be found at /scratch/ahfs_local/collections/collections/testnode.06-26-2023-18-25-33-UTC.ahffi_logs.zip

Example 2-8 ahffi create-generic-user

./ahffi create-generic-user admin
Generic registration password:
Enter generic registration password again
Generic registration password:

Generic registration user admin created

Example 2-9 ahffi importcert

./ahffi importcert -cert /scratch/certs/ahf.crt -key /scratch/certs/ahf.key
2023-08-14 09:44:18 UTC: [testnode] [2832363] [UPDATE_PROPERTIES] [INFO] Path to the input properties file provided as : /scratch/ahfs_local/install_test/ahf_service.properties.1692006258
2023-08-14 09:44:22 UTC: [testnode] [2832363] [UPDATE_PROPERTIES] [INFO] nginx: the configuration file /scratch/ahfs_local/install_test/ahf_service/third_party/nginx/conf/ahfs_nginx_with_ssl.conf syntax is ok
2023-08-14 09:44:22 UTC: [testnode] [2832363] [UPDATE_PROPERTIES] [INFO] nginx: configuration file /scratch/ahfs_local/install_test/ahf_service/third_party/nginx/conf/ahfs_nginx_with_ssl.conf test is successful
Restarting the application...
2023-08-14 09:44:23 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Component chosen as all
2023-08-14 09:44:23 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Action chosen as restart
2023-08-14 09:44:23 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Successfully removed job(s) for all from crontab
2023-08-14 09:44:28 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Killed the existing Fleet Insights processes
2023-08-14 09:44:32 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Killed the existing collection processing engine processes
2023-08-14 09:44:33 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Killed the existing ahf_service processes for component(s): all.
2023-08-14 09:44:33 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Starting Fleet Insights
2023-08-14 09:44:37 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Started Fleet Insights successfully
2023-08-14 09:44:37 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] The path to manage_app.log is /scratch/ahfs_local/install_test/ahf_service/log/manage_app.log
2023-08-14 09:44:37 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] The path to nginx access.log is /scratch/ahfs_local/install_test/ahf_service/third_party/nginx/logs/access.log
2023-08-14 09:44:37 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Starting the collection processing engine
2023-08-14 09:44:38 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Collection processing engine is running
2023-08-14 09:44:38 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Started the collection processing engine successfully
2023-08-14 09:44:38 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Successfully added job(s) for all from crontab
2023-08-14 09:44:38 UTC: [testnode] [2833231] [MANAGE_APP] [INFO] Started the ahf_service processes for component(s): all.
Successfully imported the certificates

Example 2-10 ahffi updateproperty

./ahffi updateproperty -k WEBAPP_PORT -v 5001
2023-08-14 09:58:36 UTC: [testnode] [2945846] [UPDATE_PROPERTIES] [INFO] Key of the property to be updated: WEBAPP_PORT
2023-08-14 09:58:36 UTC: [testnode] [2945846] [UPDATE_PROPERTIES] [INFO] Value of the property to be updated: 5001
2023-08-14 09:58:36 UTC: [testnode] [2945846] [UPDATE_PROPERTIES] [INFO] Writing the provided key-value pair to /scratch/ahfs_local/install_test/ahf_service.properties.1692007116
2023-08-14 09:58:39 UTC: [testnode] [2945846] [UPDATE_PROPERTIES] [INFO] nginx: the configuration file /scratch/ahfs_local/install_test/ahf_service/third_party/nginx/conf/ahfs_nginx_with_ssl.conf syntax is ok
2023-08-14 09:58:39 UTC: [testnode] [2945846] [UPDATE_PROPERTIES] [INFO] nginx: configuration file /scratch/ahfs_local/install_test/ahf_service/third_party/nginx/conf/ahfs_nginx_with_ssl.conf test is successful

Example 2-11 Update DB user password

Note:

Before changing the database password, stop the Fleet Insights service.
./ahffi update-password db_user
Application needs to be stopped for this action.
Proceed to stop the application? [y/n]: y
2024-06-28 05:34:24 UTC: [testnode] [2746424] [MANAGE_APP] [INFO] Component chosen as all
2024-06-28 05:34:24 UTC: [testnode] [2746424] [MANAGE_APP] [INFO] Action chosen as stop
2024-06-28 05:34:25 UTC: [testnode] [2746424] [MANAGE_APP] [INFO] Successfully removed job(s) for all from crontab
2024-06-28 05:34:30 UTC: [testnode] [2746424] [MANAGE_APP] [INFO] Killed the existing Fleet Insights processes
2024-06-28 05:34:33 UTC: [testnode] [2746424] [MANAGE_APP] [INFO] Killed the existing collection processing engine processes
2024-06-28 05:34:34 UTC: [testnode] [2746424] [MANAGE_APP] [SUCCESS] Killed the existing ahf_service processes for component(s): all.
Please update your DB with new password and only then proceed by pressing ENTER...
Enter new DB user password:
Enter new DB user password again:
2024-06-28 05:35:18 UTC: [testnode] [2751047] [UPDATE_PROPERTIES] [INFO] Key of the property to be updated: DB_PASSWORD
2024-06-28 05:35:21 UTC: [testnode] [2751047] [UPDATE_PROPERTIES] [INFO] Writing the provided key-value pair to /scratch/ahfs_local/install_test/ahf_service.properties.1719552921
2024-06-28 05:35:32 UTC: [testnode] [2751047] [UPDATE_PROPERTIES] [INFO] nginx: the configuration file /scratch/ahfs_local/install_test/ahf_service/third_party/nginx/conf/ahfs_nginx_with_ssl.conf syntax is ok
2024-06-28 05:35:32 UTC: [testnode] [2751047] [UPDATE_PROPERTIES] [INFO] nginx: configuration file /scratch/ahfs_local/install_test/ahf_service/third_party/nginx/conf/ahfs_nginx_with_ssl.conf test is successful
DB password changed. Starting Fleet Insights...
2024-06-28 05:35:36 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] Component chosen as all
2024-06-28 05:35:36 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] Action chosen as start
2024-06-28 05:35:36 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] Starting Fleet Insights
2024-06-28 05:35:41 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] Started Fleet Insights successfully
2024-06-28 05:35:41 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] The path to manage_app.log is /scratch/ahfs_local/install_test/ahf_service/log/manage_app.log
2024-06-28 05:35:41 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] The path to nginx access.log is /scratch/ahfs_local/install_test/ahf_service/third_party/nginx/logs/access.log
2024-06-28 05:35:41 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] Starting the collection processing engine
2024-06-28 05:35:42 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] Collection processing engine is running
2024-06-28 05:35:43 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] Started the collection processing engine successfully
2024-06-28 05:35:44 UTC: [testnode] [2752698] [MANAGE_APP] [INFO] Successfully added job(s) for all from crontab
2024-06-28 05:35:44 UTC: [testnode] [2752698] [MANAGE_APP] [SUCCESS] Started the ahf_service processes for component(s): all.

Example 2-12 ahffi uninstall

./ahffi uninstall -qc
Uninstalling AHF service in quiet mode
Database objects will be cleaned as part of this uninstallation
No install directory, considering /scratch/ahfs_local/install_test as the install directory
Removing installation from /scratch/ahfs_local/install_test/
2023-08-14 10:07:10 UTC: [testnode] [3014990] [UNINSTALL_AHFS] [INFO] Uninstalling AHF Service
2023-08-14 10:07:10 UTC: [testnode] [3014990] [UNINSTALL_AHFS] [INFO] Cleaning AHF Service database objects
 
SQL*Plus: Release 21.0.0.0.0 - Production on Mon Aug 14 10:07:10 2023
Version 21.10.0.0.0
 
Copyright (c) 1982, 2022, Oracle.  All rights reserved.
 
Last Successful login time: Mon Aug 14 2023 10:07:10 +00:00
 
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0
 
SQL>   2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26   27   28   29   30   31   32   33   34 
PL/SQL procedure successfully completed.
 
SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0
2023-08-14 10:07:13 UTC: [testnode] [3014990] [UNINSTALL_AHFS] [INFO] Stopping all running ahfs processes
2023-08-14 10:07:14 UTC: [testnode] [3015554] [MANAGE_APP] [INFO] Component chosen as all
2023-08-14 10:07:14 UTC: [testnode] [3015554] [MANAGE_APP] [INFO] Action chosen as stop
2023-08-14 10:07:14 UTC: [testnode] [3015554] [MANAGE_APP] [INFO] Successfully removed job(s) for all from crontab
2023-08-14 10:07:20 UTC: [testnode] [3015554] [MANAGE_APP] [INFO] Killed the existing Fleet Insights processes
2023-08-14 10:07:23 UTC: [testnode] [3015554] [MANAGE_APP] [INFO] Killed the existing collection processing engine processes
2023-08-14 10:07:24 UTC: [testnode] [3015554] [MANAGE_APP] [INFO] Killed the existing ahf_service processes for component(s): all.
2023-08-14 10:07:24 UTC: [testnode] [3014990] [UNINSTALL_AHFS] [INFO] Removing AHF Service backup files
2023-08-14 10:07:24 UTC: [testnode] [3014990] [UNINSTALL_AHFS] [INFO] Deleting AHF Service application files
Completing  AHF Service uninstallation
2023-08-14 10:07:26 UTC: [testnode] [3014990] [UNINSTALL_AHFS] [INFO] Successfully uninstalled AHF service
Successfully uninstalled application