unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Oleg Pykhalov <go.wigust@gmail.com>
Cc: 33549@debbugs.gnu.org
Subject: [bug#33549] [PATCH 6/6] services: monitoring: Add 'zabbix-front-end'.
Date: Wed, 19 Dec 2018 16:27:37 +0100	[thread overview]
Message-ID: <87efadv8nq.fsf@gnu.org> (raw)
In-Reply-To: <20181129185042.6050-6-go.wigust@gmail.com> (Oleg Pykhalov's message of "Thu, 29 Nov 2018 21:50:42 +0300")

Hi Oleg,

Oleg Pykhalov <go.wigust@gmail.com> skribis:

> +(define zabbix-front-end-config
> +  (match-lambda
> +    (($ <zabbix-front-end-configuration>
> +        _ db-host db-port db-name db-user db-password db-secret-file
> +        zabbix-host zabbix-port)
> +     (mixed-text-file "zabbix.conf.php"
> +                      "\
> +<?php
> +// Zabbix GUI configuration file.
> +global $DB;
> +
> +$DB['TYPE']     = 'POSTGRESQL';
> +$DB['SERVER']   = '" db-host "';
> +$DB['PORT']     = '" (number->string db-port) "';
> +$DB['DATABASE'] = '" db-name "';
> +$DB['USER']     = '" db-user "';
> +$DB['PASSWORD'] = '" (if (string-null? db-password)
> +                         (if (string-null? db-secret-file)
> +                             (display "Provide a `db-secret-file' \
> +or `db-password' field.
> +"
> +                                      (current-error-port))
> +                             (string-trim-both
> +                              (with-input-from-file db-secret-file
> +                                read-string)))
> +                         (begin
> +                           (display "
> +Hint: Consider use `db-secret-file' instead of `db-password' and unset
> +`db-password' in `zabbix-front-end-configuration' for security.
> +")
> +                           db-password)) "';
> +
> +// Schema name. Used for IBM DB2 and PostgreSQL.
> +$DB['SCHEMA'] = '';
> +
> +$ZBX_SERVER      = '" zabbix-host "';
> +$ZBX_SERVER_PORT = '" (number->string zabbix-port) "';
> +$ZBX_SERVER_NAME = '';
> +
> +$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
> +"))))

I saw these “hints” in the build log of Cuirass and that got me curious.
:-)

A couple of comments…  For consistency, hints should be reported using
the ‘display-hint’ procedure, which takes a Texinfo string as input.

Second, while the second ‘display’ call does look like a hint, the first
one looks like it should be an error, shouldn’t it?  In that case, I’d
suggest something like:

  (raise (condition
           (&message
            (message "You must provide either 'db-secret-file' or 'db-password'."))))

Third, it would be nice to report source location info along with hints
and errors.  To do that, you could add an innate ‘location’ field to
<zabbix-front-end-configuration> as done for <package>.  Then, along
with the &message condition above, you could raise an &error-location as
is done in a few places.

Does that make sense?

Anyway thanks for this patch series, we’ll probably put it to good use
on the build farm!

Ludo’.

  reply	other threads:[~2018-12-19 15:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 18:47 [bug#33549] [PATCH 0/6] Add Zabbix services Oleg Pykhalov
2018-11-29 18:50 ` [bug#33549] [PATCH 1/6] gnu: zabbix-server: Split output Oleg Pykhalov
2018-11-29 18:50   ` [bug#33549] [PATCH 2/6] services: monitoring: Add 'zabbix-server' Oleg Pykhalov
2018-11-29 18:50   ` [bug#33549] [PATCH 3/6] services: monitoring: Add 'zabbix-agent' Oleg Pykhalov
2018-11-29 18:50   ` [bug#33549] [PATCH 4/6] services: php-fpm: Add 'timezone' configuration Oleg Pykhalov
2018-11-29 18:50   ` [bug#33549] [PATCH 5/6] gnu: Add php-with-bcmath Oleg Pykhalov
2018-12-19 15:20     ` Ludovic Courtès
2018-11-29 18:50   ` [bug#33549] [PATCH 6/6] services: monitoring: Add 'zabbix-front-end' Oleg Pykhalov
2018-12-19 15:27     ` Ludovic Courtès [this message]
2018-12-19 18:27       ` Oleg Pykhalov
2018-12-20 11:06         ` Ludovic Courtès
2018-12-17 19:22 ` bug#33549: Status: [PATCH 0/6] Add Zabbix services Oleg Pykhalov

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efadv8nq.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=33549@debbugs.gnu.org \
    --cc=go.wigust@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).