Skip to content
Milan Kuchtiak edited this page Jul 2, 2026 · 3 revisions

Health-Report / Report-Diff

This page describes how to use health-report and report-diff in CLARIN-DSpace.

Overview

  • health-report creates and stores repository health snapshots of configured health "task".
  • report-diff compares two stored health snapshots.
  • Both scripts are intended for operations monitoring and troubleshooting.

health-report

Command

dspace health-report [options]

Options

  • -h, --help : show help and available check indexes.
  • -e, --email : send report to one or more email addresses.
  • -c, --check : run one or more checks by index.
  • -f, --for : set last N days (positive integer).
  • -r, --report : save report output to a file.

Notes

  • The script stores a report snapshot in DB and prints output to console.
  • The output header includes a report ID (for example HEALTH REPORT 123).
  • Check indexes and names are shown by dspace health-report -h.

Examples

dspace health-report
dspace health-report -c 0 -c 3
dspace health-report -f 14 -r health-report.txt
dspace health-report -e admin@example.org -e ops@example.org

report-diff

Command

dspace report-diff [options]

Options

  • -h, --help : show help.
  • -l, --list : list available reports (including IDs).
  • -m, --max : limit number of list entries (used with --list).
  • -s, --source : source report ID.
  • -t, --target : target report ID.
  • -c, --check : compare one or more checks by index.
  • -e, --email : send diff report by email.

Typical workflow

  1. Run health-report regularly.
  2. List reports and choose IDs:
dspace report-diff -l
  1. Compare selected reports:
dspace report-diff --source 101 --target 110
  1. Optional check filter:
dspace report-diff -s 101 -t 110 -c 0 -c 3

Behavior details

  • If -s and -t are both missing, the latest two reports are compared.
  • If only --source is provided, the missing --target is auto-filled from latest reports.
  • If only --target is provided, the missing --source is auto-filled from latest reports.
  • Invalid -m value logs a warning and listing continues without a limit.
  • Invalid -c value logs a warning and comparison continues with all checks.
  • Non-positive or non-existing report IDs stop the comparison with a clear message.

report-diff output

The output is structured into sections:

  • Executive Summary
  • Key Changes Between Reports
  • Skipped Checks (if some checks are present only in one report)
  • Detailed Change Log (when differences exist)

When reports have no common checks, output is concise and focuses on summary and skipped checks.

Practical tips

  • Keep periodic health-report snapshots so diffs are meaningful.
  • Use -c when focusing on one or more particular checks.
  • Use -r on health-report when you need a file artifact for incident tickets.

Troubleshooting

  • No reports found in DB: run dspace health-report first.

  • No report found for report ID: verify available IDs with dspace report-diff -l.

  • No common checks found: reports were generated with different check sets; use skipped-checks section as reference.

  • Option validation errors: confirm numeric values for -f, -m, -c, and positive IDs for -s/-t.

Example commands

Show health-report help:
  dspace health-report -h

Run report for selected checks:
  dspace health-report -c 0 -c 3

Save report output to file:
  dspace health-report -r health-report.txt

List available report snapshots:
  dspace report-diff -l

List only latest 20 snapshots:
  dspace report-diff -l -m 20

Compare last two reports (automatic fallback):
  dspace report-diff

Compare specific reports by ID:
  dspace report-diff -s 101 -t 110

Compare only selected checks by ID:
  dspace report-diff -s 101 -t 110 -c 1

Example outputs

dspace health-report -h

HELP
This process creates a health report of your DSpace.
You can choose from these available options:
  -h, --help            Show help information
  -e, --email           Send report to specified email address
  -c, --check           Perform specific check(s) by index (0-5). Repeat the flag (e.g. -c 1 -c 3) to run multiple checks. Default: All checks
  -f, --for             Specify the last N days to consider (positive integer). Default: 7
  -r, --report          Specify a file to save the report

Available checks:
   0. General Information
   1. Item summary
   2. User summary
   3. License summary
   4. Embargo check
   5. Metadata check

dspace health-report -c 0 -c 1

HEALTH REPORT 3:

######################

General Information:
Generated: 2026-06-24 14:06:39
From - Till: 2026-06-17 - 2026-06-24
Url: https://dev-5.pc:8443/repository/

Assetstore size     : 160 GB
Log dir size        : 62 MB

######################

Item summary:
Community [Digital Humanities]: 1170
Community [Language Resources]: 1392
Community [Teaching materials]: 0

Collection sizes:
	Digital Humanities > LINDAT / CLARIAH-CZ > LINDAT / CLARIAH-CZ DH Data:  392 KB
	Digital Humanities > NFA > Austerity Measures During the Protectorate of Bohemia and Moravia:  276 KB
	Digital Humanities > NFA > Birth of Czechoslovakia and celebrations of its anniversaries:  92 KB
	Digital Humanities > NFA > Board of Trustees for the Education of Youth in Bohemia and Moravia:  230 KB
	Digital Humanities > NFA > Bohumil Vesely Gallery:  4 MB
	Digital Humanities > NFA > Health and Social Welfare in the Czech Lands:  337 KB
	Digital Humanities > NFA > Memorable Funerals:  312 KB
	Digital Humanities > NFA > Prague Urban Development in the First Half of the 20th Century:  266 KB
	Digital Humanities > NFA > The Heydrich Terror:  148 KB
	Digital Humanities > NFA > The Munich Agreement:  174 KB
	Digital Humanities > NFA > The National Theatre throughout history:  179 KB
	Language Resources > LINDAT / CLARIAH-CZ > LINDAT / CLARIAH-CZ Data & Tools:  313 GB
	Language Resources > LINDAT / CLARIAH-CZ > LINDAT / CLARIAH-CZ Web Services:  163 KB
	Language Resources > LRT + Open Submissions > LRT + Open Submissions Data & Tools:  6 GB
	Language Resources > Wikitongues > Wikitongues Oral Histories:  752 KB
Total size:              319 GB
Resource without policy: 8
Deleted bitstreams:      20
Orphan bitstreams:       0 []

Published items (archived, not withdrawn): 2562
Withdrawn items: 481
Not published items (in workspace or workflow mode): 334
	In Stage -1: 3
	In Stage 1: 198
	In Stage 2: 36
	In Stage 3: 14
	In Stage 4: 15
	In Stage 5: 56
	In Stage 6: 11
	Waiting for approval (workflow items): 3
Count Bitstream           : 12081
Count Bundle              : 4130
Count Collection          : 16
Count Community           : 8
Count MetadataValue       : 159045
Count EPerson             : 1722
Count Item                : 3381
Count Handle              : 5429
Count Group               : 49
Count BasicWorkflowItem   : 3
Count WorkspaceItem       : 333

dspace report-diff -h

usage: report-diff
 -c,--check <arg>    Filter comparison to one or more specific checks by
                     index (0 to 5). Repeat the flag (e.g. -c 1 -c 3) to
                     compare multiple checks from both reports.
 -e,--email <arg>    Send report to this email address.
 -h,--help           Show help information.
 -l,--list           List available reports (ID, timestamp, args). Use to
                     find report IDs.
 -m,--max <arg>      Limit the number of entries (use only with -l). If
                     omitted, all entries are shown.
 -s,--source <arg>   Source report ID to compare from.
 -t,--target <arg>   Target report ID to compare against.
This script compares two health reports and shows the differences between them.
Use '-s/--source' and '-t/--target' with report IDs to pick the source and target report.
Use '-l/--list' to list all available reports with their IDs and timestamps.
Use '-m/--max' together with '--list' to limit how many entries are shown.
If you want to compare a specific check, use the '-c' option with the check index, in this case you must also specify the source and target report IDs.
If you want to send the report to a specified email address, use '-e'.

dspace report-diff -s 2 -t 3

LINDAT/CLARIAH-CZ digital library at the Institute of Formal and Applied Linguistics (ÚFAL): Repository Health Report Diff

Section 1: Executive Summary

Report Type: healthcheck
Source Report: ID 2 at 2026-06-24 14:04:51.021
Target Report: ID 3 at 2026-06-24 14:06:39.497
Report Period: 1 minute 48 seconds

Key Changes Between Reports
=================================================================
| Field              | Source: ID 2 | Target: ID 3 | Difference |
=================================================================
| Log Directory Size | 62.11 MB     | 62.19 MB     | +80.05 KB  |
| Items              | 3380         | 3381         | +1         |
| Published Items    | 2561         | 2562         | +1         |
| Bitstreams         | 12078        | 12081        | +3         |
| Bundles            | 4128         | 4130         | +2         |
| Metadata Values    | 159014       | 159045       | +31        |
| Handles            | 5428         | 5429         | +1         |
=================================================================

Section 2: Skipped Checks

The following checks could not be compared because they were not present in both reports.

Only in source report (ID 2):
  - License summary

Section 3: Detailed Change Log

Changes Summary
- Total operations: 11 (11 REPLACE)
- Fields modified: 11

- REPLACE at /checks/0/report/generated: "2026-06-24 14:04:46" -> "2026-06-24 14:06:39"
- REPLACE at /checks/0/report/directoryStats/0/size_bytes: 172661437353 -> 172662493126
- REPLACE at /checks/0/report/directoryStats/1/size_bytes: 65132075 -> 65214043
- REPLACE at /checks/1/report/publishedItems: 2561 -> 2562
- REPLACE at /checks/1/report/collectionsSizesInfo/collectionSizes/4/size: "3 MB" -> "4 MB"
- REPLACE at /checks/1/report/itemsCount: 3380 -> 3381
- REPLACE at /checks/1/report/metadataValuesCount: 159014 -> 159045
- REPLACE at /checks/1/report/handlesCount: 5428 -> 5429
- REPLACE at /checks/1/report/bundlesCount: 4128 -> 4130
- REPLACE at /checks/1/report/bitstreamsCount: 12078 -> 12081
- REPLACE at /checks/1/report/communities/0/size: 1169 -> 1170

Developer notes

  • Check selection comes from dspace/config/modules/healthcheck.cfg.
  • Report-diff key fields and order are configured in dspace-api/src/main/resources/report-diff-fields.json.
  • If check names are changed in configuration, keep report-diff field mappings in sync.

Persistence / data model

Each health-report run is persisted as a row in the DB, and report-diff reads those rows back by ID.

  • Table: report_result (entity org.dspace.content.ReportResult).
  • The primary key report_result_id (sequence report_result_id_seq) is the ID shown in the HEALTH REPORT <id> output header and used by report-diff -s/-t.
  • Columns:
    • report_result_id : primary key.
    • type : report type; health-report always sets it to healthcheck.
    • value : the full report serialized as JSON.
    • executor_id : FK to eperson — the user who ran the report.
    • args : the command-line options the report was run with.
    • last_modified : timestamp, set automatically on write.
  • On each run HealthReport creates a ReportResult and sets type, value (JSON), executor, and args before saving; the JSON in value is what report-diff compares.

Implementation notes

  • Entry points:
    • org.dspace.app.healthreport.HealthReport — the health-report script.
    • org.dspace.app.reportdiff.ReportDiff — the report-diff script.
    • Persistence goes through ReportResultService / ReportResultDAO.
  • Email: reports are sent using the dspace/config/emails/healthcheck template (used by the -e option on both scripts).
  • Integration tests: HealthReportIT and ReportDiffIT (dspace-api/src/test/java/org/dspace/scripts/) cover creating report rows and running diffs.

Home


Getting Started

Features

Operations

For Users

Development

Reference


Archive (v5 / stale)

Clone this wiki locally