From 72d0293253c6d073e08d56995a79744cd898033a Mon Sep 17 00:00:00 2001 From: divanikus Date: Sat, 8 Sep 2018 14:47:50 +0300 Subject: [PATCH] Quote key name if it contain spaces in ZabbixSender --- lib/salus/renderer/zabbixsender.rb | 1 + lib/salus/version.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/salus/renderer/zabbixsender.rb b/lib/salus/renderer/zabbixsender.rb index 9a4ae4a..effbd6a 100644 --- a/lib/salus/renderer/zabbixsender.rb +++ b/lib/salus/renderer/zabbixsender.rb @@ -8,6 +8,7 @@ def render(data) unless metric.timestamp.nil? timestamp = metric.timestamp.to_i name = name.gsub(/\.\[/, '[') + name = name.to_json if (name.match(/\s/)) value = metric.value value = '""' if value.nil? value = value.to_json if (!value.nil? && metric.is_a?(Salus::Text)) diff --git a/lib/salus/version.rb b/lib/salus/version.rb index 4ef8573..bb588dc 100644 --- a/lib/salus/version.rb +++ b/lib/salus/version.rb @@ -1,3 +1,3 @@ module Salus - VERSION = "0.1.2" + VERSION = "0.1.3" end