From 80bc102a82e451eaee97f5c11c11090c1129eb86 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Thu, 18 Jul 2024 07:11:50 -0500 Subject: [PATCH] add -a for .data.history --- snmp/poudriere | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/snmp/poudriere b/snmp/poudriere index 36244c4f5..6c20260e0 100755 --- a/snmp/poudriere +++ b/snmp/poudriere @@ -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> ] +poudriere [B<-w>] [B<-b>] [B<-o> ] [B<-a>]x poudriere --help|-h @@ -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. @@ -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, @@ -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"';