App-Netdisco
view release on metacpan or search on metacpan
bin/netdisco-do view on Meta::CPAN
exit $exitstatus;
=encoding UTF-8
=head1 NAME
netdisco-do - Run any Netdisco job from the command-line.
=head1 SYNOPSIS
~/bin/netdisco-do <action> [-DISQR] [--enqueue] [--force] [--quiet] [-d <device> [-p <port>] [-e <extra>]]
=head1 DESCRIPTION
This program allows you to run any Netdisco poller job from the command-line.
=head1 ACTIONS
Note that some jobs (C<discoverall>, C<macwalk>, C<arpwalk>, C<nbtwalk>)
simply add entries to the Netdisco job queue for other jobs, so won't seem
to do much when you trigger them. Everything else happens in real-time.
However the "C<--enqueue>" option will force the queueing of the job,
regardless of type. This may be useful for cron-driven actions, or for actions
working across large IP spaces. Netdisco will refuse to queue more than 512
jobs at once unless you also add the "C<--force>" option.
For any action, if you wish to run one of its individual worker stages, then
pass C<action::stage> as the first argument to C<netdisco-do>, for example
C<discover::neighbors>.
Any action taking a C<device> parameter can be passed either a hostname or IP
address of any interface of a known or unknown device, or an IP prefix
(subnet) which will cause C<netdisco-do> to run the action on all addresses in
that range. The C<device> parameter may also be a filename that Netdisco will
open to read hostnames, IPs, or prefixes, one per line.
The C<device> parameter may be passed multiple times. In this case, all
addresses (after expanding IP Prefixes) will be handled one by one.
=head2 discover
Run a discover on the device (specified with C<-d>).
~/bin/netdisco-do discover -d 192.0.2.1
Run a discover on two different devices (specified with C<-d>).
~/bin/netdisco-do discover -d 192.0.2.1 -d 192.15.2.95
=head2 discoverall
Queue a discover for all known devices.
=head2 pingsweep
Scan an IP prefix (subnet) using ping utility (must be installed), any
host responding has a C<discover> job queued. It is recommended to queue
the C<pingsweep> job as well.
~/bin/netdisco-do pingsweep -d 192.0.2.0/24 --enqueue
The default ping timeout is 0.1 seconds. To change this, pass any number
to the C<-e> parameter.
=head2 macsuck
Run a macsuck on the device (specified with C<-d>).
~/bin/netdisco-do macsuck -d 192.0.2.1
Submit macsuck data directly to Netdisco in JSON format (see API web
docs for data format example):
#Â pipe to standard input
~/bin/netdisco-do macsuck -d 192.0.2.1 -e '@-'
#Â read from a file
~/bin/netdisco-do macsuck -d 192.0.2.1 -e '@/tmp/mac-address-table.json'
#Â pass directly
~/bin/netdisco-do macsuck -d 192.0.2.1 -e '[{"ip": "string", "mac": "string", "dns": "string"}]'
=head2 macwalk
Queue a macsuck for all known devices.
=head2 arpnip
Run an arpnip on the device (specified with C<-d>).
~/bin/netdisco-do arpnip -d 192.0.2.1
Submit arpnip data directly to Netdisco in JSON format (see API web
docs for data format example):
#Â pipe to standard input
~/bin/netdisco-do arpnip -d 192.0.2.1 -e '@-'
#Â read from a file
~/bin/netdisco-do arpnip -d 192.0.2.1 -e '@/tmp/mac-address-table.json'
#Â pass directly
~/bin/netdisco-do arpnip -d 192.0.2.1 -e '[{"ip": "string", "mac": "string", "dns": "string"}]'
=head2 arpwalk
Queue an arpnip for all known devices.
=head2 delete
Delete a device (specified with C<-d>). Pass a log message for the action in
the C<-e> parameter. Optionally request for associated nodes to be archived
(rather than deleted) by setting the C<-p> parameter to "C<yes>" (mnemonic:
B<p>reserve).
~/bin/netdisco-do delete -d 192.0.2.1
~/bin/netdisco-do delete -d 192.0.2.1 -e 'older than the sun'
~/bin/netdisco-do delete -d 192.0.2.1 -e 'older than the sun' -p yes
=head2 renumber
Change the canonical IP address of a device (specified with C<-d>). Pass the
new IP address in the C<-e> parameter. All related records such as topology,
log and node information will also be updated to refer to the new device.
( run in 2.925 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )