Chapter 2. Analyze Red Hat Discovery system behavior and diagnose errors
Determine your Red Hat Discovery version, uninstall the server, get help with command-line interface commands, and configure Secure Shell (SSH) credentials. You can also locate log files, back up and restore encryption keys, and restart the server after a reboot.
2.1. Determine the version of the Red Hat Discovery server Copy linkLink copied to clipboard!
Determine the version of the Red Hat Discovery server by using the command line interface to help with troubleshooting and support requests.
Prerequisites
- You are logged in to the command line interface as the Discovery server administrator.
Procedure
To determine the version of the Discovery server, use the following steps:
Enter the
dsc server statuscommand. The expected output provides the version of the server that you are using:"server_address": "127.0.0.1:9443", "server_id": "45a8ea20-2ec4-4113-b459-234fed505b0d", "server_version": "1.0.0.3e15fa8786a974c9eafe6376ff31ae0211972c36"If you cannot get the server status command to run, or you cannot log in to the server, use the following Podman images command:
podman images --filter 'reference=registry.redhat.io/discovery/discovery-server-rhel9' --format '{{.Labels.url}}'
2.2. Uninstall Red Hat Discovery Copy linkLink copied to clipboard!
If you no longer need Discovery, you can uninstall the server and its associated packages from your system.
Prerequisites
- You are logged in to the system that is running Red Hat Discovery.
-
You have sudo access to perform certain functions in
dnf.
Procedure
- To uninstall Red Hat Discovery server, use the following steps:
Run the uninstall command.
discoveryctl uninstallUninstall the discoveryctl package.
sudo dnf remove discoveryctlOptional: Uninstall the command line interface, if installed.
sudo dnf remove discovery-cli
2.3. Get help with the command line interface Copy linkLink copied to clipboard!
Access Discovery help through the man page and subcommand options to find usage details for the command line interface.
Prerequisites
- You are logged in to the command line interface as the Discovery server administrator.
Procedure
- For help on general topics, see the man page information.
For help on a specific subcommand, use the
-hoption. For example:dsc cred -h dsc source -h dsc scan -h
2.4. Secure Shell (SSH) credential configuration Copy linkLink copied to clipboard!
If you receive an error message that includes text similar to not a valid file on the filesystem, that message might indicate an issue with the mount point. The mount point on the file system enables access to the SSH keyfiles.
2.5. Log file locations Copy linkLink copied to clipboard!
Log files for the Discovery server are stored in specific directories that vary by component, helping you diagnose server and scanning issues.
| Location | Description |
|---|---|
|
| Log files on the local file system. |
|
|
Log data copied to |
|
| Log data for the Celery worker process. |
To follow the log output, include the -f option:
podman logs -f discovery-server
podman logs -f discovery-celery-worker
2.6. Back up or restore the server encryption key Copy linkLink copied to clipboard!
Passwords are not stored as plain text. They are encrypted and decrypted by using the content of the secret.txt file as a secret key. If you need to back up and restore the secret.txt file, use these steps.
Prerequisites
- You are logged in to the system that is running Red Hat Discovery.
-
You have sudo access to perform certain functions in
dnf.
Procedure
-
To back up the encrypted SSH credentials, navigate to
"${HOME}"/.local/share/discovery/datadirectory and copy thesecret.txtfile. To restore the
secret.txtfile, enter the following command, where path_to_backup is the path where thesecret.txtfile is backed up:cp -p __path_to_backup__/secret.txt "${HOME}"/.local/share/discovery/data/
2.7. Restart the Red Hat Discovery server after a reboot Copy linkLink copied to clipboard!
If Discovery does not automatically restart after a system reboot, manually restart it by using the systemctl command.
Prerequisites
- You are logged in to the system that is running Red Hat Discovery.
-
You have sudo access to perform certain functions in
dnf.
Procedure
To restart the Discovery application after a reboot, use the following command:
systemctl --user restart discovery-app