From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Hannes Laimer <h.laimer@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-api v2 3/3] fix #4023: templates: add plain-text variant of admin report
Date: Fri, 19 Sep 2025 00:26:16 +0200 [thread overview]
Message-ID: <20250919002616.1b133f2e@rosa.proxmox.com> (raw)
In-Reply-To: <20250918143142.248758-4-h.laimer@proxmox.com>
Thanks for tackling this so quickly!
On Thu, 18 Sep 2025 16:31:42 +0200
Hannes Laimer <h.laimer@proxmox.com> wrote:
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
> v2:
> - drop `subject:` line
why did you change this?
the subject should get stripped out and is not present in resulting report.
not having it in place causes `pmgreport` to fail, if you try to remove
the text/html part (via `touch /etc/pmg/templates/pmgreport.tt`)
But checking this I realized that the docs were a bit tight-lipped on this
functionality (and had a factual error):
https://git.proxmox.com/?p=pmg-docs.git;a=commitdiff;h=78ac287f22dca4856f8304deb8b88dd0303fdb53
else the plain-text report looks fine!
>
> src/Makefile | 1 +
> src/templates/pmgreport.plain.tt | 50 ++++++++++++++++++++++++++++++++
> 2 files changed, 51 insertions(+)
> create mode 100644 src/templates/pmgreport.plain.tt
>
> diff --git a/src/Makefile b/src/Makefile
> index b75c818..2c5ef28 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -26,6 +26,7 @@ CONF_MANS= pmg.conf.5 cluster.conf.5
> TEMPLATES = \
> fetchmailrc.tt \
> pmgreport.tt \
> + pmgreport.plain.tt \
> spamreport-verbose.tt \
> spamreport-verbose.plain.tt \
> spamreport-short.tt \
> diff --git a/src/templates/pmgreport.plain.tt b/src/templates/pmgreport.plain.tt
> new file mode 100644
> index 0000000..18871b2
> --- /dev/null
> +++ b/src/templates/pmgreport.plain.tt
> @@ -0,0 +1,50 @@
> +[% IF cluster -%]
> +Cluster Status
> +[% FOREACH item IN cluster -%]
> +- Hostname: [% item.hostname %]
> + IP Address: [% item.ip %]
> + Role: [% item.type %]
> + State: [% item.state %]
> + Load: [% item.loadavg1 %]
> + Memory: [% item.memory %]
> + Disk: [% item.disk %]
> +[% IF !loop.last %]----
> +[% END %]
> +[% END %]
> +[% END %]
> +[% IF system -%]
> +System Status
> +[% FOREACH item IN system -%]
> +- [% item.text %]: [% item.value %]
> +[% END %]
> +[% END %]
> +[% IF incoming -%]
> +Incoming Mails (24 hours)
> +[% FOREACH item IN incoming -%]
> +- [% item.text %][% IF item.percentage.defined %] ([% item.percentage %]%)[% END %]: [% item.value %]
> +[% END %]
> +[% END %]
> +[% IF outgoing -%]
> +Outgoing Mails (24 hours)
> +[% FOREACH item IN outgoing -%]
> +- [% item.text %][% IF item.percentage.defined %] ([% item.percentage %]%)[% END %]: [% item.value %]
> +[% END %]
> +[% END %]
> +[% IF virusstat -%]
> +Virus Charts (Top 10)
> +[% FOREACH item IN virusstat -%]
> +- [% item.name %]: [% item.count %]
> +[% END %]
> +[% END %]
> +[% IF virusquar -%]
> +Virus Quarantine
> +[% FOREACH item IN virusquar -%]
> +- [% item.text %]: [% item.value %]
> +[% END %]
> +[% END %]
> +[% IF spamquar -%]
> +Spam Quarantine
> +[% FOREACH item IN spamquar -%]
> +- [% item.text %]: [% item.value %]
> +[% END %]
> +[% END %]
_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel
next prev parent reply other threads:[~2025-09-18 22:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 14:31 [pmg-devel] [PATCH pmg-api v2 0/3] add plain-text variants for both reports Hannes Laimer
2025-09-18 14:31 ` [pmg-devel] [PATCH pmg-api v2 1/3] pmgqm: add plain subject/from fields for reports Hannes Laimer
2025-09-18 14:54 ` Thomas Lamprecht
2025-09-18 23:21 ` Stoiko Ivanov
2025-09-19 7:00 ` Hannes Laimer
2025-09-19 10:24 ` Stoiko Ivanov
2025-09-18 14:31 ` [pmg-devel] [PATCH pmg-api v2 2/3] fix #1621: templates: add plain-text variant of short/verbose spam report Hannes Laimer
2025-09-18 15:06 ` Thomas Lamprecht
2025-09-18 23:26 ` Stoiko Ivanov
2025-09-19 7:37 ` Hannes Laimer
2025-09-18 14:31 ` [pmg-devel] [PATCH pmg-api v2 3/3] fix #4023: templates: add plain-text variant of admin report Hannes Laimer
2025-09-18 22:26 ` Stoiko Ivanov [this message]
2025-09-19 8:37 ` [pmg-devel] superseded: [PATCH pmg-api v2 0/3] add plain-text variants for both reports Hannes Laimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250919002616.1b133f2e@rosa.proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=h.laimer@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox