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

handle a edge case that seems to affect some Linux installs for ZFS #523

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions snmp/zfs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ zfs - LibreNMS JSON SNMP extend for gathering backups for ZFS

=head1 VERSION

0.1.0
0.1.1

=head1 DESCRIPTION

Expand Down Expand Up @@ -80,8 +80,6 @@ use MIME::Base64;
use IO::Compress::Gzip qw(gzip $GzipError);
use Pod::Usage;

#$Getopt::Std::STANDARD_HELP_VERSION = 1;

sub main::VERSION_MESSAGE {
pod2usage( -exitval => 255, -verbose => 99, -sections => qw(VERSION), -output => \*STDOUT, );
}
Expand Down Expand Up @@ -289,6 +287,13 @@ my $recently_used_percent;
my $frequently_used_percent;
if ( !defined( $stats_stuff->{p} ) && defined( $stats_stuff->{mfu_size} ) ) {
$stats_stuff->{p} = $stats_stuff->{size} - $stats_stuff->{mfu_size};
} elsif ( !defined( $stats_stuff->{p} )
&& !defined( $stats_stuff->{mfu_size} )
&& defined( $stats_stuff->{pd} && defined( $stats_stuff->{pm} ) ) )
{
# see https://github.com/librenms/librenms-agent/issues/518
# this should set the value for p in those cases
$stats_stuff->{p} = $stats_stuff->{pd} + $stats_stuff->{pm};
}
if ( $stats_stuff->{size} >= $stats_stuff->{c} ) {
if ( !defined($mfu_size) ) {
Expand Down
Loading