Software and Services for IBM i (iSeries/AS400)
Ask a question
1000 characters left

                                             

IBMi Change Control

IBMi Security & Auditing

IBMi Software Support

IBMi Development

 

RPG Metrics Agent for IBM i and PC local scanning

Downloaded: 66

RPG Metrics Agent beta 0.2.3 is available as a free download.

The RPG Metrics Agent runs locally and scans RPG source code without uploading source code to the RPG Metrics dashboard.

The same agent can now run in two modes:

- IBM i / PASE mode, watching an IFS folder for RPG source stream files
- Windows / PC local-folder mode, watching a local folder of exported RPG source files

The agent scans source locally, generates a local XLSX report, and can optionally send calculated metrics to the RPG Metrics dashboard.

RPG source code does not leave the environment where the agent is running.

In IBM i mode, RPG source remains on IBM i.
In PC/local-folder mode, the agent scans source files that have already been exported to the local PC or server.

New in beta 0.2.3:

- Single agent now supports IBM i/PASE and Windows/PC local-folder scanning
- New PLATFORM_MODE setting: auto, ibmi or pc
- New SCAN_PATH setting for neutral source folder configuration
- IBMI_IFS_PATH retained for existing IBM i installs
- Windows run-agent.bat helper included
- Console logging added so the Windows command window no longer appears frozen
- Scan-cycle logging added, including watched folder, idle checks and files waiting
- README.pdf included for easier local reading
- Local-only mode retained using DASHBOARD_SYNC=false

Includes:

- IBM i local RPG source scanning
- Windows / PC local-folder RPG source scanning
- Local XLSX report generation
- Cyclomatic complexity hotspot reporting
- RPG Free compatibility analysis
- Optional dashboard metrics upload
- Dashboard-controlled custom scan rules when dashboard sync is enabled
- IBM i completion messages when running on IBM i
- Example IBM i subsystem setup
- Formatted README PDF

For local-only use, leave DASHBOARD_SYNC=false and AUTH_REFRESH_TOKEN blank in agent.conf.

To sync calculated metrics to the RPG Metrics dashboard, set DASHBOARD_SYNC=true and configure an agent refresh token from your RPG Metrics profile page.

The download ZIP includes agent.conf.example but does not include agent.conf, so users can create their own local configuration safely.

The RPG Metrics Agent is a Python-based beta package that scans RPG source code locally and generates local XLSX reports.

The same agent can run in two modes:

- IBM i / PASE mode, watching an IFS folder for RPG source stream files
- Windows / PC local-folder mode, watching a folder of exported RPG source files

Local-first scanning: your RPG source code is scanned locally in the environment where the agent is running. The agent creates local reports and, if configured, sends calculated metrics only to the RPG Metrics dashboard.

What the agent does

The RPG Metrics Agent watches a configured source folder for RPG source files. When a source file appears, the agent scans it, calculates code quality metrics, creates a local XLSX report, and optionally syncs the calculated metrics to the RPG Metrics dashboard.

- Scans RPG source locally
- Runs on IBM i / PASE or Windows / PC local-folder mode
- Generates an XLSX report locally
- Calculates Cyclomatic Complexity
- Calculates Maintainability Index
- Calculates comment percentage and line counts
- Identifies cyclomatic complexity hotspots
- Reports RPG Free compatibility indicators
- Can sync calculated metrics to the RPG Metrics dashboard
- Can run in local-only mode without a dashboard token
- Can send IBM i completion messages when running on IBM i

What the agent does not do

The agent is designed for RPG teams who do not want to upload source code to a web application.

- It does not upload RPG source code to the dashboard
- It does not store your source code in the RPG Metrics dashboard
- It does not require dashboard sync for local XLSX reports
- It does not require an agent token when running in local-only mode

In IBM i mode, the source remains on IBM i.

In PC/local-folder mode, the agent scans RPG source files that have already been exported or copied to the local PC or server.

Local reports

The agent creates XLSX reports in the configured reports folder.

On IBM i, this is typically:

/home/metrics-agent/reports/

On Windows, this might be:

C:\rpg-metrics-agent\reports\

Reports are organised by team, library, and source file. Depending on the enabled features, a report can include:

- Summary metrics
- Source line analysis
- Cyclomatic complexity hotspots
- RPG Free compatibility analysis

Dashboard-connected mode

When dashboard sync is enabled, the agent sends calculated metrics to the RPG Metrics dashboard:

https://kdp-software.co.uk/rpg-metrics/

The dashboard gives you a central view of scanned programs, including complexity, maintainability, comment percentage, RPG Free compatibility counts, hotspots, and trends.

Dashboard sync is useful when you want to track code quality over time, compare programs, review team activity, or monitor changes as part of your RPG development workflow.

Local-only mode

The agent can also be used without dashboard sync.

In local-only mode, it scans source locally and creates a local XLSX report without sending metrics to the dashboard.

This is useful if you want to test the agent locally first before connecting it to RPG Metrics, or if you only want local reports.

PC local-folder mode

Beta 0.2.3 adds PC local-folder scanning.

This allows the same agent to run on Windows against exported RPG source files. The agent watches a local folder, scans source files, creates XLSX reports, and optionally syncs calculated metrics to the dashboard.

This is useful for demonstrations, testing, or sites where RPG source files are already exported from IBM i.

IBM i mode

In IBM i mode, the agent watches an IFS folder for RPG source stream files. Source members can be copied to the watched folder using CPYTOSTMF, PDM options, change-control post-promotion commands, or custom scripts.

The agent can then scan the stream file, create a local XLSX report, move the source file to sent or unsent, and optionally notify the submitting IBM i user.

Beta access

The RPG Metrics Agent is currently available as a beta package. During beta, available agent features are enabled so the local scan, local report, dashboard sync, PC local-folder mode, IBM i mode, and team workflow can be tested end-to-end.

Beta note: this package is still being tested across real IBM i and Windows environments. Installation steps may vary depending on your IBM i release, Python setup, security rules, subsystem preferences, Windows Python setup, and local folder permissions.

Typical IBM i workflow

- Install the agent on IBM i
- Configure agent.conf
- Optionally generate an agent token from your RPG Metrics profile
- Create RPG stream files in the configured IFS folder
- The agent scans the source locally
- The local XLSX report is created on IBM i
- Calculated metrics are optionally synced to the dashboard

Typical PC workflow

- Install the agent on Windows
- Configure PLATFORM_MODE=pc in agent.conf
- Configure SCAN_PATH to point to a local source folder
- Place exported RPG source files in the configured folder
- The agent scans the source locally
- The local XLSX report is created on the PC
- Calculated metrics are optionally synced to the dashboard

Why this approach matters

IBM i and RPG teams often need better visibility of RPG complexity and maintainability, but they may not be comfortable uploading source code to an external service.

The RPG Metrics Agent is designed around that concern.

It lets you generate useful metrics while keeping source code in the environment where scanning takes place.

Click the download button to obtain a copy of the RPG Metrics Agent.

Download

Before download...

Continue... ×

If you have any queries please use the feedback function within kdp-software.co.uk/rpg-metrics

IBMi Security,Tools ,Change Control and Support