[rudder-users] Get number of package to be upgraded (apt)
Julien Escario
escario at azylog.net
Mon Aug 24 18:23:24 CEST 2015
Le 24/08/2015 17:43, Nicolas Charles a écrit :
> The workaround I can suggest is to use the command
>
> ! /usr/bin/apt-get -s upgrade | /bin/grep Inst|wc -l
>
> which would do the same.
OK, works exactly as expected. Got a big red error, just how I like them ;-)
> The consequence will be that the Directive will return status:
>
> * Repaired if there are no package to upgrade
> * Error if there are packages to upgrade
>
> The logic is that command_execution will return status "Repaired" for exit code
> 0, and "Error" for non exit code 0
>
>
> Does that do what you want ?
Yup, more or less. It would be nice to be able to report something else than 0
or 1. To comply with directive, a 'threshold' should be added.
But I'm perhaps far from the concept of rudder.
At least, I have an information about system being up-to-date or not. Added with
a few packahe version check for critical packages (openssl, bind, ssh, ...), I
think we'll be able to get a start of what we need.
Lemme check this a couple hours more and I'll come back with more questions
about how to do this or that ;-)
Thanks for your help,
Julien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3685 bytes
Desc: Signature cryptographique S/MIME
URL: <http://www.rudder-project.org/pipermail/rudder-users/attachments/20150824/b85ede5d/attachment.bin>
More information about the rudder-users
mailing list