From 34d7d3a1b0545fca84eeb959d05823689dde1f19 Mon Sep 17 00:00:00 2001 From: Alan Hodgson Date: Wed, 16 Dec 2015 11:27:40 -0800 Subject: [PATCH] Fix output and performance output values. --- check_json.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_json.pl b/check_json.pl index 5d16d81..95553e4 100755 --- a/check_json.pl +++ b/check_json.pl @@ -208,7 +208,7 @@ if ($np->opts->perfvars) { # make label ascii compatible $label =~ s/[^a-zA-Z0-9_-]//g ; my $perf_value; - $perf_value = eval '$json_response->'.$key; + $perf_value = $json_response->{$key}; if ($np->opts->verbose) { print Dumper ("JSON key: ".$label.", JSON val: " . $perf_value) }; if ( defined($perf_value) ) { # add threshold if attribute option matches key @@ -237,9 +237,9 @@ if ($np->opts->outputvars) { my $label = (split('->', $key))[-1]; # make label ascii compatible $label =~ s/[^a-zA-Z0-9_-]//g; - my $perf_value; - $perf_value = eval '$json_response->'.$key; - push(@statusmsg, "$label: $perf_value"); + my $output_value; + $output_value = $json_response->{$key}; + push(@statusmsg, "$label: $output_value"); } }