This is a modifier for any search() (including the helpers below) which will add the following additional synthesized columns to the result set:
search()
my $set = $rs->search_by_ip({ip => '192.0.2.1', active => 1});
Like search(), this returns a ResultSet of matching rows from the NodeIp table.
The cond parameter must be a hashref containing a key ip with the value to search for. Value can either be a simple string of IPv4 or IPv6, or a NetAddr::IP::Lite object in which case all results within the CIDR/Prefix will be retrieved.
cond
ip
Results are ordered by time last seen.
Additional columns time_first_stamp and time_last_stamp provide preformatted timestamps of the time_first and time_last fields.
time_first_stamp
time_last_stamp
time_first
time_last
A JOIN is performed on the OUI table and the OUI company column prefetched.
company
To limit results only to active IPs, set {active => 1} in cond.
{active => 1}
my $set = $rs->search_by_name({dns => 'foo.example.com', active => 1});
The NodeIp table must have a dns column for this search to work. Typically this column is the IP's DNS PTR record, cached at the time of Netdisco Arpnip.
dns
The cond parameter must be a hashref containing a key dns with the value to search for. The value may optionally include SQL wildcard characters.
my $set = $rs->search_by_mac({mac => '00:11:22:33:44:55', active => 1});
The cond parameter must be a hashref containing a key mac with the value to search for.
mac
my $rset = $rs->ip_version(4);
This predefined search() returns a ResultSet of matching rows from the NodeIp table of nodes with addresses of the supplied IP version.
The version parameter must be an integer either 4 or 6.
version
1 POD Error
The following errors were encountered while parsing the POD:
=over without closing =back
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.