2

I'm trying to use a User Technique in Rudder to monitor if my nodes has pending package updates. I create a Technique that execute: /usr/bin/apt-get update && /usr/bin/apt-get list --upgradable

I also want to create another Technique to execute a command and get the free disk space.

I only get the non compliant report but I want to see the output of this commands in any place on Rudder server.

Is there any way to do that?

kattunga
  • 43
  • 4

1 Answers1

1

Output of commands are not kept by Rudder agent, I guess the best way to achieve this is to redirect the output of your command to a file then send this command back to Rudder Server using "Shared file to node" method (though there is a bug (https://www.rudder-project.org/redmine/issues/11869) in that method, I'll explain it to you below).

Here is a screenshot of the technique i created

pending_upgrade technique

File pending_upgrade will be available in /var/rudder/shared-files/root/files/nodeId/pending_upgrade

How to fix the bug:

sed -i s/classes_generic(/if_ok(/ /usr/share/ncf/tree/30_generic_methods/sharedfile_to_node.cf

On a side note: the command you are using does not work, apt-get list does not exists, and you should use apt instead, which result in the following command:

/usr/bin/apt-get update && /usr/bin/apt list --upgradable