Skip to content

Feat/diagnosis script for support(dwh prefs#15) - #27

Open
MarkusNissen wants to merge 3 commits into
mainfrom
feat/diagnosis-script-for-support(dwh-prefs#15)
Open

Feat/diagnosis script for support(dwh prefs#15)#27
MarkusNissen wants to merge 3 commits into
mainfrom
feat/diagnosis-script-for-support(dwh-prefs#15)

Conversation

@MarkusNissen

Copy link
Copy Markdown

Description

Adds a diagnostic Bash script designed to gather system logs, environment metadata, process information, and folder permissions into a timestamped archive (/tmp/aktin_diag_.tar.gz).

Key Features & Functionality

  • Deployment Auto-Detection: Automatically distinguishes between Docker (/.dockerenv) and Debian environments to query the correct paths and services.

  • Log Aggregation: Copies Wildfly, Apache2, and PostgreSQL logs where available.

  • Health & Service Checks:

      1 .Checks Wildfly, PostgreSQL, and Java running processes (ps).
    
      2. Evaluates PostgreSQL network connectivity (/dev/tcp/...) inside Docker or system service status in Debian.
    
      3. Captures disk usage (df), RAM/CPU top processes (top), OS release, and Java/Postgres versions.
    
  • AKTIN Metadata & Structure Validation:

      1. Extracts Institution ID, Site ID, and DWH version from /etc/aktin/aktin.properties.
    
      2. Verifies ownership/permissions for key /var/lib/aktin/ subdirectories (reports, broker, import, etc.).
    
      3. Dumps R environment variables if R is installed.
    
  • Non-Blocking Execution: Uses safe error handling (|| true) alongside set -euo pipefail so diagnostic collection finishes even if individual commands fail (e.g., missing log directories or absent packages).

  • Automated Archiving: Compresses all results into a single .tar.gz bundle located in /tmp/ for quick retrieval.

@MarkusNissen MarkusNissen self-assigned this Aug 13, 2026
@MarkusNissen MarkusNissen added the enhancement New feature or request label Aug 13, 2026
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
# services and processes
echo -e "+++++ WILDFLY SERVICE STATUS +++++" > "$LOGFOLDER/services.txt"
if [[ "$DEPLOYMENT_TYPE" == "Docker" ]]; then
echo "Running inside Wildfly container" >> "$LOGFOLDER/services.txt"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if service wildfly status can be skipped for docker, by checking what actually runs under that command. On a Debian setup i found the socket for wildfly service under /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service, with content ```
[Unit]
Description=The WildFly Application Server
After=syslog.target network.target
Before=httpd.service

[Service]
Environment=LAUNCH_JBOSS_IN_BACKGROUND=1
EnvironmentFile=-/etc/wildfly/wildfly.conf
User=wildfly
LimitNOFILE=102642
PIDFile=/var/run/wildfly/wildfly.pid
ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND
StandardOutput=null

[Install]
WantedBy=multi-user.target


You can see each _service wildfly_-command executes ```launch.sh``` which likely calls a JBoss CLI command to retrieve the status. 

Because this is maybe a bit too much for now, create an issue for this task instead and leave the code as is.

Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh
Comment thread dwh-scripts/extract_logged_technical_and_organizational_metadata.sh

@LongusBongus LongusBongus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work overall, some changes can be made and on some topics i would like to hear why things are implemented as they are. If anything is unclear or my assumption in some comments is wrong or wouldn't work, you can tell me by replying to my comments directly.

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in AKTIN Project Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants