mirror of
https://github.com/c-kr/check_json.git
synced 2024-11-23 10:53:47 +01:00
Fix output and performance output values.
This commit is contained in:
parent
f3233fb247
commit
34d7d3a1b0
@ -208,7 +208,7 @@ if ($np->opts->perfvars) {
|
|||||||
# make label ascii compatible
|
# make label ascii compatible
|
||||||
$label =~ s/[^a-zA-Z0-9_-]//g ;
|
$label =~ s/[^a-zA-Z0-9_-]//g ;
|
||||||
my $perf_value;
|
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 ($np->opts->verbose) { print Dumper ("JSON key: ".$label.", JSON val: " . $perf_value) };
|
||||||
if ( defined($perf_value) ) {
|
if ( defined($perf_value) ) {
|
||||||
# add threshold if attribute option matches key
|
# add threshold if attribute option matches key
|
||||||
@ -237,9 +237,9 @@ if ($np->opts->outputvars) {
|
|||||||
my $label = (split('->', $key))[-1];
|
my $label = (split('->', $key))[-1];
|
||||||
# make label ascii compatible
|
# make label ascii compatible
|
||||||
$label =~ s/[^a-zA-Z0-9_-]//g;
|
$label =~ s/[^a-zA-Z0-9_-]//g;
|
||||||
my $perf_value;
|
my $output_value;
|
||||||
$perf_value = eval '$json_response->'.$key;
|
$output_value = $json_response->{$key};
|
||||||
push(@statusmsg, "$label: $perf_value");
|
push(@statusmsg, "$label: $output_value");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user