Merge 2.008000 release from og-work branch.

Squashed commit of the following:

commit aa2baf5c75
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Jun 9 15:44:29 2013 +0100

    next stable release

commit 79fe5b59e6
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Jun 9 15:37:26 2013 +0100

    fix localenv discovery for scripts

commit 1af2f78dd4
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Jun 9 14:55:39 2013 +0100

    include new bin scripts

commit 23d0e1b0e7
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Jun 9 14:09:27 2013 +0100

    more bug fixes

commit dfeacd12e2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Jun 9 11:30:06 2013 +0100

    several bug fixes

commit 9fd41f1c26
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 21:22:44 2013 +0100

    bump version for next beta

commit b0925cf116
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 21:20:13 2013 +0100

    update plugin docs

commit 9571c45634
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 20:54:30 2013 +0100

    sanitize configuration files

commit dd447e4246
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 20:04:43 2013 +0100

    tweak parsing of lists of regex in config

commit 9957548022
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 19:54:10 2013 +0100

    workers instead of daemon_* config

commit 4f6b470429
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 19:39:40 2013 +0100

    no more demo :(

commit eda73c7dac
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 19:24:47 2013 +0100

    lots of docs

commit 4a1ccba71a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 18:17:42 2013 +0100

    documentation for all config settings

commit 3538e47bcd
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 16:05:03 2013 +0100

    update TODO

commit cf9001fccc
Merge: a43c989 7b98e23
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Jun 8 16:03:29 2013 +0100

    merge master after new release

commit a43c98962a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Jun 3 20:37:39 2013 +0100

    Missing mibdirs causes all MIBs to be loaded (with a warning)

commit 09829a25b8
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Jun 3 20:07:31 2013 +0100

    local plugins site_plugins dir

commit b0e804e558
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Jun 3 19:59:04 2013 +0100

    use send_error and redirect from Dancer

commit 3d1185261a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Jun 3 19:13:40 2013 +0100

    support path config option

commit 31ca119f84
Merge: 9a79855 4d2b3a5
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Jun 3 00:06:17 2013 +0100

    Merge remote-tracking branch 'origin/og-work' into og-work
    g-work"

    This reverts commit 9a79855361, reversing
    changes made to 6fd6118354.

    Conflicts:
    	Netdisco/share/views/plugin/device_port_column/c_observiumsparklines.tt

commit 9a79855361
Merge: 6fd6118 c8c3b82
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Jun 3 00:03:32 2013 +0100

    Merge remote-tracking branch 'origin/master' into og-work

commit 6fd6118354
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Jun 2 15:47:45 2013 +0100

    extra note about behind proxy

commit 798086ca29
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Jun 2 15:30:26 2013 +0100

    complete the observium plugin

commit 66b3ced179
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Jun 2 12:48:06 2013 +0100

    Plugins can have CSS and Javascript loaded within <head>

commit 4d2b3a5307
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 30 08:50:16 2013 +0100

    get device dns to port template

commit ed1bfa1ae7
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 30 08:17:02 2013 +0100

    observium sparklines plugin; support X:: namespace

commit 76b7636c74
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 30 06:30:06 2013 +0100

    rename private settings keys

commit fdac8f6c33
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 30 05:59:53 2013 +0100

    add macwalk and arpnip buttons to device details

commit 3d688c7d83
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 30 05:57:20 2013 +0100

    Revert "reduce refresh to 5sec"

    This reverts commit 8ea9ec7dd9.

commit dc62382112
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 30 05:50:34 2013 +0100

    support for arpwalk and macwalk and all jobs via web

commit 8bc7d83c98
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 30 05:35:41 2013 +0100

    simplify discover options to only discoverall and discover

commit 8ea9ec7dd9
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 29 20:23:08 2013 +0100

    reduce refresh to 5sec

commit 8c54e6c58b
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 29 20:11:06 2013 +0100

    show undiscovered neighbor properly

commit e0ee25628f
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 29 19:54:09 2013 +0100

    avoid unecessary log for queueing

commit d5565423f2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 29 19:51:37 2013 +0100

    avoid warning on undefined remote type

commit 5d9b58a6b2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 29 19:48:22 2013 +0100

    avoid explosion when not admin

commit 377bb942e0
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 29 19:46:52 2013 +0100

    avoid undefined warning

commit 08806dcfa2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 29 19:46:42 2013 +0100

    get_db_version will be 0 at first deploy

commit 9511c17056
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 29 19:15:55 2013 +0100

    fix name of Template module

commit eb0288de35
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 28 07:17:07 2013 +0100

    initial config settings documentation

commit 7f2ea7f8dc
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 27 15:18:15 2013 +0100

    remove check_mac to own module, use in macsuck too

commit b995cf6398
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 27 15:01:29 2013 +0100

    show probable but undiscovered neighbor is ports display

commit dd8d461188
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 27 14:52:41 2013 +0100

    new schema version for is_uplink and is_uplink_admin

commit 3f6a7b5aa2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 27 14:47:59 2013 +0100

    make sure device_port is updated when manual_topo is set

commit 33bf9a6599
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 26 19:51:49 2013 +0100

    export store_arp and store_node

commit 0ed356d560
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat May 25 17:12:31 2013 +0100

    use row lock not table lock

commit f830bc3a3b
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat May 25 16:38:33 2013 +0100

    move macsuck/arpnip/discover to ::Core namespace

commit be40788987
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri May 24 21:10:34 2013 +0100

    add maybe_uplink to device_port; more macsuck implementation

commit 88371026d5
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri May 24 14:34:58 2013 +0100

    start on macsuck; tweak update locking

commit 6f7c87ac07
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri May 24 13:10:58 2013 +0100

    ORDER BY ... FOR UPDATE will allow us to avoid table lock

commit 7c438e01fc
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri May 24 12:12:46 2013 +0100

    yet more efficient arpnip

commit c74c56dc02
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri May 24 11:34:23 2013 +0100

    guard against race with *_or_* DBIC methods

commit d50c54972e
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 20 23:42:41 2013 +0100

    more efficient arpnip

commit 73c8979130
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 19 22:52:15 2013 +0100

    fix confusing name

commit bf78e82411
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 19 22:37:22 2013 +0100

    fix mistake in DBIx::Class schema

commit 6a5af95836
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 19 22:06:27 2013 +0100

    arpnip implementation

commit 594abd3f82
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 16 00:00:50 2013 +0100

    PostgreSQL explicit locking support.

    Squashed commit of the following:

    commit 76e1539102
    Author: Oliver Gorwits <oliver@cpan.org>
    Date:   Wed May 15 23:54:25 2013 +0100

        finished explicit locking module

    commit 369387258b
    Author: Oliver Gorwits <oliver@cpan.org>
    Date:   Tue May 14 23:50:42 2013 +0100

        initial implementation of locking from schema object

commit 55c6d4fe63
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 14 21:05:01 2013 +0100

    add discover button to device details page

commit 11fd8bf964
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 14 20:43:43 2013 +0100

    fix typo and clear port box on autocomplete dropdown

commit a00f9b5c2e
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 14 20:38:54 2013 +0100

    move admin tasks and remove JobControl package

commit 74bc0023df
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat May 11 18:25:04 2013 +0100

    complete job queue delete and kill running timers properly when reloading page

commit dd6947f38d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat May 11 16:51:28 2013 +0100

    fix improper use of bootstrap table class

commit cd5b83f71e
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat May 11 15:55:45 2013 +0100

    fix update view icon in sidebar

commit e9349f325d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat May 11 11:57:19 2013 +0100

    css audit

commit 201470275d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 9 23:48:05 2013 +0100

    add job queue to standard plugins list

commit a18a3c72a3
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 9 23:37:43 2013 +0100

    fix table headings and improve Action display in Job Queue

commit 70f5da8bb6
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 9 23:30:32 2013 +0100

    implement "no devices" prompt for admin users to do first discover

commit 2e8ac83173
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 9 21:53:39 2013 +0100

    more js refactoring for report and search

commit 479ac0e55d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 9 21:50:29 2013 +0100

    refactor js for device tabs

commit 6a17fe5d6c
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Thu May 9 21:05:42 2013 +0100

    fix crazy races with javasacript by using global delegations

commit e94e3cef3b
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 8 23:06:41 2013 +0100

    remove Try::Tiny from web runtime

commit c746e68b9b
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 7 21:54:11 2013 +0100

    make topo autocomplete more responsive

commit 24c511786f
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 7 21:52:17 2013 +0100

    display name and IP for device typeahead

commit 52ab7d1266
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 7 21:47:05 2013 +0100

    add drop-down control for the topo form fields

commit 5744b6845f
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 7 21:25:30 2013 +0100

    complete the topology editor (add/delete)

commit b510fbe8c5
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 7 00:59:11 2013 +0100

    add new admin tasks to default plugins list

commit 11d55e0129
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 7 00:56:19 2013 +0100

    Manual Device Topology

    Needed to add the 'autocomplete' jQuery UI component because
    it can do minLength=0 properly. Used the smoothness UI theme.

    Added typeahead AJAX calls to support the topology searching.

    Added new plugin and template for the topology editing page.

commit bf7a419d08
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 6 22:16:24 2013 +0100

    add a little colour to lone tab titles

commit 9690a31f19
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 6 22:01:13 2013 +0100

    complete Manage Pseudo Devices

commit 024f4d9a83
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 6 00:49:47 2013 +0100

    use bootstrap font colour instead of css

commit f75f1e5cbf
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 6 00:45:18 2013 +0100

    add frontend update/del forms, and display port count

commit f0899e16b3
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 5 23:53:20 2013 +0100

    add frontend pseudo device add form

commit 3271c01931
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 5 21:45:17 2013 +0100

    complete the code for admin tasks page loading

commit 38f70624f3
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 5 17:04:30 2013 +0100

    set up file paths consistently in all scripts

commit c761ca839b
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 5 17:00:30 2013 +0100

    Helper script to import the Netdisco 1.x Topology file to the database

commit f468b48049
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 5 16:20:39 2013 +0100

    Handle whitespace ahead of OUI data

commit 5c8a5754f6
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 5 16:16:20 2013 +0100

    also set neighbor info when discovering device interfaces

commit acb988b6af
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 5 15:34:20 2013 +0100

    try to avoid duplicate execution of scheduled jobs

commit c6bcaf66c5
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 5 14:16:25 2013 +0100

    do not clobber manual topo when discovering neighbors

commit d9a6a1882a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 5 13:02:45 2013 +0100

    User icon color indicates port_control/admin ability

commit 2cdcb9db7e
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Apr 29 23:34:27 2013 +0100

    add support for admin tasks as plugins

commit 075a770c9a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Apr 29 22:23:20 2013 +0100

    skip pseudo devices (vendor netdisco)

commit 045c022d42
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Apr 29 21:58:33 2013 +0100

    incorporate manual topo info from the topology db table

commit 09285d42b4
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 18:39:12 2013 +0100

    add unique constraints to topology table

commit 2780b72e49
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 15:38:05 2013 +0100

    muted help text in sidebar

commit 733d4f83fb
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:39:54 2013 +0100

    sorry, testing hook changes

commit 71e366e352
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:34:36 2013 +0100

    sorry, testing hook changes

commit 7f9eaa99f5
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:33:44 2013 +0100

    sorry, testing hook changes

commit 5215fd632d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:30:07 2013 +0100

    sorry, testing hook changes

commit be817d60c2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:21:45 2013 +0100

    sorry, testing hook changes

commit 1fd3695358
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:18:57 2013 +0100

    sorry, testing hook changes

commit ac448c4a91
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:13:03 2013 +0100

    sorry, testing hook changes

commit c563b8d9af
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:08:54 2013 +0100

    sorry, testing hook changes

commit 3abcfb01d5
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:06:25 2013 +0100

    sorry, testing hook changes

commit 877a81facf
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Apr 27 14:05:25 2013 +0100

    sorry, testing hook changes
This commit is contained in:
Oliver Gorwits
2013-06-09 15:49:49 +01:00
parent 7b98e23182
commit 3dd69c2063
34 changed files with 876 additions and 303 deletions

View File

@@ -1,3 +1,9 @@
2.008000 - 2013-06-09
[BUG FIXES]
* localenv discovery in scripts is now more reliable
2.007000_002 - 2013-06-03
[NEW FEATURES]

View File

@@ -108,6 +108,7 @@ lib/App/Netdisco/Manual/ReleaseNotes.pod
lib/App/Netdisco/Manual/WritingPlugins.pod
lib/App/Netdisco/Util/Device.pm
lib/App/Netdisco/Util/DNS.pm
lib/App/Netdisco/Util/Noop.pm
lib/App/Netdisco/Util/Port.pm
lib/App/Netdisco/Util/PortMAC.pm
lib/App/Netdisco/Util/SanityCheck.pm
@@ -144,7 +145,6 @@ MANIFEST This list of files
META.yml
share/config.yml
share/environments/deployment.yml
share/environments/development.yml
share/public/500.html
share/public/css/bootstrap.min.css
share/public/css/font-awesome.min.css

View File

@@ -50,6 +50,7 @@ requires:
Starman: 0.3008
Template: 2.24
YAML: 0.84
YAML::XS: 0.41
namespace::clean: 0.24
perl: 5.10.0
version: 0.9902
@@ -59,4 +60,4 @@ resources:
homepage: http://netdisco.org/
license: http://opensource.org/licenses/bsd-license.php
repository: git://git.code.sf.net/p/netdisco/netdisco-ng
version: 2.007000_002
version: 2.008000

View File

@@ -35,13 +35,16 @@ requires 'SNMP::Info' => 3.01;
requires 'SQL::Translator' => 0.11016;
requires 'Template' => 2.24;
requires 'YAML' => 0.84;
requires 'YAML::XS' => 0.41;
requires 'namespace::clean' => 0.24;
requires 'version' => 0.9902;
install_share 'share';
install_script 'bin/nd-import-topology';
install_script 'bin/netdisco-db-deploy';
install_script 'bin/netdisco-deploy';
install_script 'bin/netdisco-do';
install_script 'bin/netdisco-daemon-fg';
install_script 'bin/netdisco-daemon';
install_script 'bin/netdisco-web-fg';

View File

@@ -22,7 +22,7 @@ use Getopt::Long;
nd-dbic-versions - Create DB Schema Versions for Netdisco
=head2 USAGE
=head1 USAGE
This script creates SQL DDL files of the Netdisco database schema.
@@ -33,7 +33,7 @@ If called with the "-p <version>" option, upgrade SQL DDL command files
are created between the specified version and the current DBIx::Class
specification.
=head2 New Version
=head1 NEW VERSION
=over 4

View File

@@ -23,11 +23,11 @@ use Try::Tiny;
nd-import-topology - Import a Nedisco 1.x Manual Topology File
=head2 USAGE
=head1 USAGE
./nd-import-topology /path/to/netdisco-topology.txt
~/bin/localenv nd-import-topology /path/to/netdisco-topology.txt
=head2 DESCRIPTION
=head1 DESCRIPTION
This helper script will read and import the content of a Netdisco 1.x format
Manual Topology file into the Netdisco 2.x database's C<topology> table.

View File

@@ -3,14 +3,12 @@
use strict;
use warnings FATAL => 'all';
use FindBin;
FindBin::again();
our $home;
BEGIN {
# try really hard to find a localenv if one isn't already in place.
$home = ($ENV{NETDISCO_HOME} || $ENV{HOME});
eval "use Daemon::Control";
eval "require App::Netdisco::Util::Noop";
if ($@) {
use File::Spec;
@@ -22,7 +20,10 @@ BEGIN {
}
}
use FindBin;
FindBin::again();
use Path::Class;
use Daemon::Control;
my $netdisco = file($FindBin::RealBin, 'netdisco-daemon-fg');
my @args = (scalar @ARGV > 1 ? @ARGV[1 .. $#ARGV] : ());

View File

@@ -44,15 +44,15 @@ sub build_tasks_list {
# NB MCE does not like max_workers => 0
my $tasks = [];
set(daemon_pollers => 2)
if !defined setting('daemon_pollers');
set(daemon_interactives => 2)
if !defined setting('daemon_interactives');
setting('workers')->{pollers} = 2
if !defined setting('workers')->{pollers};
setting('workers')->{interactives} = 2
if !defined setting('workers')->{interactives};
push @$tasks, {
max_workers => 1,
user_begin => worker_factory('Manager'),
} if setting('daemon_pollers') or setting('daemon_interactives');
} if setting('workers')->{pollers} or setting('workers')->{interactives};
push @$tasks, {
max_workers => 1,
@@ -60,27 +60,27 @@ sub build_tasks_list {
} if setting('housekeeping');
push @$tasks, {
max_workers => setting('daemon_pollers'),
max_workers => setting('workers')->{pollers},
user_begin => worker_factory('Poller'),
} if setting('daemon_pollers');
} if setting('workers')->{pollers};
push @$tasks, {
max_workers => setting('daemon_interactives'),
max_workers => setting('workers')->{interactives},
user_begin => worker_factory('Interactive'),
} if setting('daemon_interactives');
} if setting('workers')->{interactives};
info sprintf "MCE will load %s tasks: %s Manager, %s Scheduler, %s Poller, %s Interactive",
(scalar @$tasks),
((setting('daemon_pollers') or setting('daemon_interactives')) ? 1 : 0),
((setting('workers')->{pollers} or setting('workers')->{interactives}) ? 1 : 0),
(setting('housekeeping') ? 1 : 0),
(setting('daemon_pollers') || 0),
(setting('daemon_interactives') || 0);
(setting('workers')->{pollers} || 0),
(setting('workers')->{interactives} || 0);
return $tasks;
}
sub num_workers {
return (setting('daemon_pollers') + setting('daemon_interactives'));
return (setting('workers')->{pollers} + setting('workers')->{interactives});
}
sub worker_factory {

View File

@@ -21,7 +21,7 @@ use Try::Tiny;
netdisco-db-deploy - Database deployment for Netdisco
=head2 USAGE
=head1 USAGE
This script upgrades or initialises a Netdisco database schema.
@@ -35,7 +35,7 @@ interaction. If there's no Nedisco schema, it is deployed. If there's an
unversioned schema then versioning is added, and updates applied. Otherwise
only necessary updates are applied to an already versioned schema.
=head2 Versions
=head1 VERSIONS
=over 4

View File

@@ -1,13 +1,11 @@
#!/usr/bin/env perl
use FindBin;
FindBin::again();
our $home;
BEGIN {
# try really hard to find a localenv if one isn't already in place.
$home = ($ENV{NETDISCO_HOME} || $ENV{HOME});
eval "use Daemon::Control";
eval "require App::Netdisco::Util::Noop";
if ($@) {
use File::Spec;
@@ -19,11 +17,14 @@ BEGIN {
}
}
use FindBin;
FindBin::again();
use Path::Class;
BEGIN {
# stuff useful locations into @INC and $PATH
my $location = $FindBin::RealBin;
use Path::Class;
unshift @INC,
dir($location)->parent->subdir('lib')->stringify,
dir($location, 'lib')->stringify;
@@ -35,6 +36,7 @@ BEGIN {
use App::Netdisco;
use Dancer ':script';
use Dancer::Plugin::DBIC 'schema';
info "App::Netdisco version $App::Netdisco::VERSION loaded.";
use 5.010_000;
@@ -50,7 +52,7 @@ use Try::Tiny;
netdisco-deploy - Database, OUI and MIB deployment for Netdisco
=head2 USAGE
=head1 USAGE
This script deploys the Netdisco database schema, OUI data, and MIBs. Each of
these is an optional service which the user is asked to confirm.
@@ -73,11 +75,11 @@ for its use.
say 'This is the Netdisco II deployment script.';
say '';
say 'Before we continue, the following prerequisites must be in place:';
say ' * Internet access';
say ' * Database added to PostgreSQL for Netdisco';
say ' * User added to PostgreSQL with rights to the Netdisco Database';
say ' * "~/environments/deployment.yml" file configured with Database dsn/user/pass';
say ' * A full backup of any existing Netdisco database data';
say ' * Internet access (for OUIs and MIBs)';
say '';
say 'You will be asked to confirm all changes to your system.';
say '';

View File

@@ -1,5 +1,22 @@
#!/usr/bin/env perl
our $home;
BEGIN {
# try really hard to find a localenv if one isn't already in place.
$home = ($ENV{NETDISCO_HOME} || $ENV{HOME});
eval "require App::Netdisco::Util::Noop";
if ($@) {
use File::Spec;
my $localenv = File::Spec->catfile($FindBin::RealBin, 'localenv');
exec($localenv, $0, @ARGV) if -f $localenv;
$localenv = File::Spec->catfile($home, 'perl5', 'bin', 'localenv');
exec($localenv, $0, @ARGV) if -f $localenv;
die "Sorry, can't find libs required for App::Netdisco.\n";
}
}
use FindBin;
FindBin::again();
use Path::Class 'dir';
@@ -52,6 +69,8 @@ if (!length $action) {
with 'App::Netdisco::Daemon::Worker::Poller::Device';
with 'App::Netdisco::Daemon::Worker::Poller::Arpnip';
with 'App::Netdisco::Daemon::Worker::Poller::Macsuck';
with 'App::Netdisco::Daemon::Worker::Interactive::DeviceActions';
with 'App::Netdisco::Daemon::Worker::Interactive::PortActions';
}
my $worker = MyWorker->new();
@@ -97,3 +116,68 @@ info sprintf '%s: finished at %s', $action, scalar localtime;
info sprintf '%s: status %s: %s', $action, $status, $log;
exit ($status eq 'done' ? 0 : 1);
=head1 NAME
netdisco-do - Run any Netdisco poller job from the command-line.
=head1 USAGE
~/bin/netdisco-do <action> [-D] [-d <device> [-p <port>] [-e <extra>]]
Regardless of Netdisco configuration, debug level logging is enabled if the
C<-D> flag is given.
=head1 DESCRIPTION
This program allows you to run any Netdisco poller job from the command-line.
Note that some jobs (C<discoverall>, C<macwalk>, C<arpwalk>) simply add
entries to the Netdisco job queue for other jobs, so won't seem to do much
when you trigger them.
=head1 ACTIONS
=head2 discover
Run a discover on the device (specified with C<-d>).
=head2 macsuck
Run a macsuck on the device (specified with C<-d>).
=head2 arpnip
Run an arpnip on the device (specified with C<-d>).
=head2 set_location
Set the SNMP location field on the device (specified with C<-d>). Pass the
location string in the C<-e> extra parameter.
=head2 set_contact
Set the SNMP contact field on the device (specified with C<-d>). Pass the
contact name in the C<-e> extra parameter.
=head2 set_portname
Set the description on a device port. Requires the C<-d> parameter (device),
C<-p> parameter (port), and C<-e> parameter (description).
=head2 set_portcontrol
Set the up/down status on a device port. Requires the C<-d> parameter
(device), C<-p> parameter (port), and C<-e> parameter ("up" or "down").
=head2 set_vlan
Set the native VLAN on a device port. Requires the C<-d> parameter (device),
C<-p> parameter (port), and C<-e> parameter (VLAN number).
=head2 set_power
Set the PoE on/off status on a device port. Requires the C<-d> parameter
(device), C<-p> parameter (port), and C<-e> parameter ("true" or "false").
=cut

View File

@@ -3,14 +3,12 @@
use strict;
use warnings FATAL => 'all';
use FindBin;
FindBin::again();
our $home;
BEGIN {
# try really hard to find a localenv if one isn't already in place.
$home = ($ENV{NETDISCO_HOME} || $ENV{HOME});
eval "use Daemon::Control";
eval "require App::Netdisco::Util::Noop";
if ($@) {
use File::Spec;
@@ -22,7 +20,10 @@ BEGIN {
}
}
use FindBin;
FindBin::again();
use Path::Class;
use Daemon::Control;
my $netdisco = file($FindBin::RealBin, 'netdisco-web-fg');
my @args = (scalar @ARGV > 1 ? @ARGV[1 .. $#ARGV] : ());

View File

@@ -7,7 +7,7 @@ use 5.010_000;
use File::ShareDir 'dist_dir';
use Path::Class;
our $VERSION = '2.007000_002';
our $VERSION = '2.008000';
BEGIN {
if (not length ($ENV{DANCER_APPDIR} || '')
@@ -28,6 +28,15 @@ BEGIN {
$ENV{DANCER_PUBLIC} ||= $auto->subdir('public')->stringify;
$ENV{DANCER_VIEWS} ||= $auto->subdir('views')->stringify;
}
{
# Dancer 1 uses the broken YAML.pm module
# This is a global sledgehammer - could just apply to Dancer::Config
use YAML;
use YAML::XS;
no warnings 'redefine';
*YAML::LoadFile = sub { goto \&YAML::XS::LoadFile };
}
}
=head1 NAME
@@ -41,18 +50,9 @@ network management tool. Pieces are still missing however, so if you're a new
user please see L<http://netdisco.org/> for further information on the project
and how to download the current official release.
=over 4
=item *
See the demo at: L<http://demo-ollyg.dotcloud.com/netdisco/>
=back
L<App::Netdisco> provides a web frontend and a backend daemon to handle
interactive requests such as changing port or device properties. There is not
yet a device poller, so please still use the old Netdisco's discovery, arpnip,
and macsuck.
L<App::Netdisco> provides a web frontend with built-in web server, and a
backend daemon to handle interactive requests such as changing port or device
properties.
If you have any trouble getting the frontend running, speak to someone in the
C<#netdisco> IRC channel (on freenode). Before installing or upgrading please
@@ -139,6 +139,8 @@ take care of all this for you:
~/bin/netdisco-deploy
Answer yes to all questions, if this is a new installation of Netdisco 2.
=head1 Startup
Run the following command to start the web-app server as a backgrounded daemon
@@ -146,12 +148,17 @@ Run the following command to start the web-app server as a backgrounded daemon
~/bin/netdisco-web start
If the Inventory is empty because this is a new installation, you probably
want to either run some polling jobs from the command-line, or give a web user
some admin rights (see L</"User Rights">, below).
Run the following command to start the job control daemon (port control, etc):
~/bin/netdisco-daemon start
You should take care not to run this Netdisco daemon and the legacy daemon at
the same time.
the same time. Similarly, if you use the device discovery with Netdisco 2,
disable your system's cron jobs for the Netdisco 1 poller.
=head1 Upgrading
@@ -161,13 +168,13 @@ Notes|App::Netdisco::Manual::ReleaseNotes>. Then, the process is as follows:
# upgrade Netdisco
~/bin/localenv cpanm --notest App::Netdisco
# apply database schema updates (optionally, get latest OIDs/MIBs)
# apply database schema updates
~/bin/netdisco-deploy
# restart web service
~/bin/netdisco-web restart
# optionally, restart job daemon if you use it
# restart job daemon (if you use it)
~/bin/netdisco-daemon restart
=head1 Tips and Tricks
@@ -180,12 +187,30 @@ or MAC addreses, VLAN numbers, and so on.
=head2 User Rights
When user authentication is disabled (C<no_auth>) the default username is
"guest", which has no special privilege. To grant port and device control
When user authentication is disabled (C<no_auth: true>) the default username
is "guest", which has no special privilege. To grant port and device control
rights to this user, create a row in the C<users> table of the Netdisco
database with a username of C<guest> and the C<port_control> flag set to true:
database with a username of C<guest> and appropriate flags set to true:
netdisco=> insert into users (username, port_control) values ('guest', true);
netdisco=> insert into users (username) values ('guest');
netdisco=> update users set port_control = true where username = 'guest';
netdisco=> update users set admin = true where username = 'guest';
=head2 Command-Line Device and Port Actions
To run a device (discover, etc) or port control job from the command-line, use
the bundled L<netdisco-do> program. For example:
~/bin/netdisco-do -D discover -d 192.0.2.1
=head2 Import Topology
Netdisco 1.x had support for a topology information file to fill in device
port relations which could not be discovered. This is now stored in the
database (and edited in the web interface). To import a legacy topology file,
run:
~/bin/localenv nd-import-topology /path/to/netdisco-topology.txt
=head2 Deployment Scenarios
@@ -202,10 +227,8 @@ documentation for further information.
=head2 Plugins
App::Netdisco includes a Plugin subsystem for building the web user interface.
Items in the navigation bar and the tabs on pages are loaded as Plugins, and
you have control over their appearance and ordering. See
L<App::Netdisco::Web::Plugin> for further information.
Netdisco includes a Plugin subsystem for customizing the web user interface.
See L<App::Netdisco::Web::Plugin> for further information.
=head2 Developing
@@ -229,7 +252,7 @@ Oliver Gorwits <oliver@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by The Netdisco Developer Team.
This software is copyright (c) 2012, 2013 by The Netdisco Developer Team.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@@ -198,7 +198,7 @@ sub store_interfaces {
next;
}
if (scalar grep {$port =~ m/$_/} @{setting('ignore_interfaces') || []}) {
if (scalar grep {$port =~ m/^$_$/} @{setting('ignore_interfaces') || []}) {
debug sprintf
' [%s] interfaces - ignoring %s (%s) (config:ignore_interfaces)',
$device->ip, $entry, $port;
@@ -807,12 +807,14 @@ sub discover_new_neighbors {
my $device = get_device($ip);
next if $device->in_storage;
my $remote_type_match = setting('discover_no_type');
if ($remote_type and $remote_type_match
and $remote_type =~ m/$remote_type_match/) {
debug sprintf ' queue - %s, type [%s] excluded by discover_no_type',
$ip, $remote_type;
next;
if ($remote_type) {
if (scalar grep {$remote_type =~ m/$_/}
@{setting('discover_no_type') || []}) {
debug sprintf
' queue - %s, type [%s] excluded by discover_no_type',
$ip, $remote_type;
next;
}
}
# could fail if queued job already exists

View File

@@ -43,8 +43,8 @@ sub capacity_for {
};
my $setting_map = {
Poller => 'daemon_pollers',
Interactive => 'daemon_interactives',
Poller => 'pollers',
Interactive => 'interactives',
};
my $role = $role_map->{$action};
@@ -52,7 +52,7 @@ sub capacity_for {
my $current = $queue->search({role => $role})->count;
return ($current < setting($setting));
return ($current < setting('workers')->{$setting});
}
sub take_jobs {

View File

@@ -49,7 +49,7 @@ sub worker_body {
}
debug "int ($wid): sleeping now...";
sleep( setting('daemon_sleep_time') || 5 );
sleep( setting('workers')->{sleep_time} || 5 );
}
}

View File

@@ -101,7 +101,7 @@ sub set_power {
my $ip = $job->device;
my $pn = $job->port;
(my $data = $job->subaction) =~ s/-\w+//;
(my $data = $job->subaction) =~ s/-\w+//; # remove -other
# snmp connect using rw community
my $info = snmp_connect_rw($ip)

View File

@@ -84,7 +84,7 @@ sub worker_body {
# TODO also check for stale jobs in Netdisco DB
debug "mgr ($wid): sleeping now...";
sleep( setting('daemon_sleep_time') || 5 );
sleep( setting('workers')->{sleep_time} || 5 );
}
}

View File

@@ -51,7 +51,7 @@ sub worker_body {
}
debug "poll ($wid): sleeping now...";
sleep( setting('daemon_sleep_time') || 5 );
sleep( setting('workers')->{sleep_time} || 5 );
}
}

View File

@@ -58,59 +58,78 @@ the C<dsn> (DB name, host, port), C<user> and C<pass>.
=head2 General Settings
=head3 C<log: debug|warning|error>
=head3 C<log>
Default: C<warning>
Value: C<debug|warning|error>. Default: C<warning>.
The log level used by Netdisco. It's useful to see warning messages from the
backend poller, as this can highlight broken topology.
=head3 C<logger: console|file>
=head3 C<logger>
Default: C<file>
Value: C<console|file>. Default: C<file>.
Destination for log messages. Console means standard ouput. When set to
C<file>, the default destination is the C<${HOME}/logs> directory.
=head3 C<logger_format: String>
=head3 C<logger_format>
Default: C<< '[%P] %L @%D> %m' >>
Value: Format String. Default: C<< '[%P] %L @%D> %m' >>.
Structure of the log messages. See L<Dancer::Logger::Abstract/"logger_format">
for details.
=head2 Web Frontend
=head3 C<domain_suffix: String>
=head3 C<domain_suffix>
Default: None
Value: String. Default: None.
Set this to your local site's domain name. This is usually removed from node
names in the web interface to make things more readable.
names in the web interface to make things more readable. Make sure to include
the leading dot character.
=head3 C<no_auth: Boolean>
=head3 C<no_auth>
Default: C<false>
Value: Boolean. Default: C<false>.
Enable this to disable login authentication in the web frontend. The username
will be set to C<guest> so if you want to allow extended permissions (C<admin>
or C<port_control>, create a dummy user with the appropriate flag, in the
or C<port_control>, create a dummy user with the appropriate flag in the
database:
netdisco=> insert into users (username, port_control) values ('guest', true);
netdisco=> insert into users (username) values ('guest');
netdisco=> update users set port_control = true where username = 'guest';
netdisco=> update users set admin = true where username = 'guest';
=head3 C<port: String>
=head3 C<port>
Default: C<5000>
Value: Number. Default: C<5000>.
Port which the web server listens on. Netdisco comes with a good pre-forking
web server, so you can change this to C<80> if you want to use it directly.
However the default is designed to work well with servers such as Apache in
reverse-proxy mode.
=head3 C<web_plugins: List of String>
=head3 C<path>
Default: List of L<App::Netdisco::Web::Plugin> names
Value: String. Default: None.
Mount point for the Netdisco web frontend. This is usually the root of the web
server. Set this to the path under which all pages live, e.g. C</netdisco2>.
As an alternative you can use the C<--path> option to C<netdisco-web>.
=head3 C<behind_proxy>
Value: Boolean. Default: C<false>.
A hint to the Netdisco web frontend that it's running behind a reverse proxy.
In that case, Netdisco will pay attention to the C<X_FORWARDED_PROTOCOL>,
C<X_FORWARDED_HOST>, etc settings in HTML headers.
=head3 C<web_plugins>
Value: List of Modules. Default: List of bundled L<App::Netdisco::Web::Plugin> names.
Netdisco's plugin system allows the user more control over the user interface.
Plugins can be distributed independently from Netdisco and are a better
@@ -119,24 +138,462 @@ are used in the default Netdisco distribution.
You can override this to set your own list. If you only want to add to the
default list then use C<extra_web_plugins>, which allows the Netdisco
developers to update C<web_plugins> in a future release.
developers to update default C<web_plugins> in a future release.
=head3 C<extra_web_plugins: List of String>
Entries in the list will by default omit the leading
C<App::Netdisco::Web::Plugin::> from the name. To override this for one entry,
prefix it with a C<+> sign. You can also prefix with C<X::> to signify the
alternate C<App::NetdiscoX::Web::Plugin::> namepsace.
Default: None
=head3 C<extra_web_plugins>
Value: List of Modules. Default: Empty List.
List of additional L<App::Netdisco::Web::Plugin> names to load. See also the
C<web_plugins> setting.
=head2 Netdisco Core
=head3 C<mibhome>
Value: Directory. Default: C<${HOME}/netdisco-mibs>.
Base directory in which to find C<mibdirs>. This is where C<netdisco-deploy>
will drop MIB files.
=head3 C<mibdirs>
Value: List of Directories. Default: All subdirectories of C<mibhome>.
A list of subdirectories of C<mibhome> from which to load MIB files. You
should always include C<rfc>. For example:
mibdirs:
- rfc
- cisco
- foundry
=head3 C<community>
Value: List of Strings. Default: C<public>.
A list of read-only SNMP community strings to try on each device. The working
community will be cached in the database.
=head3 C<community_rw>
Value: List of Strings. Default: C<private>.
A list of read-write SNMP community strings to try on each device. The working
community will be cached in the database.
=head3 C<snmpver>
Value: C<1|2|3>. Default: 2.
Version of the SNMP protocol used when connecting to devices.
=head3 C<snmptimeout>
Value: Number. Default: 1000000.
Micro-seconds before connection retry in L<SNMP::Session>. 1000000
micro-seconds = 1 second.
=head3 C<snmpretries>
Value: Number. Default: 2.
Number of times to retry connecting to a device before giving up.
=head3 C<discover_no>
Value: List of Network Identifiers. Default: Empty List.
IP addresses in the list will not be visited during device discovery. You can
include hostnames, IP addresses and subnets (IPv4 or IPv6) in the list.
=head3 C<discover_only>
Value: List of Network Identifiers. Default: Empty List.
If present, device discovery will be limited to IP addresses matching entries
in this list. You can include hostnames, IP addresses and subnets (IPv4 and
IPv6).
=head3 C<discover_no_type>
Value: List of Strings. Default: None.
Place regular expression patterns here to exclude the discovery of certain
devices based on the CDP/LLDP device type information. Good for excluding a
whole device class like lightweight access points or IP phones that have CDP
but don't talk SNMP. For example:
discover_no_type:
- 'cisco\s+AIR-LAP'
- '(?i)Cisco\s+IP\s+Phone'
=head3 C<macsuck_all_vlans>
Value: Boolean. Default: C<false>.
Set to macsuck all VLANs, not just the ones that are being used on ports.
This is a debug option. Set this if you think that the option of not
macsucking VLANs that aren't in use on device ports is some how interfering.
=head3 C<macsuck_no_unnamed>
Value: Boolean. Default: C<false>.
Set to true to skip macsuck-ing on VLANs which have no name set. This option
may be useful on Cisco Catalyst family devices where ports are a member of a
VLAN which is not defined in the VLAN database.
=head3 C<macsuck_bleed>
Value: Boolean. Default: C<false>.
Set to true will let nodes accumulate on uplink ports without topology
information. This is a debug option to help you figure out your topology and
generally should not be set.
=head3 C<store_wireless_client>
Value: Boolean. Default: C<true>.
Set to false to skip the wireless client information gathering. This is
captured at macsuck time, so if you aren't using the information you can skip
it.
=head3 C<ignore_interfaces>
Value: List of Strings. Default:
ignore_interfaces:
- 'EOBC'
- 'unrouted VLAN'
- 'StackPort'
- 'Control Plane Interface'
- 'SPAN (S|R)P Interface'
- 'StackSub'
- 'netflow'
- 'Vlan\d+-mpls layer'
- 'BRI\S+-Bearer Channel'
- 'BRI\S+-Physical'
- 'BRI\S+-Signalling'
- 'Embedded-Service-Engine\d+\/\d+'
- 'Virtual-Template\d+'
- 'Virtual-Access\d+'
- '(E|T)\d \d\/\d\/\d'
If present, device ports whose names match fully any of the items in this list
will be ignored by the discovery process.
Note this may have side effects - connected devices and nodes on those ports
will in turn also not be discovered.
=head3 C<ignore_private_nets>
Value: Boolean. Default: C<false>.
Set to true to ignore device interfaces that are part of private nets (RFC
1918).
=head3 C<reverse_sysname>
Value: Boolean. Default: C<false>.
Turn this on to have Netdisco do a reverse lookup of the device C<sysName.0>
field to use as the management IP address for a device.
=head3 C<vlanctl>
Value: Boolean. Default: C<true>.
Set to false to prevent Netdisco from changing the default VLAN on an
interface.
=head3 C<portctl_nophones>
Value: Boolean. Default: C<false>.
Set to true to make sure an IP Phone port never can be turned off/on.
=head3 C<portctl_vlans>
Value: Boolean. Default: C<false>.
Set to true to allow Netdisco to be able to disable VLAN trunk interfaces.
B<EXTREMELY VERY DANGEROUS>: Turning off a VLAN trunk link could take out most
of your network.
=head3 C<portctl_uplinks>
Value: Boolean. Default: C<false>.
Set to true to allow Netdisco to be able to disable Uplinks. (Router
Interfaces too)
B<EXTREMELY VERY DANGEROUS>: Turning off uplinks will take out chunks of your
network.
=head3 C<no_port_control>
Value: Boolean. Default: C<false>.
Set to true to disable globally support for Port Control. Mainly useful for
development to suppress web frontend job queue callbacks.
=head2 Backend Daemon
=head3 C<workers>
Value: Settings Tree. Default:
workers:
interactives: 2
pollers: 2
sleep_time: 5
Control the activity of the backend daemon with this configuration setting.
C<interactives> and C<pollers> sets how many workers are started for
interactive jobs (port control) and polling jobs (discover, macsuck, arpnip)
on this node, respectively. Other nodes can have different settings.
C<sleep_time> is the number of seconds between polling the database to find
new jobs. This is a balance between responsiveness and database load.
=head3 C<housekeeping>
Value: Settings Tree. Default: None.
If set, then this node's backend daemon will schedule polling jobs (discover,
macsuck, arpnip, etc) in the central database. It's fine to have multiple
nodes scheduling work for redundancy (but make sure they all have good NTP).
Note that this is independent of the Pollers configured in C<workers>. It's
okay to have this node schedule housekeeping but not do any of the polling
itself (C<pollers: 0>).
Work can be scheduled using C<cron> style notation, or a simple weekday and
hour fields (which accept same types as C<cron> notation). For example:
housekeeping:
discoverall:
when: '0 9 * * *'
arpwalk:
when:
min: 30
macwalk:
when:
hour: '*/2'
=head2 Dancer Internal
=head1 UNSUPPORTED SETTINGS
=head3 C<charset>
Value: String. Default: C<UTF-8>.
See L<Dancer::Config/"charset-string">.
=head3 C<warnings>
Value: Boolean. Default: C<false>.
Should warnings be considered as critical errors?
=head3 C<show_errors>
Value: Boolean. Default: C<false>.
Whether to show a stack trace when an error is caught in the web frontend.
=head3 C<engines>
Value: Settings Tree.
Useful for overriding the Template Toolkit settings, if you want.
=head3 C<layout>
Value: String. Default: C<main>.
Don't touch this.
=head3 C<plugins>
Value: Settings Tree.
Useful for overriding the Database configuration, but only if you know what
you're doing.
=head3 C<session>
Value: String. Default: C<YAML>.
How to handle web sessions. Default is to store on disk so they can be shared
between multiple web server processes (although it's slower).
=head3 C<template>
Value: String. Default: C<template_toolkit>.
Which engine to use for templating in the web frontend. Don't touch this.
=head3 C<route_cache>
Value: Boolean. Default: C<true>.
Whether to build a route cache for web requests, for better performance.
=head3 C<appname>
Value: String. Default: C<Netdisco>.
Don't touch this.
=head1 UNSUPPORTED (SO FAR)
These settings are from Netdisco 1.x but are yet to be supported in Netdisco
2. If you really need the feature, please let the developers know.
=over 4
=item *
C<admin>
=item *
C<arpnip_min_age>
=item *
C<arpnip_no>
=item *
C<arpnip_only>
=item *
C<bulkwalk_no>
=item *
C<bulkwalk_off>
=item *
C<bulkwalk_repeaters>
=item *
C<col_xxx_show>
=item *
C<discover_min_age>
=item *
C<expire_devices>
=item *
C<expire_nodes>
=item *
C<expire_nodes_archive>
=item *
C<get_community>
=item *
C<macsuck_min_age>
=item *
C<macsuck_no>
=item *
C<macsuck_no_devicevlan>
=item *
C<macsuck_no_vlan>
=item *
C<macsuck_only>
=item *
C<macsuck_timeout>
=item *
C<nonincreasing>
=item *
C<port_info>
=item *
C<portctl_timeout>
=item *
C<portcontrol>
=item *
C<snmpforce_v1>
=item *
C<snmpforce_v2>
=item *
C<snmpforce_v3>
=item *
C<store_modules>
=item *
C<timeout>
=item *
C<v3_user>
=item *
C<v3_users>
=item *
C<v3_users_rw>
=item *
C<web_console_models>
=item *
C<web_console_vendors>
=back
=cut

View File

@@ -242,8 +242,8 @@ port names).
If you're working on code in the web application, it's possible to have the
app restart itself each time you save a file in your editor. The following
command will watch the C<lib> and C<share> folder trees for changes, and you
probably want to switch to the C<development.yml> dancer configuration for
additional logging:
probably want to edit your C<deployment.yml> configuration to enable
additional logging (see L<App::Netdisco::Manual::Configuration>):
DANCER_ENVIRONMENT=development DBIC_TRACE_PROFILE=console DBIC_TRACE=1 \
~/bin/localenv starman -R lib,share bin/netdisco-web-fg

View File

@@ -4,10 +4,25 @@ App::Netdisco::Manual::ReleaseNotes - Release Notes
=head1 Introduction
This document will list only the most important changes with each release of
This document will list only the most significant changes with each release of
Netdisco. You are B<STRONGLY> recommended to read this document each time you
install and upgrade.
=head1 2.008000
=head2 Heath Advice
This release contains the first version of our new poller, which handles
device and node discovery. Please make sure to backup any existing Netdisco
database before trying it out.
=head2 Other Changes
You can remove any settings from C<~/environments/deployment.yml> which you
didn't edit or add to the file yourself. All defaults are now properly
embedded within the application. See the new C<deployment.yml> sample which
ships with this distribution for an example.
=head1 2.006000
=head2 Incompatible Changes

View File

@@ -0,0 +1,5 @@
package App::Netdisco::Util::Noop;
# used for testing library access.
1;

View File

@@ -68,8 +68,8 @@ sub vlan_reconfig_check {
=item *
Permission check that C<allow_uplinks> is true in Netdisco config, if C<$port>
is an uplink.
Permission check that C<portctl_uplinks> is true in Netdisco config, if
C<$port> is an uplink.
=item *
@@ -97,7 +97,7 @@ sub port_reconfig_check {
# uplink check
return "forbidden: port [$name] on [$ip] is an uplink"
if $port->remote_type and not $has_phone and not setting('allow_uplinks');
if $port->remote_type and not $has_phone and not setting('portctl_uplinks');
# phone check
return "forbidden: port [$name] on [$ip] is a phone"

View File

@@ -147,7 +147,7 @@ sub _try_connect {
}
sub _build_mibdirs {
my $home = (setting('mibhome') || $ENV{NETDISCO_HOME} || $ENV{HOME});
my $home = (setting('mibhome') || dir(($ENV{NETDISCO_HOME} || $ENV{HOME}), 'netdisco-mibs'));
return map { dir($home, $_) }
@{ setting('mibdirs') || _get_mibdirs_content($home) };
}

View File

@@ -20,7 +20,8 @@ hook 'before' => sub {
->find(session('user')));
# really just for dev work, to quieten the logs
var('user')->port_control(0) if setting('no_port_control');
var('user')->port_control(0)
if var('user') and setting('no_port_control');
}
};

View File

@@ -164,16 +164,16 @@ true;
=head1 NAME
App::Netdisco::Web::Plugin - Plugin subsystem for App::Netdisco Web UI components
App::Netdisco::Web::Plugin - Netdisco Web UI components
=head1 Introduction
L<App::Netdisco>'s plugin subsystem allows the user more control of Netdisco
UI components displayed in the web browser. Plugins can be distributed
L<App::Netdisco>'s plugin system allows you more control of what Netdisco
components are displayed in the web interface. Plugins can be distributed
independently from Netdisco and are a better alternative to source code
patches.
The following UI components are implemented as plugins:
The following web interface components are implemented as plugins:
=over 4
@@ -189,6 +189,14 @@ Tabs for Search and Device pages
Reports (pre-canned searches)
=item *
Additional Device Port Columns
=item *
Admin Menu function (job control, manual topology, pseudo devices)
=back
This document explains how to configure which plugins are loaded. See
@@ -196,10 +204,13 @@ L<App::Netdisco::Manual::WritingPlugins> if you want to develop new plugins.
=head1 Application Configuration
In the main C<config.yml> file for App::Netdisco (located in C<share/...>)
you'll find the C<web_plugins> configuration directive. This lists, in YAML
format, a set of Perl module names (or partial names) which are the plugins to
be loaded. For example:
Netdisco configuration supports a C<web_plugins> directive along with the
similar C<extra_web_plugins>. These list, in YAML format, the set of Perl
module names which are the plugins to be loaded. Each item injects one part of
the Netdisco web user interface.
You can override these settings to add, change, or remove entries from the
default lists. Here is an example of the C<web_plugins> list:
web_plugins:
- Inventory
@@ -210,19 +221,28 @@ be loaded. For example:
- Device::Details
- Device::Ports
When the name is specified as above, App::Netdisco automatically prepends
"C<App::Netdisco::Web::Plugin::>" to the name. This makes, for example,
L<App::Netdisco::Web::Plugin::Inventory>. This is the module which is loaded
to add a user interface component.
Any change should go into your local C<deployment.yml> configuration file. If
you want to view the default settings, see the C<share/config.yml> file in the
C<App::Netdisco> distribution.
=head1 How to Configure
The C<extra_web_plugins> setting is empty, and used only if you want to add
new plugins but not change the set enabled by default. If you do want to add
to or remove from the default set, then create a version of C<web_plugins>
instead.
Netdisco prepends "C<App::Netdisco::Web::Plugin::>" to any entry in the list.
For example, "C<Inventory>" will load the
C<App::Netdisco::Web::Plugin::Inventory> module.
Such plugin modules can either ship with the App::Netdisco distribution
itself, or be installed separately. Perl uses the standard C<@INC> path
searching mechanism to load the plugin modules.
If an entry in the C<web_plugins> list starts with a "C<+>" (plus) sign then
App::Netdisco attemps to load the module as-is, without prepending anything to
the name. This allows you to have App::Netdiso web UI plugins in other
namespaces:
If an entry in the list starts with a "C<+>" (plus) sign then Netdisco attemps
to load the module as-is, without prepending anything to the name. This allows
you to have App::Netdiso web UI plugins in other namespaces:
web_plugins:
- Inventory
@@ -230,21 +250,13 @@ namespaces:
- Device::Details
- +My::Other::Netdisco::Web::Component
The order of the entries in C<web_plugins> is significant. Unsurprisingly, the
modules are loaded in order. Therefore Navigation Bar items appear in the
order listed, and Tabs appear on the Search and Device pages in the order
listed.
The order of the entries is significant. Unsurprisingly, the modules are
loaded in order. Therefore Navigation Bar items appear in the order listed,
and Tabs appear on the Search and Device pages in the order listed, and so on.
The consequence of this is that if you want to change the order (or add or
remove entries) then simply edit the C<web_plugins> setting. In fact, we
recommend adding this setting to your C<< <environment>.yml >> file and
leaving the C<config.yml> file alone. Your Environment's version will take
prescedence.
Finally, if you want to add components without completely overriding the
C<web_plugins> setting, use the C<extra_web_plugins> setting instead in your
Environment configuration. Any Navigation Bar items or Page Tabs are added
after those in C<web_plugins>.
Finally, you can also prepend module names with "C<X::>", to support the
"Netdisco extension" namespace. For example, "C<X::Observium>" will load the
L<App::NetdiscoX::Web::Plugin::Observium> module.
=cut

View File

@@ -8,7 +8,7 @@ ajax '/ajax/portcontrol' => sub {
send_error('Forbidden', 403)
unless var('user')->port_control;
send_error('No device/port/field', 400)
unless param('device') and param('port') and param('field');
unless param('device') and (param('port') or param('field'));
my $log = sprintf 'd:[%s] p:[%s] f:[%s]. a:[%s] v[%s]',
param('device'), (param('port') || ''), param('field'),

View File

@@ -1,40 +1,27 @@
# This is the main configuration file for Netdisco web and daemon apps
# all the settings in this file will be loaded at Dancer's startup.
#
# DO NOT EDIT THIS FILE
#
# Overrides should go to ~/environments/deployment.yml
# See App::Netdisco::Manual::Configuration for explanations
# Web app env-related settings should go to environments/$env.yml
# ----------------
# GENERAL SETTINGS
# ----------------
# application's name
appname: "Netdisco"
# The default web layout to use for your application (located in
# views/layouts/main.tt)
layout: "main"
# when the charset is set to UTF-8 Dancer will handle for you
# all the magic of encoding and decoding. You should not care
# about unicode within your app when this setting is set (recommended).
charset: "UTF-8"
# web sessions stored on disk
session: "YAML"
# HTTP port to listen on
port: 5000
# logging format
log: 'warning'
logger: 'file'
logger_format: '[%P] %L @%D> %m'
# web output template settings
template: "template_toolkit"
engines:
template_toolkit:
encoding: 'utf8'
start_tag: '[%'
end_tag: '%]'
PRE_CHOMP: 1
# Netdisco stuff (can be overidden in the environment .yml)
# ------------
# WEB FRONTEND
# ------------
domain_suffix: ''
no_auth: false
port: 5000
path: '/'
behind_proxy: false
web_plugins:
- Inventory
- Report::DuplexMismatch
@@ -47,56 +34,64 @@ web_plugins:
- Search::Port
- Device::Details
- Device::Ports
# - Device::Modules
# - Device::Modules
- Device::Neighbors
- Device::Addresses
web_plugins_extra: []
discover_no: []
discover_only: []
snmpver: 2
snmpretries: 2
snmptimeout: 1000000
# If unset, Netdisco uses "NETDISCO_HOME/netdisco-mibs", assuming you're
# using the netdisco-deploy script to download MIBs there. Otherwise, set
# this, for example:
#
# mibhome: /usr/share/netdisco/mibs
mibdirs:
- cisco
- rfc
- net-snmp
# -------------
# NETDISCO CORE
# -------------
# mibhome is discovered from environment
# mibdirs defaults to contents of mibhome
community: ['public']
community_rw: ['private']
snmpver: 2
snmptimeout: 1000000
snmpretries: 2
discover_no: []
discover_only: []
discover_no_type: []
macsuck_all_vlans: false
macsuck_no_unnamed: false
macsuck_bleed: false
store_wireless_client: true
ignore_interfaces:
- 'EOBC'
- 'unrouted VLAN'
- 'StackPort'
- 'Control Plane Interface'
- 'SPAN (S|R)P Interface'
- 'StackSub'
- 'netflow'
- 'Vlan\d+-mpls layer'
- 'BRI\S+-Bearer Channel'
- 'BRI\S+-Physical'
- 'BRI\S+-Signalling'
- 'Embedded-Service-Engine\d+\/\d+'
- 'Virtual-Template\d+'
- 'Virtual-Access\d+'
- '(E|T)\d \d\/\d\/\d'
ignore_private_nets: false
reverse_sysname: false
vlanctl: true
portctl_nophones: false
portctl_vlans: false
portctl_uplinks: false
no_port_control: false
# rights control for Interactive jobs
vlanctl: 1
allow_uplinks: 0
portctl_nophones: 1
portctl_vlans: 1
# --------------
# BACKEND DAEMON
# --------------
# sleep time between polls of the database job queue
daemon_sleep_time: 5
workers:
interactives: 2
pollers: 2
sleep_time: 5
# how many daemon processes for this node
daemon_interactives: 2
daemon_pollers: 2
# what housekeeping tasks should this node *schedule*
# (it only does them if daemon_pollers is non-zero)
#housekeeping:
# discovernew:
# device: '192.0.2.0'
# when:
# wday: 'wed'
# hour: 14
# backup:
# when:
# hour: 1
# refresh:
# discoverall:
# when: '0 9 * * *'
# arpwalk:
# when:
@@ -104,9 +99,23 @@ daemon_pollers: 2
# macwalk:
# when:
# hour: '*/2'
# nbtwalk:
# when:
# hour: '8,13,21'
# saveconfigs:
# param: 61
# when: '0 * * * *'
# ---------------
# DANCER INTERNAL
# ---------------
charset: 'UTF-8'
warnings: false
show_errors: false
engines:
template_toolkit:
encoding: 'utf8'
start_tag: '[%'
end_tag: '%]'
PRE_CHOMP: 1
layout: 'main'
session: 'YAML'
template: 'template_toolkit'
route_cache: true
appname: 'Netdisco'

View File

@@ -1,21 +1,13 @@
# configuration file for production environment
#
# NETDISCO 2 CONFIGURATION FILE
#
# Settings in this file override share/config.yml
# See App::Netdisco::Manual::Configuration for more info.
# only log warning and error messsages
log: "warning"
# ------------------
# ESSENTIAL SETTINGS
# ------------------
# log message to a file in logs/
logger: "file"
# don't consider warnings critical
warnings: 0
# hide errors
show_errors: 0
# cache route resolution for maximum performance
route_cache: 1
# database connections
plugins:
DBIC:
# alter dsn/user/pass for your local Netdisco DB
@@ -28,20 +20,23 @@ plugins:
RaiseError: 1
AutoCommit: 1
# uncomment and set to 1 to disable authentication/login
# no_auth: 0
# --------------------
# RECOMMENDED SETTINGS
# --------------------
# will be stripped from fqdn when displayed in the web UI
# also, do not forget the leading dot
# domain_suffix: '.example.com'
# also, do not forget the leading dot.
# domain_suffix: '.example.com'
# local settings for Netdisco poller and port changes
# uncomment and set to true to disable authentication/login.
# no_auth: false
mibdirs:
- cisco
- rfc
- net-snmp
# community: ['public']
# community_rw: ['private']
community: ['public']
community_rw: ['private']
# if unset, Netdisco loads all MIBs in mibhome directory.
# mibdirs:
# - cisco
# - rfc
# - net-snmp

View File

@@ -1,49 +0,0 @@
# configuration file for development environment
# the logger engine to use
# console: log messages to STDOUT (your console where you started the
# application server)
# file: log message to a file in log/
logger: "console"
# the log level for this environement
# core is the lowest, it shows Dancer's core log messages as well as yours
# (debug, warning and error)
log: "debug"
# should Dancer consider warnings as critical errors?
warnings: 1
# should Dancer show a stacktrace when an error is caught?
show_errors: 1
# database connections
plugins:
DBIC:
# alter dsn/user/pass for your local Netdisco DB
netdisco:
schema_class: 'App::Netdisco::DB'
dsn: 'dbi:Pg:dbname=netdisco;host=localhost'
user: 'netdisco'
pass: 'netdisco'
options:
RaiseError: 1
AutoCommit: 1
# uncomment and set to 1 to disable authentication/login
no_auth: 1
# will be stripped from fqdn when displayed in the web UI
# also, do not forget the leading dot
# domain_suffix: '.example.com'
# local settings for Netdisco poller and port changes
mibdirs:
- cisco
- rfc
- net-snmp
community: ['public']
community_rw: ['private']

View File

@@ -213,10 +213,10 @@
<span class="label label-important">N</span>
<a href="[% search_node %]&q=[% row.remote_ip | uri %]">
[% row.remote_ip | html_entity %] (port: [% row.remote_port | html_entity %]
[% ' id: '_ row.remote_type IF row.remote_type%]
[% ' type: '_ row.remote_id IF row.remote_id%])</a>
[% ' id: '_ row.remote_id IF row.remote_id %]
[% ' type: '_ row.remote_type IF row.remote_type %])</a>
[% ELSE %]
<span class="label label-important">N</span> (probable neighbor)
<span class="label label-important">N</span> (possible uplink)
[% END %]
[% END %]
[% IF params.c_nodes %]

View File

@@ -10,18 +10,13 @@
// but which cannot use jQuery delegation via .on()
function inner_view_processing(tab) {
// reload this table every 10 seconds
// reload this table every 5 seconds
if (tab == 'jobqueue') {
$('#nd_device-name').text('10');
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('9') }, 1000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('8') }, 2000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('7') }, 3000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('6') }, 4000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('5') }, 5000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('4') }, 6000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('3') }, 7000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('2') }, 8000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('1') }, 9000 ));
$('#nd_device-name').text('5');
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('4') }, 1000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('3') }, 2000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('2') }, 3000 ));
nd_timers.push(setTimeout(function() { $('#nd_device-name').text('1') }, 4000 ));
nd_timers.push(setTimeout(function() {
// clear any running timers
for (var i = 0; i < nd_timers.length; i++) {
@@ -29,7 +24,7 @@
}
// reload the tab content
$('#' + tab + '_form').trigger('submit');
}, 10000));
}, 5000));
}
// activate typeahead on the topo boxes

14
TODO
View File

@@ -1,13 +1,18 @@
FRONTEND
========
* moar reports
* NetAddr::MAC ?
* moar reports
* (jeneric) device module tab
BACKEND
=======
* db connect params as separate settings
* new DBIC multi-prefetch
* PING from workers
DAEMON
======
@@ -15,10 +20,15 @@ CORE
====
* VRF support
* import legacy config file
DOCS
====
* Scheduler
* Discover/Refresh jobs
* netdisco-do
* new X:: plugin namespace
* observiumsparklines plugin
* port column plugins
* add css and js for plugin
* site_plugins