[rudder-users] Get number of package to be upgraded (apt)

Julien Escario escario at azylog.net
Mon Aug 24 15:36:39 CEST 2015


Hello,
I'm currently trying to 'play' a bit with rudder to check if this could help us
to manage our managed servers, all Linux.

My first goal is to get the number of package that should be upgraded on a
machine with 'apt-get upgrade'.

So, I made a technique 'Nb of packages upgradable by apt' which run :
/bin/sh -c \'! /usr/bin/apt-get -s upgrade | /bin/grep Inst|wc -l\'

On a machine, this return the number of packages that would have been upgraded
by apt-get upgrade.

Next, I made a directive using this technique. This is probably where I'm wrong.
It seems there's nothing to specify except the technique used and rule to be
applied.
I checked the 'Global configuration for all nodes' rule and then goes to node ->
Reports. I can see an item with my rule, directive, component and value.
Value is my command and status is showing 'Missing'.

By checking the log on the machine, here are the revelant lines (hope at least) :
Aug 24 15:17:52 testmachine rudder[799]:
/default/Nb_of_packages_upgradable_by_apt/methods/'method_call'/default/command_execution/commands/'/bin/sh
-c '! /usr/bin/apt-get -s upgrade | /bin/grep Inst|wc -l''[0]: Finished command
related to promiser '/bin/sh -c '! /usr/bin/apt-get -s upgrade | /bin/grep
Inst|wc -l'' -- an error occurred, returned 1
Aug 24 15:17:52 testmachine rudder[799]:
/default/Nb_of_packages_upgradable_by_apt/methods/'method_call'/default/command_execution/commands/'/bin/sh
-c '! /usr/bin/apt-get -s upgrade | /bin/grep Inst|wc -l''[0]: Q: ".../bin/sh -c
'! /": 125
Aug 24 15:17:52 testmachine rudder[799]: R: [ERROR] Promise could not be
repaired, error encountered: Execute the command /bin/sh -c '! /usr/bin/apt-get
-s upgrade | /bin/grep Inst|wc -l'
Aug 24 15:17:53 testmachine rudder[799]:
/default/Nb_of_packages_upgradable_by_apt/methods/'method_call'[0]: Method
'command_execution' failed in some repairs

Not so good for a first try ;-)

So is this possible and ... how ?

Thanks,
Julien Escario (yeah, in France too)

-------------- 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/6bbba2c3/attachment.bin>


More information about the rudder-users mailing list