Verified Commit 6f7e2709 authored by Florian Pritz's avatar Florian Pritz
Browse files

zabbix/borg: Force scalar context for borg output

This ensure compatability with JSON::PP which accepts a list rather than
only a single argument.

Signed-off-by: Florian Pritz's avatarFlorian Pritz <>
parent aa4b9582
......@@ -6,7 +6,7 @@ use autodie;
use JSON::XS;
use POSIX;
my $json = decode_json(`sudo /usr/local/bin/borg list --json --format '{start}{end}' --sort-by timestamp --last 1`);
my $json = decode_json(scalar(`sudo /usr/local/bin/borg list --json --format '{start}{end}' --sort-by timestamp --last 1`));
print encode_json({
last_archive => {
is_checkpoint => $json->{archives}[0]->{archive} =~ m/.checkpoint$/ ? 1 : 0,
......@@ -4,7 +4,7 @@
pacman: name=zabbix-agent,python-dbus
- name: install packages for borg monitoring
pacman: name=perl-json-xs
pacman: name=perl-json
when: "'borg-clients' in group_names"
- name: install packages for nginx monitoring
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment