Send Netdot-devel mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."


Today's Topics:

   1. [Netdot - Bug #1822] (Resolved) Topology shows    different
      devices with same name prefix as the same device
      ([email protected])
   2. [Netdot - Bug #1817] (Resolved) Missing dependencies      - ubuntu
      14.04 ([email protected])
   3. [Netdot - Bug #1820] (Closed) Could not get a valid       iptree4
      from cache ([email protected])
   4. [SCM] Netdot branch netdot-1.0 updated.
      netdot-1.0.6-23-g22ddc22 ([email protected])
   5. [SCM] Netdot branch master updated.       netdot-1.0.6-23-g22ddc22
      ([email protected])
   6. [Netdot - Feature #1791] Exclude static IP        information from
      prune_db.pl's IP address pruning ([email protected])
   7. [Netdot - Feature #1824] (In Progress) Improve Depth      Up /
      Depth Down display ([email protected])
   8. [Netdot - Feature #1791] Exclude static IP        information from
      prune_db.pl's IP address pruning ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Fri, 27 Jun 2014 07:45:30 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1822] (Resolved) Topology shows
        different devices with same name prefix as the same device
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1822 has been updated by Carlos Vicente.

Category set to UserInterface
Status changed from New to Resolved
Assignee set to Brian Candler
Target version set to 1.0.7
Resolution set to fixed

Pull request merged. Thank you!
----------------------------------------
Bug #1822: Topology shows different devices with same name prefix as the same 
device
https://osl.uoregon.edu/redmine/issues/1822#change-3201

Author: Brian Candler
Status: Resolved
Priority: Normal
Assignee: Brian Candler
Category: UserInterface
Target version: 1.0.7
Resolution: fixed


In the topology graph, if there are two different devices called "ap" (e.g. 
"ap.library-tech" and "ap.old-library"), they are drawn as a single node called 
"ap" which is connected to both uplink switches.

The graphviz should use the device id to distinguish the node, but the device 
name as the label.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

Message: 2
Date: Fri, 27 Jun 2014 07:47:35 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1817] (Resolved) Missing
        dependencies    - ubuntu 14.04
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1817 has been updated by Carlos Vicente.

Status changed from In Progress to Resolved

Fixed. No problem. Thanks.
----------------------------------------
Bug #1817: Missing dependencies - ubuntu 14.04
https://osl.uoregon.edu/redmine/issues/1817#change-3202

Author: Brian Candler
Status: Resolved
Priority: Normal
Assignee: Carlos Vicente
Category: Netdot
Target version: 1.0.7
Resolution: fixed


Miscellaneous errors during install of Netdot on ubuntu 14.04; the fixes are 
pretty simple.

Problem 1:

<pre>
...
A new /etc/snmp/snmp.conf needs to be installed to point to the newly installed 
MIB files.
The current file will be backed up. Continue? [y/n] y
mv: cannot stat ?/etc/snmp/snmp.conf?: No such file or directory
There was a problem running mv -f /etc/snmp/snmp.conf 
/etc/snmp/snmp.conf.netdot_install
make: *** [apt-install] Error 2
</pre>

Workaround: <code>sudo apt-get install snmp</code> then re-run <code>make 
apt-install</code>

Fix:

<pre>
--- a/bin/perldeps.pl
+++ b/bin/perldeps.pl
@@ -64,7 +64,8 @@ my @DEPS = (
     {apt=> 'libssl-dev', rpm=>'openssl-devel'}, # needed by Net::DNS::ZoneFile:
     {cpan=>'Net::DNS::ZoneFile::Fast', apt=> 'dnssec-tools', rpm=>''},
     {cpan=>'Socket6', apt=> 'libsocket6-perl', rpm=>'perl-Socket6'},
-    {cpan=>'XML::Simple', apt=>'libxml-simple-perl', rpm=>'perl-XML-Simple'}
+    {cpan=>'XML::Simple', apt=>'libxml-simple-perl', rpm=>'perl-XML-Simple'},
+    {apt=>'snmp'},  # we expect snmp.conf
     ) ;

</pre>

Problem 2:

<pre>
...
SNMP::Info 2.06...................................MISSING
...
</pre>

What has happened is that libsnmp-info-perl has been installed, but not 
libsnmp-perl (which should be its dependency).

<pre>
$ dpkg-query -l | grep snmp
ii  libsnmp-base                          5.7.2~dfsg-8.1ubuntu3           all   
       SNMP configuration script, MIBs and documentation
ii  libsnmp-info-perl                     3.13-1                          all   
       OO Interface to Network devices and MIBs through SNMP
ii  libsnmp30:amd64                       5.7.2~dfsg-8.1ubuntu3           amd64 
       SNMP (Simple Network Management Protocol) library
ii  snmp                                  5.7.2~dfsg-8.1ubuntu3           amd64 
       SNMP (Simple Network Management Protocol) applications
</pre>

The problem is that the libsnmp-info-perl 3.13 package is missing a dependency 
on libsnmp-perl:

<pre>
Version: 3.13-1
Depends: perl
Filename: unstable/libsnmp-info-perl_3.13-1_all.deb

cf.

Version: 3.11-1
Depends: perl, libsnmp-perl
Suggests: netdisco-mibs-installer
Filename: pool/universe/libs/libsnmp-info-perl/libsnmp-info-perl_3.11-1_all.deb
</pre>

Workaround: <code>sudo apt-get install libsnmp-perl</code> - although the 
proper fix is to update the dependency.

Problem 3:

<pre>
sudo service apache2 restart
[Fri Jun 20 14:03:51.039859 2014] [so:warn] [pid 20696:tid 140375836866432] 
AH01574: module apreq_module is already loaded, skipping
</pre>

Fix: comment out this line

<pre>
#LoadModule apreq_module /usr/lib/apache2/modules/mod_apreq2.so
</pre>

(it's already commented out in netdot_apache24_local.conf)



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

Message: 3
Date: Fri, 27 Jun 2014 07:54:06 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1820] (Closed) Could not get a
        valid   iptree4 from cache
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1820 has been updated by Carlos Vicente.

Status changed from New to Closed
Resolution set to duplicate


----------------------------------------
Bug #1820: Could not get a valid iptree4 from cache
https://osl.uoregon.edu/redmine/issues/1820#change-3203

Author: Brian Candler
Status: Closed
Priority: Normal
Assignee: 
Category: 
Target version: 
Resolution: duplicate


I only saw this once, but it had a long traceback so I thought I'd report it.

<pre>
INFO - admin-core.example.net [Vl60]: Created Subnet 10.6.0.0/24
WARN - admin-core.example.net [Vl60]: Could not insert IP 10.6.0.1: Could not 
get a valid iptree4 from cache

Trace begun at /usr/local/netdot/lib/Netdot.pm line 105
Netdot::throw_fatal('Ipblock=HASH(0x5aa6598)', 'Could not get a valid iptree4 
from cache') called at /usr/local/netdot/lib/Netdot/Model/Ipblock.pm line 3561
Netdot::Model::Ipblock::_tree_get('Ipblock=HASH(0x5aa6598)') called at 
/usr/local/netdot/lib/Netdot/Model/Ipblock.pm line 3361
Netdot::Model::Ipblock::_tree_delete('Ipblock=HASH(0x5aa6598)') called at 
/usr/local/netdot/lib/Netdot/Model/Ipblock.pm line 1752
Netdot::Model::Ipblock::delete('Ipblock=HASH(0x5aa6598)') called at 
/usr/local/netdot/lib/Netdot/Model/Ipblock.pm line 679
Netdot::Model::Ipblock::insert('Ipblock', 'HASH(0x5ab1cd8)') called at 
/usr/local/netdot/lib/Netdot/Model/Interface.pm line 749
eval {...} at /usr/local/netdot/lib/Netdot/Model/Interface.pm line 748
Netdot::Model::Interface::update_ip('Interface=HASH(0x5aa6af0)', 'subnet', 
'10.6.0.0/24', 'version', 4, 'subs_inherit', 1, 'address', 10.6.0.1, 
'add_subnets', 1) called at /usr/local/netdot/lib/Netdot/Model/Interface.pm 
line 600
Netdot::Model::Interface::snmp_update('Interface', 'doc_status', 'snmp', 
'device', 'Device=HASH(0x59c0098)', 'monitored', 0, 'number', 60, 
'overwrite_descr', 1, 'name', 'Vl60', 'auto_dns', 1, 'snmp_info', 
'HASH(0x598b740)', 'add_subnets', 1, 'subs_inherit', 1, 'stp_instances', 
'HASH(0x5969fb0)') called at /usr/local/netdot/lib/Netdot/Model/Device.pm line 
6219
Netdot::Model::Device::_update_interfaces('Device=HASH(0x59c0098)', 'info', 
'HASH(0x4e009b0)', 'add_subnets', undef, 'subs_inherit', undef, 
'overwrite_descr', 1) called at /usr/local/netdot/lib/Netdot/Model/Device.pm 
line 3068
Netdot::Model::Device::info_update('Device=HASH(0x59c0098)', 'add_subnets', 
undef, 'subs_inherit', undef, 'bgp_peers', undef, 'pretend', undef, 'session', 
'SNMP::Info::Layer3::C6500=HASH(0x55566e8)', 'info', 'HASH(0x4e009b0)', 
'device_is_new', 1) called at /usr/local/netdot/lib/Netdot/Model/Device.pm line 
2821
Netdot::Model::Device::snmp_update('Device=HASH(0x59c0098)', 'session', 
'SNMP::Info::Layer3::C6500=HASH(0x55566e8)', 'info', 'HASH(0x4e009b0)', 
'device_is_new', 1) called at /usr/local/netdot/lib/Netdot/Model/Device.pm line 
1606
Netdot::Model::Device::discover('Device', 'name', 10.0.1.2, 'auth_proto', 
undef, 'sec_name', undef, 'communities', undef, 'priv_pass', undef, 
'sec_level', undef, 'auth_pass', undef, 'priv_proto', undef, 'version', undef, 
'timeoutretries', undef) called at /usr/local/netdot/lib/Netdot/Topology.pm 
line 595
eval {...} at /usr/local/netdot/lib/Netdot/Topology.pm line 594
Netdot::Topology::get_dp_links('Netdot::Topology', 'version', undef, 'retries', 
1, 'sec_level', undef, 'priv_proto', undef, 'auth_pass', undef, 'auth_proto', 
undef, 'priv_pass', undef, 'sec_name', undef, 'timeout', 1000000) called at 
/usr/local/netdot/lib/Netdot/Topology.pm line 74
Netdot::Topology::discover('Netdot::Topology', 'auth_pass', undef, 
'priv_proto', undef, 'retries', 1, 'sec_level', undef, 'version', undef, 
'timeout', 1000000, 'priv_pass', undef, 'sec_name', undef, 'auth_proto', undef) 
called at /usr/local/netdot/bin/updatedevices.pl line 231

INFO - admin-core.example.net: Interface 64 (Vl64) updated
</pre>



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

Message: 4
Date: Fri, 27 Jun 2014 08:27:20 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
        netdot-1.0.6-23-g22ddc22
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, netdot-1.0 has been updated
       via  22ddc22ecf208ee5fdcc93f249e53ab362b71334 (commit)
      from  da8ce06005b2958a7feadeb0c6640ebc084f7ba0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 22ddc22ecf208ee5fdcc93f249e53ab362b71334
Author: Carlos Vicente <[email protected]>
Date:   Fri Jun 27 11:27:10 2014 -0400

    Fixes for #1818

diff --git a/etc/Default.conf b/etc/Default.conf
index c2ca76f..9864ec1 100644
--- a/etc/Default.conf
+++ b/etc/Default.conf
@@ -294,8 +294,11 @@ IGNOREDEVS  => [ '1.3.6.1.4.1.11.2.3.9.1' ],
 IFNAME_SHORT => 0,
 
 # Ignore interfaces containing these strings in their names
-
-IFRESERVED  => 
'^bme|pime|mtun|lsi|jsrv|pimd|vt-|tap|pe-|pd-|dsc|rptr|unrouted|em\d+',
+# These are usually control plane interfaces which have no use for 
documentation
+# Notice that if you have Junos devices, you may want to include
+# 'bme\d+|me\d+' in this list, as those normally have RFC-1918 addresses
+# assigned to them, which causes Netdot to create bogus subnets.
+IFRESERVED  => '^(pime|mtun|lsi|jsrv|pimd|vt-|tap|pe-|pd-|dsc|rptr|unrouted)',
 
 # Ignore the following VLANs
 
diff --git a/lib/Netdot/Model/Device.pm b/lib/Netdot/Model/Device.pm
index 07991ed..700d6dd 100644
--- a/lib/Netdot/Model/Device.pm
+++ b/lib/Netdot/Model/Device.pm
@@ -2951,7 +2951,7 @@ sub info_update {
     unless ( ref($info) eq 'HASH' ){
        $self->throw_fatal("Model::Device::info_update: Invalid SNMP data 
structure");
     }
-    
+
     # Pretend works by turning off autocommit in the DB handle and rolling back
     # all changes at the end
     if ( $argv{pretend} ){
@@ -2960,7 +2960,7 @@ sub info_update {
             $self->throw_fatal("Model::Device::info_update: Unable to set 
AutoCommit off");
         }
     }
-    
+
     # Data that will be passed to the update method
     my %devtmp;
 
@@ -2970,7 +2970,7 @@ sub info_update {
                             sysdescription syslocation os collect_arp 
collect_fwt ) ){
        $devtmp{$field} = $info->{$field} if exists $info->{$field};
     }
-    
+
     ##############################################################
     if ( my $ipb = $self->_assign_snmp_target($info) ){
        $devtmp{snmp_target} = $ipb;
@@ -2978,16 +2978,16 @@ sub info_update {
 
     ##############################################################
     # Asset
-    my %asset_args = (
-       physaddr      => $self->_assign_base_mac($info) || undef,
-       reserved_for  => "", # needs to be cleared when device gets installed
-       );
+    my %asset_args;
+    my $base_mac = $self->_assign_base_mac($info);
+    $asset_args{physaddr} = $base_mac if defined $base_mac;
+    $asset_args{reserved_for}  = ""; # needs to be cleared when device gets 
installed
 
     # Make sure S/N contains something
     if (defined $info->{serial_number} && $info->{serial_number} =~ /\S+/ ){
        $asset_args{serial_number} = $info->{serial_number};
     }
-    
+
     # Search for an asset based on either serial number or base MAC
     # If two different assets are found, we will have to pick one and
     # delete the other, as this leads to errors
@@ -2995,7 +2995,7 @@ sub info_update {
        if $asset_args{serial_number};
     my $asset_phy = Asset->search(physaddr=>$asset_args{physaddr})->first
        if $asset_args{physaddr};
-    
+
     my $asset;
     if ( $asset_sn && $asset_phy ){
        if ($asset_sn->id != $asset_phy->id ){
@@ -5608,7 +5608,7 @@ sub _munge_speed_high {
 # Arguments
 #   snmp info hashref
 # Returns
-#   PhysAddr object
+#   PhysAddr object if successful, undef otherwise
 #
 sub _assign_base_mac {
     my ($self, $info) = @_;
@@ -5618,7 +5618,8 @@ sub _assign_base_mac {
     if ( $address && ($address = PhysAddr->validate($address)) ) {
        # OK
     }else{
-       $logger->debug(sub{"$host did not return base MAC. Using first 
available interface MAC."});
+       $logger->debug(sub{"$host does not provide a valid base MAC.".
+                            " Using first available interface MAC."});
        foreach my $iid ( sort { $a <=> $b}  keys %{$info->{interface}} ){
            if ( my $addr = $info->{interface}->{$iid}->{physaddr} ){
                next unless ($address = PhysAddr->validate($addr));

-----------------------------------------------------------------------

Summary of changes:
 etc/Default.conf           |  7 +++++--
 lib/Netdot/Model/Device.pm | 23 ++++++++++++-----------
 2 files changed, 17 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Netdot


------------------------------

Message: 5
Date: Fri, 27 Jun 2014 08:29:27 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch master updated.
        netdot-1.0.6-23-g22ddc22
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, master has been updated
       via  22ddc22ecf208ee5fdcc93f249e53ab362b71334 (commit)
      from  da8ce06005b2958a7feadeb0c6640ebc084f7ba0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 etc/Default.conf           |  7 +++++--
 lib/Netdot/Model/Device.pm | 23 ++++++++++++-----------
 2 files changed, 17 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Netdot


------------------------------

Message: 6
Date: Fri, 27 Jun 2014 08:48:17 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Feature #1791] Exclude static IP
        information from prune_db.pl's IP address pruning
To: [email protected], [email protected]
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1791 has been updated by Alexandros Tsourakis.


+1

I tried to use Static IPs to keep track of NAT but it got cleaned up after a 
while.
----------------------------------------
Feature #1791: Exclude static IP information from prune_db.pl's IP address 
pruning
https://osl.uoregon.edu/redmine/issues/1791#change-3204

Author: Timothy Snowberger
Status: New
Priority: Normal
Assignee: 
Category: AddressTracking
Target version: 
Resolution: 


Currently, prune_db.pl appears to include 'Discovered' and 'Static' IPs as part 
of the normal IP pruning process. 

Scenario:
Assume you have a routing device which does not report back ARP information, 
such as a non-Cisco device (or outdated Cisco device). A user then creates 
static IP assignments within a block inside of netdot manually by hand, which 
are not associated with actively polled devices, just description information. 
If you run prune_db.pl -M -I -d 90, these items are eventually deleted because 
they have a last seen time of whenever the static IP information was entered. 

We have a couple of subnets behind old routing devices that do not report ARP 
tables via SNMP, and would require some work to gather ARP information via CLI. 
As I'd still like to be able to prune discovered IPs, I'd like to suggest that 
either an option be added to prune_db.pl to exclude static IPs from the normal 
pruning process, or make an option within the netdot GUI that prevents deletion 
of static IPs that should never be removed, whether they are seen or not. I 
realize that marking IPs as "Reserved" could be another solution, but I prefer 
to label them as "Static". 

This appears to be the relevant section of code in prune_db.pl (lines 167 - 187:

<pre>
if ( $self{IPS} ){
    
###########################################################################################
    # Delete 'Discovered' and 'Static' IP addresses
    # Note: This will also delete A/AAAA records, ArpCache entries, DhcpScopes, 
etc.
    my $q = $dbh->prepare("SELECT ipblock.id
                           FROM   ipblock, ipblockstatus
                           WHERE  (ipblockstatus.name='Discovered'
                              OR  ipblockstatus.name='Static')
                             AND  ipblock.status=ipblockstatus.id
                             AND  ipblock.last_seen < ?");
    $q->execute($sqldate);
    while ( my $id = $q->fetchrow_array() ) {
        if ( my $ip = Ipblock->retrieve($id) ){
            $logger->debug(sprintf("Deleting IP %s", $ip->address));
            unless ( $self{PRETEND} ){
                $ip->delete() ;
                $rows_deleted{ipblock}++;
            }
        }
    }
}
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

Message: 7
Date: Fri, 27 Jun 2014 09:39:24 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Feature #1824] (In Progress) Improve
        Depth   Up / Depth Down display
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1824 has been updated by Brian Candler.

Status changed from Resolved to In Progress

Oops, I forgot to swap the head/tail labels over for the "up" direction. I can 
see this now that the lines can be made longer :-)

Fix: https://github.com/cvicente/Netdot/pull/21

----------------------------------------
Feature #1824: Improve Depth Up / Depth Down display
https://osl.uoregon.edu/redmine/issues/1824#change-3205

Author: Brian Candler
Status: In Progress
Priority: Normal
Assignee: Brian Candler
Category: UserInterface
Target version: 1.0.7
Resolution: fixed


When viewing the topology from the view of at a particular device, you can 
select "Depth Up" (towards the NMS_DEVICE) and "Depth Down" (away from the 
NMS_DEVICE)

This works, but it displays a tree rooted at the chosen device on the left and 
both "Up" and "Down" devices mixed together to the right.

What I was expecting was a chain of "Up" devices to be on the left, and the 
"Down" devices to the right.

In the attached example diagram, "lib-core" is actually the parent (closer to 
NMS_DEVICE) and the other devices are children, but you can't tell this from 
the diagram.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

Message: 8
Date: Fri, 27 Jun 2014 10:22:12 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Feature #1791] Exclude static IP
        information from prune_db.pl's IP address pruning
To: [email protected], [email protected]
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1791 has been updated by Timothy Snowberger.

File prune_db-no-statics.patch added

I removed the portion of the SQL statement that selects all static IPs and 
includes them in the prune process, so that dynamic IPs would still be pruned. 
I am personally of the opinion that an IP that is designated STATIC should 
require manual deletion, as these do not change frequently in our environment. 
Either that, or a flag should be provided to specify static IP inclusion. The 
default behavior to include static IPs still appears in 1.0.6, and the block of 
code does not appear to have changed any, so this patch should work. I have 
only tested this on Netdot 1.0.4. 

<pre>
--- prune_db.pl.orig    2014-06-27 09:55:46.650731394 -0700
+++ prune_db.pl 2014-06-27 10:19:36.856089539 -0700
@@ -166,12 +166,11 @@
 }
 if ( $self{IPS} ){
     
###########################################################################################
-    # Delete 'Discovered' and 'Static' IP addresses
+    # Delete 'Discovered' IP addresses
     # Note: This will also delete A/AAAA records, ArpCache entries, 
DhcpScopes, etc.
     my $q = $dbh->prepare("SELECT ipblock.id
                            FROM   ipblock, ipblockstatus
-                           WHERE  (ipblockstatus.name='Discovered'
-                              OR  ipblockstatus.name='Static')
+                           WHERE  ipblockstatus.name='Discovered'
                              AND  ipblock.status=ipblockstatus.id
                              AND  ipblock.last_seen < ?");
     $q->execute($sqldate);
</pre>
----------------------------------------
Feature #1791: Exclude static IP information from prune_db.pl's IP address 
pruning
https://osl.uoregon.edu/redmine/issues/1791#change-3206

Author: Timothy Snowberger
Status: New
Priority: Normal
Assignee: 
Category: AddressTracking
Target version: 
Resolution: 


Currently, prune_db.pl appears to include 'Discovered' and 'Static' IPs as part 
of the normal IP pruning process. 

Scenario:
Assume you have a routing device which does not report back ARP information, 
such as a non-Cisco device (or outdated Cisco device). A user then creates 
static IP assignments within a block inside of netdot manually by hand, which 
are not associated with actively polled devices, just description information. 
If you run prune_db.pl -M -I -d 90, these items are eventually deleted because 
they have a last seen time of whenever the static IP information was entered. 

We have a couple of subnets behind old routing devices that do not report ARP 
tables via SNMP, and would require some work to gather ARP information via CLI. 
As I'd still like to be able to prune discovered IPs, I'd like to suggest that 
either an option be added to prune_db.pl to exclude static IPs from the normal 
pruning process, or make an option within the netdot GUI that prevents deletion 
of static IPs that should never be removed, whether they are seen or not. I 
realize that marking IPs as "Reserved" could be another solution, but I prefer 
to label them as "Static". 

This appears to be the relevant section of code in prune_db.pl (lines 167 - 187:

<pre>
if ( $self{IPS} ){
    
###########################################################################################
    # Delete 'Discovered' and 'Static' IP addresses
    # Note: This will also delete A/AAAA records, ArpCache entries, DhcpScopes, 
etc.
    my $q = $dbh->prepare("SELECT ipblock.id
                           FROM   ipblock, ipblockstatus
                           WHERE  (ipblockstatus.name='Discovered'
                              OR  ipblockstatus.name='Static')
                             AND  ipblock.status=ipblockstatus.id
                             AND  ipblock.last_seen < ?");
    $q->execute($sqldate);
    while ( my $id = $q->fetchrow_array() ) {
        if ( my $ip = Ipblock->retrieve($id) ){
            $logger->debug(sprintf("Deleting IP %s", $ip->address));
            unless ( $self{PRETEND} ){
                $ip->delete() ;
                $rows_deleted{ipblock}++;
            }
        }
    }
}
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel


End of Netdot-devel Digest, Vol 87, Issue 12
********************************************

Reply via email to