all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pmg-api] utils: analyze custom check: remove trailing newline for error output
@ 2026-06-11  9:25 Dominik Csapak
  2026-07-15 13:10 ` applied: " Fabian Grünbichler
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2026-06-11  9:25 UTC (permalink / raw)
  To: pmg-devel

Output from a custom check script on stderr gets printed to the syslog
with the qid in front so it gets picked up by the log tracker.

This would resulut in the log tracker output being something like:
`pmg-smtp-filter[4509]: 1093B6A2A7C7E9C6C9: custom check: DEBUG:#012`

remove the trailing newline in `log_err` with `chomp` to prevent the
`#012` ending up in the syslog and thus log-tracker output.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/PMG/Utils.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm
index 913679b..80fab76 100644
--- a/src/PMG/Utils.pm
+++ b/src/PMG/Utils.pm
@@ -404,6 +404,7 @@ sub analyze_custom_check {
 
         my $log_err = sub {
             my ($errmsg) = @_;
+            chomp ($errmsg);
             syslog('err', '%s', "$queue->{logid}: custom check: $errmsg");
         };
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* applied: [PATCH pmg-api] utils: analyze custom check: remove trailing newline for error output
  2026-06-11  9:25 [PATCH pmg-api] utils: analyze custom check: remove trailing newline for error output Dominik Csapak
@ 2026-07-15 13:10 ` Fabian Grünbichler
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Grünbichler @ 2026-07-15 13:10 UTC (permalink / raw)
  To: pmg-devel, Dominik Csapak


On Thu, 11 Jun 2026 11:25:30 +0200, Dominik Csapak wrote:
> Output from a custom check script on stderr gets printed to the syslog
> with the qid in front so it gets picked up by the log tracker.
> 
> This would resulut in the log tracker output being something like:
> `pmg-smtp-filter[4509]: 1093B6A2A7C7E9C6C9: custom check: DEBUG:#012`
> 
> remove the trailing newline in `log_err` with `chomp` to prevent the
> `#012` ending up in the syslog and thus log-tracker output.
> 
> [...]

Applied with some additional info in commit message, thanks!

[1/1] utils: analyze custom check: remove trailing newline for error output
      commit: bf7af96e07283f36a98abd71bc318ee41d118c75

Best regards,
-- 
Fabian Grünbichler <f.gruenbichler@proxmox.com>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-15 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11  9:25 [PATCH pmg-api] utils: analyze custom check: remove trailing newline for error output Dominik Csapak
2026-07-15 13:10 ` applied: " Fabian Grünbichler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal