Skip to content

Commit

Permalink
add -a for .data.history
Browse files Browse the repository at this point in the history
  • Loading branch information
VVelox committed Jul 18, 2024
1 parent 4d33a23 commit 80bc102
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions snmp/poudriere
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ poudriere - LibreNMS JSON style SNMP extend for monitoring Poudriere
=head1 VERSION
0.1.0
0.2.0
=head1 SYNOPSIS
poudriere [B<-w>] [B<-b>] [B<-o> <cache base>]
poudriere [B<-w>] [B<-b>] [B<-o> <cache base>] [B<-a>]x
poudriere --help|-h
Expand All @@ -26,6 +26,10 @@ or if using cron...
=head1 FLAGS
=head2 -a
Include `poudriere status -a` as .data.history .
=head2 -w
Write the results out.
Expand Down Expand Up @@ -115,7 +119,9 @@ my $write;
my $compress;
my $version;
my $help;
my $history;
GetOptions(
a => \$history,
'o=s' => \$cache_base,
w => \$write,
b => \$compress,
Expand Down Expand Up @@ -447,6 +453,13 @@ if ( $? == 0 ) {
}
} ## end elsif ( $line =~ /^\[.*\].*\:.*\|.*\:/ )
} ## end foreach my $line (@build_info_split)

#
# include this history if asked to
#
if ($history) {
$data->{history} = `poudriere -N status -a 2> /dev/null`;
}
} else {
$to_return->{error} = 1;
$to_return->{errorString} = 'non-zero exit for "poudriere status -f"';
Expand Down

0 comments on commit 80bc102

Please sign in to comment.