From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZdlU-0005Ej-Nx for guix-patches@gnu.org; Wed, 19 Dec 2018 10:28:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZdlT-0006Bw-KZ for guix-patches@gnu.org; Wed, 19 Dec 2018 10:28:04 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:50722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZdlT-0006BG-E8 for guix-patches@gnu.org; Wed, 19 Dec 2018 10:28:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gZdlT-0001Mq-7G for guix-patches@gnu.org; Wed, 19 Dec 2018 10:28:03 -0500 Subject: [bug#33549] [PATCH 6/6] services: monitoring: Add 'zabbix-front-end'. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20181129185042.6050-1-go.wigust@gmail.com> <20181129185042.6050-6-go.wigust@gmail.com> Date: Wed, 19 Dec 2018 16:27:37 +0100 In-Reply-To: <20181129185042.6050-6-go.wigust@gmail.com> (Oleg Pykhalov's message of "Thu, 29 Nov 2018 21:50:42 +0300") Message-ID: <87efadv8nq.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Oleg Pykhalov Cc: 33549@debbugs.gnu.org Hi Oleg, Oleg Pykhalov skribis: > +(define zabbix-front-end-config > + (match-lambda > + (($ > + _ db-host db-port db-name db-user db-password db-secret-file > + zabbix-host zabbix-port) > + (mixed-text-file "zabbix.conf.php" > + "\ > + +// Zabbix GUI configuration file. > +global $DB; > + > +$DB['TYPE'] =3D 'POSTGRESQL'; > +$DB['SERVER'] =3D '" db-host "'; > +$DB['PORT'] =3D '" (number->string db-port) "'; > +$DB['DATABASE'] =3D '" db-name "'; > +$DB['USER'] =3D '" db-user "'; > +$DB['PASSWORD'] =3D '" (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'] =3D ''; > + > +$ZBX_SERVER =3D '" zabbix-host "'; > +$ZBX_SERVER_PORT =3D '" (number->string zabbix-port) "'; > +$ZBX_SERVER_NAME =3D ''; > + > +$IMAGE_FORMAT_DEFAULT =3D IMAGE_FORMAT_PNG; > +")))) I saw these =E2=80=9Chints=E2=80=9D in the build log of Cuirass and that go= t me curious. :-) A couple of comments=E2=80=A6 For consistency, hints should be reported us= ing the =E2=80=98display-hint=E2=80=99 procedure, which takes a Texinfo string = as input. Second, while the second =E2=80=98display=E2=80=99 call does look like a hi= nt, the first one looks like it should be an error, shouldn=E2=80=99t it? In that case, = I=E2=80=99d suggest something like: (raise (condition (&message (message "You must provide either 'db-secret-file' or 'db-passw= ord'.")))) Third, it would be nice to report source location info along with hints and errors. To do that, you could add an innate =E2=80=98location=E2=80=99= field to as done for . 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=E2=80=99ll probably put it to good = use on the build farm! Ludo=E2=80=99.