[#159] Macsuck archive behaviour same as ND1 (unseen nodes remain active)
This commit is contained in:
		| @@ -7,6 +7,7 @@ | ||||
|   * [#164] Workers should restart periodically | ||||
|   * [#168] Jobs requested via web UI are treated as high priority | ||||
|   * [#162] Change from Net::MAC to NetAddr::MAC | ||||
|   * [#159] Macsuck archive behaviour same as ND1 (unseen nodes remain active) | ||||
|   * Add "Run Expire Job" to the Admin Menu | ||||
|  | ||||
|   [BUG FIXES] | ||||
|   | ||||
| @@ -112,10 +112,15 @@ sub do_macsuck { | ||||
|     $ip, $total_nodes; | ||||
|  | ||||
|   # a use for $now ... need to archive dissapeared nodes | ||||
|   my $archived = schema('netdisco')->resultset('Node')->search({ | ||||
|     switch => $ip, | ||||
|     time_last => { '<' => \$now }, | ||||
|   })->update({ active => \'false' }); | ||||
|   my $archived = 0; | ||||
|  | ||||
|   if (setting('node_freshness')) { | ||||
|       $archived = schema('netdisco')->resultset('Node')->search({ | ||||
|         switch => $ip, | ||||
|         time_last => \[ "< ($now - ?::interval)", | ||||
|           setting('node_freshness') .' minutes' ], | ||||
|       })->update({ active => \'false' }); | ||||
|   } | ||||
|  | ||||
|   debug sprintf ' [%s] macsuck - removed %d fwd table entries to archive', | ||||
|     $ip, $archived; | ||||
|   | ||||
| @@ -741,6 +741,21 @@ Value: Number. Default: 1. | ||||
| Seconds nbtstat will wait for a response before time out.  Accepts fractional | ||||
| seconds as well as integers. | ||||
|  | ||||
| =head3 C<node_freshness> | ||||
|  | ||||
| Value: Number of Minutes. Default: 0 | ||||
|  | ||||
| Controls the behaviour of Netdisco when a node (workstation, printer, etc) has | ||||
| disappeared from the network (device MAC address tables). | ||||
|  | ||||
| If set to 0, the default, nodes will remain on the last-seen switch port until | ||||
| "C<expire_nodes>" days have passed (when they'll be deleted if you run the | ||||
| Expire job). This is the same behaviour as Netdisco 1. | ||||
|  | ||||
| Set to a number of minutes to enforce some kind of ageing on this data. For | ||||
| example you could set to 60 to match the default macsuck schedule, meaning | ||||
| nodes are archived if they're not in the device tables at the time of polling. | ||||
|  | ||||
| =head3 C<expire_devices> | ||||
|  | ||||
| Value: Number of Days. Default: 60 | ||||
|   | ||||
| @@ -130,6 +130,7 @@ nbtstat_only: [] | ||||
| nbtstat_max_age: 7 | ||||
| nbtstat_interval: 0.02 | ||||
| nbtstat_timeout: 1 | ||||
| node_freshness: 0 | ||||
| expire_devices: 60 | ||||
| expire_nodes: 90 | ||||
| expire_nodes_archive: 60 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user