...
Code Block | ||||
---|---|---|---|---|
| ||||
%hash = ( 'nmis' => { # Different rules can be defined for when an NMIS node is created and when # it is updated. This lets you avoid overwriting values the you edit in NMIS. 'create' => { # nameversion will resolve to the 'nameos_version' field in the device if it exists, or # an empty string otherwise. 'nameversion' => ['$DEVICE.nameos_version'], # roleType and group try to use a value from the device if it exists, but # will fall back to a constant if it does not. 'roleType' => ['$DEVICE.nmis_role', 'core'], 'group' => ['$DEVICE.nmis_group', 'Open-AudIT'], # host checks multiple fields from the device, choosing the first one # that has a value (or the empty string if no values are found). 'host' => ['$DEVICE.ip', '$DEVICE.hostname','$DEVICE.dns_hostname', '$DEVICE.fqdn'], # active, ping, and model just use a default value when any new node is created. 'active' => ['true'], 'ping' => ['true'], 'model' => ['automatic'], # name uses an array of candidates like all the other fields, but it also applies # a set of transform functions after a candidate is chosen. 'name' => { 'candidates' => [$DEVICE.name], 'transforms' => ['trim_whitespace'], } }, # Only the node fields defined here will be considered for an update. 'update' => { 'roleType' => ['$DEVICE.nmis_role', 'core'], 'group' => ['$DEVICE.nmis_group', 'Open-AudIT'], } } ); |
...