services: zabbix-front-end: Improve hint and error messages.

* gnu/services/monitoring.scm (zabbix-front-end-config): Improve hint and
error messages.
This commit is contained in:
Oleg Pykhalov 2018-12-19 20:47:15 +03:00
parent 9a50cedc6b
commit 0485717ee9
No known key found for this signature in database
GPG key ID: 167F8EA5001AFA9C

View file

@ -29,9 +29,11 @@ (define-module (gnu services monitoring)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix records)
#:use-module ((guix ui) #:select (display-hint))
#:use-module (ice-9 match)
#:use-module (ice-9 rdelim)
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-35)
#:export (darkstat-configuration
prometheus-node-exporter-configuration
darkstat-service-type
@ -525,16 +527,16 @@ (define zabbix-front-end-config
$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))
(raise (condition
(&message
(message "\
You must provide either 'db-secret-file' or 'db-password'."))))
(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
(display-hint "
Consider use `db-secret-file' instead of `db-password' and unset
`db-password' for security in `zabbix-front-end-configuration'.
")
db-password)) "';