Bug fixes to discovery; add root_ip handling.
Squashed commit of the following: commitcb6f125c73Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Apr 13 20:26:59 2013 +0100 discover root_ip properly commit8228e73f5bAuthor: Oliver Gorwits <oliver@cpan.org> Date: Sat Apr 13 19:47:23 2013 +0100 better name for util package commit4546036f4fAuthor: Oliver Gorwits <oliver@cpan.org> Date: Sat Apr 13 19:23:55 2013 +0100 bug fixes in getting wireless info commit78554e5516Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Apr 13 19:07:44 2013 +0100 refactor snmp_connect to handle versions and device classes commitca9edd114aAuthor: Oliver Gorwits <oliver@cpan.org> Date: Sat Apr 13 15:23:52 2013 +0100 rename discoverall to discovernew commit1b897e4aeeAuthor: Oliver Gorwits <oliver@cpan.org> Date: Sat Apr 13 14:51:06 2013 +0100 change debug log tag for store_device commit8a5306e056Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Apr 13 14:50:10 2013 +0100 rename Discover.pm to Device.pm commit3197e38819Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Apr 13 14:48:31 2013 +0100 allow netdisco-do to do all acton
This commit is contained in:
@@ -33,7 +33,7 @@ sub capacity_for {
|
||||
debug "checking local capacity for action $action";
|
||||
|
||||
my $action_map = {
|
||||
Poller => [qw/refresh discover discoverall discover_neighbors/],
|
||||
Poller => [qw/refresh discover discovernew discover_neighbors/],
|
||||
Interactive => [qw/location contact portcontrol portname vlan power/],
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package App::Netdisco::Daemon::Worker::Interactive::Util;
|
||||
package App::Netdisco::Daemon::Util;
|
||||
|
||||
# support utilities for Daemon Actions
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package App::Netdisco::Daemon::Worker::Interactive::DeviceActions;
|
||||
|
||||
use App::Netdisco::Util::SNMP ':all';
|
||||
use App::Netdisco::Util::SNMP 'snmp_connect_rw';
|
||||
use App::Netdisco::Util::Device 'get_device';
|
||||
use App::Netdisco::Daemon::Worker::Interactive::Util ':all';
|
||||
use App::Netdisco::Daemon::Util ':all';
|
||||
|
||||
use Role::Tiny;
|
||||
use namespace::clean;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package App::Netdisco::Daemon::Worker::Interactive::PortActions;
|
||||
|
||||
use App::Netdisco::Util::SNMP ':all';
|
||||
use App::Netdisco::Util::Port ':all';
|
||||
use App::Netdisco::Daemon::Worker::Interactive::Util ':all';
|
||||
use App::Netdisco::Util::SNMP 'snmp_connect_rw';
|
||||
use App::Netdisco::Daemon::Util ':all';
|
||||
|
||||
use Role::Tiny;
|
||||
use namespace::clean;
|
||||
|
||||
@@ -14,7 +14,7 @@ my $fqdn = hostfqdn || 'localhost';
|
||||
|
||||
my $role_map = {
|
||||
(map {$_ => 'Poller'}
|
||||
qw/refresh discover discoverall discover_neighbors/),
|
||||
qw/refresh discover discovernew discover_neighbors/),
|
||||
(map {$_ => 'Interactive'}
|
||||
qw/location contact portcontrol portname vlan power/)
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ use Role::Tiny;
|
||||
use namespace::clean;
|
||||
|
||||
# add dispatch methods for poller tasks
|
||||
with 'App::Netdisco::Daemon::Worker::Poller::Discover';
|
||||
with 'App::Netdisco::Daemon::Worker::Poller::Device';
|
||||
|
||||
sub worker_body {
|
||||
my $self = shift;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package App::Netdisco::Daemon::Worker::Poller::Discover;
|
||||
package App::Netdisco::Daemon::Worker::Poller::Device;
|
||||
|
||||
use Dancer qw/:moose :syntax :script/;
|
||||
use Dancer::Plugin::DBIC 'schema';
|
||||
@@ -6,7 +6,7 @@ use Dancer::Plugin::DBIC 'schema';
|
||||
use App::Netdisco::Util::SNMP 'snmp_connect';
|
||||
use App::Netdisco::Util::Device 'get_device';
|
||||
use App::Netdisco::Util::DiscoverAndStore ':all';
|
||||
use App::Netdisco::Daemon::Worker::Interactive::Util ':all';
|
||||
use App::Netdisco::Daemon::Util ':all';
|
||||
|
||||
use NetAddr::IP::Lite ':lower';
|
||||
|
||||
@@ -53,7 +53,7 @@ sub discover {
|
||||
|
||||
# run find_neighbors on all known devices, and run discover on any
|
||||
# newly found devices.
|
||||
sub discoverall {
|
||||
sub discovernew {
|
||||
my ($self, $job) = @_;
|
||||
|
||||
my $devices = schema('netdisco')->resultset('Device')->get_column('ip');
|
||||
@@ -11,10 +11,10 @@ use namespace::clean;
|
||||
|
||||
my $jobactions = {
|
||||
map {$_ => undef} qw/
|
||||
refresh
|
||||
discovernew
|
||||
/
|
||||
# saveconfigs
|
||||
# discoverall
|
||||
# refresh
|
||||
# macwalk
|
||||
# arpwalk
|
||||
# nbtwalk
|
||||
|
||||
Reference in New Issue
Block a user