https://issues.rudder.io/https://issues.rudder.io/themes/rudder7/favicon/favicon.ico?17096450182015-10-05T13:27:28ZIssue TrackerRudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=461982015-10-05T13:27:28ZMatthieu CERDAmatthieu.cerda@normation.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Discussion</i></li><li><strong>Assignee</strong> set to <i>Janos Mattyasovszky</i></li><li><strong>Priority</strong> changed from <i>N/A</i> to <i>4</i></li><li><strong>Target version</strong> set to <i>Ideas (not version specific)</i></li></ul><p>Hello Janos,</p>
<p>All the inventories that the server receives are also dropped in /var/rudder/inventories/received, maybe you could monitor those files instead ?</p> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=462012015-10-05T15:09:19ZJanos Mattyasovszky
<ul></ul><p>The Background for the request: We are having a very extensive Nagios-Monitoring set up, that is checking all our systems over SSH, and is executing local tests, and according to that, creates notification, that is hooked into a ticketing system, and according to the host the notification is originating to, the appropriate support group is determined...</p>
The idea would be good to start with, however, it has some bottlenecks, you'd need to:
<ul>
<li>monitor server-A if you would check for server-B's inventory;</li>
<li>somehow parse the inventory to get the info of which node's inventory you are actually checking for;</li>
<li>have some kind of inotify set up, as the agent's run forwards the inventory and removes if afterwards;</li>
</ul>
<p>There is currently a file being updated when the policy is fetched from the policy server, we'd be happy to have a similar file when the inventory upload has been executed successfully (I don't think the effort in touching a file on a successful upload would be that hard or break anything, as it's a new file).</p>
<p>Proposed patchset:</p>
<pre>
# diff -u8 /var/rudder/cfengine-community/inputs/inventory/1.0/fusionAgent.cf{.orig,}
--- /var/rudder/cfengine-community/inputs/inventory/1.0/fusionAgent.cf.orig 2015-10-05 16:54:38.000000000 +0200
+++ /var/rudder/cfengine-community/inputs/inventory/1.0/fusionAgent.cf 2015-10-05 17:02:17.000000000 +0200
@@ -442,16 +442,21 @@
!windows.inventory_sent.!cant_send_inventory::
"${g.rudder_inventories}"
transformer => "${g.rudder_rm} -f ${this.promiser}",
depth_search => recurse_visible(1),
file_select => inventory_files,
classes => if_else("inventory_file_deleted", "cant_delete_inventory_file"),
comment => "Cleaning up inventory files already sent to the server";
+ "${g.rudder_base}/etc/inventory_uploaded"
+ create => "true",
+ touch => "true",
+ comment => "Create local info about successful upload";
+
"${g.rudder_var_tmp}/inventory"
transformer => "${g.rudder_rm} -f ${this.promiser}",
depth_search => recurse_visible(1),
file_select => inventory_files,
classes => if_else("inventory_file_deleted", "cant_delete_inventory_file"),
comment => "Cleaning up inventory files already sent to the server";
reports:
</pre>
<p>Test looks OK:</p>
<pre>
node:~ # ll /opt/rudder/etc/inventory_uploaded
-rw------- 1 root root 0 Oct 5 17:01 /opt/rudder/etc/inventory_uploaded
node:~ # rudder agent inventory > /dev/null
node:~ # ll /opt/rudder/etc/inventory_uploaded
-rw------- 1 root root 0 Oct 5 17:04 /opt/rudder/etc/inventory_uploaded
node:~ #
</pre> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=462662015-10-09T14:33:05ZBenoît PECCATTEbenoit.peccatte@rudder.io
<ul></ul><p>Janos, there is indeed something that is touched when an inventory is sent, it's the inventory directory.</p>
<p>If the last inventory has failed to be sent, this directory contains the inventory file.<br />Otherwise, the modification time of this directory is the last successful inventory time.</p>
<p>Is this enough for you or do you still need a specific file to be touched ?</p> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=463652015-10-15T07:58:29ZJanos Mattyasovszky
<ul></ul><p>Well, the problem is if I'd like to check for a valid inventory sent, I'd have to check the dir's timestamp and also if there are any files within. <br />That would be a lot of error-prone than just having to check the modification time of a dedicated file. <br />As the classes are already defined and used, the change would be minor (however, probably not what I googled together on cf-engine syntax...). <br />I would be happy if that additional file-touching could be implemented...</p> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=463662015-10-15T08:29:21ZBenoît PECCATTEbenoit.peccatte@rudder.io
<ul></ul><p>OK, we just need to define the right place to put the timestamp file.<br />It doesn't really belong to etc/ <br />I'd prefer to use something like /opt/rudder/var/fusioninventory or something under /var/rudder/tmp/</p> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=463822015-10-15T20:14:34ZJanos Mattyasovszky
<ul><li><strong>Pull Request</strong> set to <i>https://github.com/Normation/rudder-techniques/pull/757</i></li></ul><p>Proposing PR:<br /><a class="external" href="https://github.com/Normation/rudder-techniques/pull/757">https://github.com/Normation/rudder-techniques/pull/757</a></p> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=463882015-10-16T09:41:21ZJanos Mattyasovszky
<ul></ul><p>Related to <a class="issue tracker-2 status-5 priority-16 priority-default closed" title="User story: Add info about last time inventory and policy updated to rudder agent info (Released)" href="https://issues.rudder.io/issues/7282">#7282</a></p> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=467802015-10-16T14:02:06ZAnonymous
<ul><li><strong>Status</strong> changed from <i>Discussion</i> to <i>Pending release</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="Fixes #7206: Touch file on inventory sent This fix creates and keeps a file updated whenever an ..." href="https://issues.rudder.io/projects/rudder/repository/rudder-techniques/revisions/59ed05c4b05f291337da779899adb4ee472f2df6">rudder-techniques|59ed05c4b05f291337da779899adb4ee472f2df6</a>.</p> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=467812015-10-16T14:02:08ZBenoît PECCATTEbenoit.peccatte@rudder.io
<ul></ul><p>Applied in changeset <a class="changeset" title="Merge pull request #757 from matya/patch-7206-touch-on-inventory-upload Fixes #7206: Touch file ..." href="https://issues.rudder.io/projects/rudder/repository/rudder-techniques/revisions/b4d4d6ea9b58175fcc478b250671388fbd12879d">rudder-techniques|b4d4d6ea9b58175fcc478b250671388fbd12879d</a>.</p> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=474082015-10-29T10:05:11ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Category</strong> changed from <i>Agent</i> to <i>System techniques</i></li><li><strong>Target version</strong> changed from <i>Ideas (not version specific)</i> to <i>2.11.16</i></li></ul> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=474092015-10-29T10:07:17ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Status</strong> changed from <i>Pending release</i> to <i>Released</i></li></ul><p>This bug has been fixed in Rudder 2.11.16, 3.0.11 and 3.1.4 which were released today. </p>
<ul>
<li>2.11: <a href="http://www.rudder-project.org/pipermail/rudder-announce/2015-October/000167.html" class="external">Announce</a> <a href="http://www.rudder-project.org/foswiki/bin/view/System/Documentation:ChangeLog211" class="external">Changelog</a></li>
<li>3.0: <a href="http://www.rudder-project.org/pipermail/rudder-announce/2015-October/000165.html" class="external">Announce</a> <a href="http://www.rudder-project.org/foswiki/bin/view/System/Documentation:ChangeLog30" class="external">Changelog</a></li>
<li>3.1: <a href="http://www.rudder-project.org/pipermail/rudder-announce/2015-October/000164.html" class="external">Announce</a> <a href="http://www.rudder-project.org/foswiki/bin/view/System/Documentation:ChangeLog31" class="external">Changelog</a></li>
<li>Download: <a class="external" href="https://www.rudder-project.org/site/get-rudder/downloads/">https://www.rudder-project.org/site/get-rudder/downloads/</a></li>
</ul> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=474102015-10-29T10:15:55ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Status</strong> changed from <i>Released</i> to <i>Pending release</i></li><li><strong>Target version</strong> changed from <i>2.11.16</i> to <i>Ideas (not version specific)</i></li></ul> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=474112015-10-29T10:17:13ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> deleted (<del><i>Ideas (not version specific)</i></del>)</li></ul> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=474122015-10-29T10:43:36ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> set to <i>2.11.16</i></li></ul> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=507932016-01-15T13:37:36ZJonathan CLARKEjonathan.clarke@normation.com
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-16 priority-default closed" href="/issues/7782">Bug #7782</a>: inventory sent file timestamp not updated in normal run (system techniques)</i> added</li></ul> Rudder - User story #7206: Touch local file on inventory uploadhttps://issues.rudder.io/issues/7206?journal_id=507962016-01-15T13:47:32ZJonathan CLARKEjonathan.clarke@normation.com
<ul><li><strong>Status</strong> changed from <i>Pending release</i> to <i>Released</i></li></ul>