Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add smart-v1, a new JSON based smart poller #474

Merged
merged 1 commit into from
Jun 20, 2023
Merged

add smart-v1, a new JSON based smart poller #474

merged 1 commit into from
Jun 20, 2023

Conversation

VVelox
Copy link
Collaborator

@VVelox VVelox commented Jun 20, 2023

Now also grabs....

  • general health status
  • FW version
  • selftest log
  • make
  • model
  • disk + serial

@VVelox VVelox merged commit 3bb4694 into master Jun 20, 2023
7 checks passed
@VVelox VVelox deleted the smartupdate branch June 20, 2023 02:00
@bnerickson
Copy link
Contributor

bnerickson commented Jun 20, 2023

Hello @VVelox ,

Is there any particular reason why you used the Gzip::Faster perl plugin as opposed to the PerlIO::gzip perl plugin? FWIW I'm not familiar with either, so it may be that the latter isn't a drop-in replacement anyway.

I ask because RPM-based distros appear to lack broad package support for Gzip::Faster while supporting PerlIO::gzip across a wider spectrum of distros. I'd personally rather install the modules via yum/dnf instead of cpan.

@VVelox
Copy link
Collaborator Author

VVelox commented Jun 20, 2023

Hello @VVelox ,

Is there any particular reason why you used the Gzip::Faster perl plugin as opposed to the PerlIO::gzip perl plugin? FWIW I'm not familiar with either, so it may be that the latter isn't a drop-in replacement anyway.

I ask because RPM-based distros appear to lack broad package support for Gzip::Faster while supporting PerlIO::gzip across a wider spectrum of distros. I'd personally rather install the modules via yum/dnf instead of cpan.

Because PerlIO is designed around file IO and not string handling.

Yeah, this is one area where how terrible RPM and DPKG based systems really are. They are a major PITA to add any new packages for given how antiquated the build system is.

@VVelox
Copy link
Collaborator Author

VVelox commented Jun 20, 2023

Yeah, if you have a suggestion on one that handles strings in a similar manner and is available on the various BSDs and Linux distros, let me know. :)

I do know Gzip::Faster is available for FreeBSD via p5-Gzip-Faster and will build nicely on every Linux distro I've used it on.

@bnerickson
Copy link
Contributor

bnerickson commented Jun 20, 2023

Hi @VVelox ,

I'm no perl-whiz, but according to our good friends at Stack Overflow, the same can be accomplished with IO::Compress::Gzip using references to scalars instead of files (\$). I tried it out on my end and it appears to work:

$ sudo diff smart /etc/snmp/smart2
78c78
< use Gzip::Faster;
---
> use IO::Compress::Gzip qw(gzip $GzipError);
523c523,525
<       my $compressed = encode_base64( gzip($toReturn) );
---
>       my $toReturnCompressed;
>       gzip \$toReturn => \$toReturnCompressed;
>       my $compressed = encode_base64( $toReturnCompressed );

edit: IO::Compress::Gzip is provided by the perl-IO-Compress common package: https://pkgs.org/download/perl-IO-Compress

@VVelox
Copy link
Collaborator Author

VVelox commented Jun 27, 2023

IO::Compress::Gzip

Thanks! Used in #476 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants