|
NAMEnetdisco-sshcollector - DEPRECATED!DEPRECATION NOTICEThe functionality of this standalone script has been incorporated into Netdisco core.Please read the deprecation notice if you are using "netdisco-sshcollector":
SYNOPSIS# install dependencies: ~/bin/localenv cpanm --notest Net::OpenSSH Expect # run manually, or add to cron: ~/bin/netdisco-sshcollector [-DQO] [-w <max_workers>] # limit run to a single device defined in the config ~/bin/netdisco-sshcollector [-DQO] [-w <max_workers>] -d <device> DESCRIPTIONCollects ARP data for Netdisco from devices without full SNMP support. Currently, ARP tables can be retrieved from the following device classes:
The collected arp entries are then directly stored in the netdisco database. CONFIGURATIONThe following should go into your Netdisco configuration file, ~/environments/deployment.yml.
ADDING DEVICESAdditional device classes can be easily integrated just by adding and additonal class to the "App::Netdisco::SSHCollector::Platform" namespace. This class must implement an "arpnip($hostname, $ssh)" method which returns an array of hashrefs in the format@result = ({ ip => IPADDR, mac => MACADDR }, ...) The parameter $ssh is an active "Net::OpenSSH" connection to the host. Depending on the target system, it can be queried using simple methods like my @data = $ssh->capture("show whatever") or automated via Expect - this is mostly useful for non-Linux appliances which don't support command execution via ssh: my ($pty, $pid) = $ssh->open2pty; unless ($pty) { debug "unable to run remote command [$hostlabel] " . $ssh->error; return (); } my $expect = Expect->init($pty); my $prompt = qr/#/; my ($pos, $error, $match, $before, $after) = $expect->expect(10, -re, $prompt); $expect->send("terminal length 0\n"); # etc... The returned IP and MAC addresses should be in a format that the respective inetaddr and macaddr datatypes in PostgreSQL can handle. COMMAND LINE OPTIONS
DEPENDENCIES
Visit the GSP FreeBSD Man Page Interface. |