Skip to content

Add Dovecot application monitoring - #1

Open
shpokas wants to merge 3 commits into
masterfrom
feat/dovecot-application
Open

Add Dovecot application monitoring#1
shpokas wants to merge 3 commits into
masterfrom
feat/dovecot-application

Conversation

@shpokas

@shpokas shpokas commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds polling support for Dovecot via the dovecot SNMP extend (/usr/local/bin/dovecot-stats-snmp.sh)
  • Parses JSON output from doveadm stats containing 8 metric groups
  • Stores data in 7 RRD categories with corresponding graph files

Metrics collected

RRD Datasets Type
connections users, sessions GAUGE
auth success, failures DERIVE
auth_duration succ/fail avg, median, p95 GAUGE
imap count, avg, median, p95 DERIVE/GAUGE
smtp count, avg, median, p95 DERIVE/GAUGE
delivery count, avg, median, p95 DERIVE/GAUGE
sieve count, avg, median, p95 DERIVE/GAUGE

Files added

  • includes/polling/applications/dovecot.inc.php
  • includes/html/pages/device/apps/dovecot.inc.php
  • includes/html/graphs/application/dovecot_connections.inc.php
  • includes/html/graphs/application/dovecot_auth.inc.php
  • includes/html/graphs/application/dovecot_auth_duration.inc.php
  • includes/html/graphs/application/dovecot_imap.inc.php
  • includes/html/graphs/application/dovecot_smtp.inc.php
  • includes/html/graphs/application/dovecot_delivery.inc.php
  • includes/html/graphs/application/dovecot_sieve.inc.php

Test plan

  • lnms device:discover mail.sets.lv -m applications — dovecot discovered (app_id=9)
  • lnms device:poll mail.sets.lv -m applications — all 7 RRD files created and populated
  • Verify graphs render in the web UI under device → Apps → Dovecot

🤖 Generated with Claude Code

shpokas and others added 3 commits March 27, 2026 12:57
Polls the dovecot SNMP extend (nsExtendOutputFull) which returns JSON
statistics from doveadm. Tracks connections, auth rates and durations,
IMAP/SMTP command rates and latencies, mail delivery, and Sieve actions.

Creates 7 RRD categories: connections, auth, auth_duration, imap, smtp,
delivery, sieve — with corresponding graph files and a device app page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers Dovecot 2.4 metric configuration, SNMP extend setup including
sudo requirements, verification steps, and a graph reference table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Required for the /apps?app=dovecot page to render without an
"Undefined array key" error — the default.inc.php handler iterates
$graphs[$app->app_type] which must be declared here.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
shpokas pushed a commit that referenced this pull request May 22, 2026
…ibrenms#19641)

* Update Xdsl.php

This PR fixes a TypeError in the Xdsl module that occurs when the SNMP response for adslMibObjects or vdsl2LineTable returns data in an unexpected format (e.g., a string instead of an array). 
This usually happens with older or buggy DSLAM implementations (like some my ZTE models).
Currently, the code passes the $data variable directly into the PortAdsl or PortVdsl constructor without validating that it is an array, leading to a fatal error:TypeError: Illuminate\Database\Eloquent\Model::__construct(): Argument #1 ($attributes) must be of type array, string given.

Changes:Added is_array($data) checks in pollAdsl and pollVdsl methods before model instantiation.
Added a warning log when invalid data is received to help with debugging.
Testing:Tested with my device returning malformed ADSL SNMP tables.
Verified that the discovery/polling process continues for other ports/modules instead of crashing.

* Update Xdsl.php

* Update Xdsl.php

* Update Xdsl.php

* Update Xdsl.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant