App::Netdisco::Util::Node
A set of helper subroutines to support parts of the Netdisco application.
There are no default exports, however the :all tag will export all subroutines.
:all
Given a Device database object and a MAC address, perform various sanity checks which need to be done before writing an ARP/Neighbor entry to the database storage.
Returns false, and might log a debug level message, if the checks fail.
Returns a true value (the MAC address in IEEE format) if these checks pass:
MAC address is well-formed (according to common formats)
MAC address is not all-zero, broadcast, CLIP, VRRP or HSRP
Optionally pass a cached set of Device port MAC addresses as the third argument, in which case an additional check is added:
MAC address does not belong to an interface on any known Device
Given the IP address of a node, returns true if the configuration setting $setting_name matches that device, else returns false. If the setting is undefined or empty, then check_node_no also returns false.
$setting_name
check_node_no
print "rejected!" if check_node_no($ip, 'nbtstat_no');
There are several options for what $setting_name can contain:
Hostname, IP address, IP prefix
IP address range, using a hyphen and no whitespace
Regular Expression in YAML format which will match the node DNS name, e.g.:
- !!perl/regexp ^sep0.*$
To simply match all nodes, use "any" or IP Prefix "0.0.0.0/0". All regular expressions are anchored (that is, they must match the whole string). To match no nodes we recommend an entry of "localhost" in the setting.
any
0.0.0.0/0
localhost
Given the IP address of a node, returns true if the configuration setting $setting_name matches that node, else returns false. If the setting is undefined or empty, then check_node_only also returns true.
check_node_only
print "rejected!" unless check_node_only($ip, 'nbtstat_only');
Given an IP address, returns true if Netdisco on this host is permitted by the local configuration to nbtstat the node.
true
The configuration items nbtstat_no and nbtstat_only are checked against the given IP.
nbtstat_no
nbtstat_only
Returns false if the host is not permitted to nbtstat the target node.
To install App::Netdisco, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Netdisco
CPAN shell
perl -MCPAN -e shell install App::Netdisco
For more information on module installation, please visit the detailed CPAN module installation guide.