Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| monitors:rpi-apt [2018/03/11 10:15] – [Description] wnelis | monitors:rpi-apt [2020/01/28 09:50] (current) – [Table] wnelis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== rpi-apt ====== | ====== rpi-apt ====== | ||
| - | ^ Author | [[ wim.nelis@nlr.nl | Wim Nelis ]] | | + | ^ Author |
| - | ^ Compatibility | Xymon 4.2 | | + | ^ Compatibility |
| - | ^ Requirements | Perl | | + | ^ Requirements |
| - | ^ Download | None | | + | ^ Download |
| - | ^ Last Update | 2018-03-11 | | + | ^ Last Update |
| ===== Description ===== | ===== Description ===== | ||
| Line 23: | Line 23: | ||
| # | # | ||
| # | # | ||
| - | # Script apt.pl is a xymon client-side script. It retrieves the list of | + | # Script |
| # outstanding patches for raspbian. These are divided into two groups, | # outstanding patches for raspbian. These are divided into two groups, | ||
| # security-related and the rest. At the same time, this script will reguarly | # security-related and the rest. At the same time, this script will reguarly | ||
| Line 40: | Line 40: | ||
| my $XyDisp | my $XyDisp | ||
| my $XySend | my $XySend | ||
| - | my $XyLife | + | my $XyLife |
| my $FmtDate = " | my $FmtDate = " | ||
| | | ||
| Line 86: | Line 86: | ||
| sub UpdatePackageListCache() { | sub UpdatePackageListCache() { | ||
| my (@Time, | my (@Time, | ||
| - | | + | |
| @Lines= `stat $uplcFileName` ; # Cache file statistics | @Lines= `stat $uplcFileName` ; # Cache file statistics | ||
| - | return unless @Lines ; # Ignore error condition | + | return unless @Lines ; # Ignore error condition |
| - | + | ||
| foreach ( @Lines ) { | foreach ( @Lines ) { | ||
| next unless @Time= m/^Modify: (\d{4})-(\d+)-(\d+) (\d+): | next unless @Time= m/^Modify: (\d{4})-(\d+)-(\d+) (\d+): | ||
| Line 95: | Line 95: | ||
| $Time= timelocal( reverse @Time ) ; # Compute time stamp | $Time= timelocal( reverse @Time ) ; # Compute time stamp | ||
| return if time - $Time < $uplcRefreshAge ; | return if time - $Time < $uplcRefreshAge ; | ||
| - | | + | |
| `$uplcRefreshCmd` ; # Update package list cache | `$uplcRefreshCmd` ; # Update package list cache | ||
| last ; # Skip rest of lines | last ; # Skip rest of lines | ||
| Line 121: | Line 121: | ||
| # | # | ||
| if ( $InPostponed ) { | if ( $InPostponed ) { | ||
| - | if ( m/^\s\s(\S+)/ ) { | + | if ( m/^\s\s\S/ ) { |
| - | $UPL{Postponed}{$1}= [ $1, '?', | + | foreach my $pn ( split ) { |
| + | next unless defined $pn; | ||
| + | | ||
| + | $upCnt++ ; | ||
| + | } # of foreach | ||
| next ; # Line is handled | next ; # Line is handled | ||
| } else { | } else { | ||
| - | $InPostponed= 0 ; # Enf o section found | + | $InPostponed= 0 ; # End of section found |
| } # of else | } # of else | ||
| } elsif ( m/^The following packages have been kept back/ ) { | } elsif ( m/^The following packages have been kept back/ ) { | ||
| Line 139: | Line 144: | ||
| } # of else | } # of else | ||
| $upCnt++ ; | $upCnt++ ; | ||
| - | + | } # of if | |
| - | } elsif ( m/^Conf / ) { | + | |
| - | # | + | |
| - | + | ||
| - | } else { | + | |
| - | next unless $upCnt ; | + | |
| - | print "$Now : $_\n" ; | + | |
| - | | + | |
| } # of foreach | } # of foreach | ||
| } # of GetListOfUpdates | } # of GetListOfUpdates | ||
| Line 177: | Line 175: | ||
| return if $upCnt == 0 and keys(%{$UPL{Postponed}}) == 0 ; | return if $upCnt == 0 and keys(%{$UPL{Postponed}}) == 0 ; | ||
| - | | + | |
| $Result.= " | $Result.= " | ||
| $Result.= "< | $Result.= "< | ||
| Line 212: | Line 210: | ||
| GetListOfUpdates ; # Retrieve list of outstanding updates | GetListOfUpdates ; # Retrieve list of outstanding updates | ||
| BuildMessage ; # Build message for xymon | BuildMessage ; # Build message for xymon | ||
| - | InformXymon( ' | + | InformXymon( ' |
| </ | </ | ||
| </ | </ | ||
| Line 249: | Line 247: | ||
| * Initial release | * Initial release | ||
| * **2018-03-11** | * **2018-03-11** | ||
| - | * Report the packages which are kept back too | + | * Report the packages which are kept back too |
| + | * **2020-01-28** | ||
| + | * Improve detection of kept-back-upgrades | ||