add support for base64+gzip and bump to 0.2.0
This commit is contained in:
parent
baf8c1c925
commit
7b1f5b64c7
3
Changes
3
Changes
|
@ -1,5 +1,8 @@
|
|||
Revision history for Monitoring-Sneck-Boop_Snoot
|
||||
|
||||
0.2.0 2022-08-01/15:15
|
||||
-Add support for base64+gzip returns.
|
||||
|
||||
0.1.1 2022-05-07/03:30
|
||||
-Correct the exit code for -n on OK.
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@ my %WriteMakefileArgs = (
|
|||
PREREQ_PM => {
|
||||
'JSON' => '0',
|
||||
'String::ShellQuote' => '0',
|
||||
'MIME::Base64' => '0',
|
||||
'Gzip::Faster' => '0',
|
||||
},
|
||||
META_MERGE => {
|
||||
"meta-spec" => { version => 2 },
|
||||
|
|
|
@ -4,6 +4,8 @@ use 5.006;
|
|||
use strict;
|
||||
use warnings;
|
||||
use String::ShellQuote;
|
||||
use MIME::Base64;
|
||||
use Gzip::Faster;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
@ -11,11 +13,11 @@ Monitoring::Sneck::Boop_Snoot - Boop the Monitoring::Sneck's snoot via SNMP
|
|||
|
||||
=head1 VERSION
|
||||
|
||||
Version 0.1.1
|
||||
Version 0.2.0
|
||||
|
||||
=cut
|
||||
|
||||
our $VERSION = '0.1.1';
|
||||
our $VERSION = '0.2.0';
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
@ -155,6 +157,11 @@ sub boop_the_snoot {
|
|||
$json =~ s/^\"//;
|
||||
$json =~ s/\"$//;
|
||||
|
||||
# check for base64 incasae the return has been gzipped
|
||||
if ($json =~ /^[A-Za-z0-9\/\+\n]+\=*\n*$/ ) {
|
||||
$json = gunzip(decode_base64($json));
|
||||
}
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue