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 #1904] Cannot start apache2 with    Netdot::Mason
      ([email protected])
   2. [Netdot - Bug #1911] (New) Mysql error: "Can't get        last
      insert id" ([email protected])
   3. [Netdot - Bug #1912] (New) Mysql error: "Data     truncated for
      column 'physaddr'" ([email protected])
   4. [Netdot - Bug #1911] Mysql error: "Can't get last insert id"
      ([email protected])
   5. [Netdot - Bug #1904] Cannot start apache2 with    Netdot::Mason
      ([email protected])
   6. [Netdot - Bug #1913] (New) Naming method 'sysname'        ignores
      sysname ([email protected])


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

Message: 1
Date: Fri, 24 Mar 2017 04:28:25 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1904] Cannot start apache2 with
        Netdot::Mason
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1904 has been updated by Brian Candler.


FYI, I had some other problems under 16.04 which I'm documenting here in case 
they are helpful to anyone else.

(1) Trying to add a device via the web interface failed.  No UDP packets sent, 
and I see:

<pre>
SNMP::Info::_validate_autoload_method(sysServices) Unable to resolve method. 
SNMP::Info::_validate_autoload_method(sysDescr) Unable to resolve method. <both 
again>

Device::_get_snmp_session: Cannot connect to 100.68.100.254. Tried communities: 
xxxxxxxx
</pre>

Cause: permissions on /etc/snmp/snmp.conf which were

<pre>
# ls -l /etc/snmp/snmp.conf
-rw-r----- 1 root snmp 2454 Mar 21 13:47 /etc/snmp/snmp.conf
</pre>

and hence not readable to www-data. Fixed by chmod +r.

(2) Mysql error "Can't get last insert id".  I will raise separate ticket for 
this.
----------------------------------------
Bug #1904: Cannot start apache2 with Netdot::Mason
https://osl.uoregon.edu/redmine/issues/1904#change-3384

Author: Dracula Lai
Status: New
Priority: High
Assignee: 
Category: 
Target version: 
Resolution: 


Followed the installation instruction up to the point of linking 
/etc/apache2/conf-enabled/netdot.conf.
Apache2 version is Apache/2.4.18 running on Ubuntu 16.04
Other versions are mod_apreq2-20090110/2.8.0 mod_perl/2.0.9 Perl/v5.22.1
The 'service apache2 restart' will be failed with the following error:

# systemctl status apache2.service
??? apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           ????apache2-systemd.conf
   Active: failed (Result: exit-code) since Fri 2016-08-05 11:19:00 HKT; 31min 
ago
     Docs: man:systemd-sysv-generator(8)
  Process: 21374 ExecStop=/etc/init.d/apache2 stop (code=exited, 
status=0/SUCCESS)
  Process: 21520 ExecStart=/etc/init.d/apache2 start (code=exited, 
status=1/FAILURE)

Aug 05 11:18:39 monitor systemd[1]: Stopped LSB: Apache2 web server.
Aug 05 11:18:39 monitor systemd[1]: Starting LSB: Apache2 web server...
Aug 05 11:18:39 monitor apache2[21520]:  * Starting Apache httpd web server 
apache2
Aug 05 11:18:40 monitor apache2[21520]: AH00558: apache2: Could not reliably 
determine the server's fully qualified domain name, us
Aug 05 11:19:00 monitor apache2[21520]:  *
Aug 05 11:19:00 monitor apache2[21520]:  * The apache2 instance did not start 
within 20 seconds. Please read the log files to disco
Aug 05 11:19:00 monitor systemd[1]: apache2.service: Control process exited, 
code=exited status=1
Aug 05 11:19:00 monitor systemd[1]: Failed to start LSB: Apache2 web server.
Aug 05 11:19:00 monitor systemd[1]: apache2.service: Unit entered failed state.
Aug 05 11:19:00 monitor systemd[1]: apache2.service: Failed with result 
'exit-code'.


The problem has been trimmed down that it stops when it calls the 'use 
Netdot::Mason;' in the netdot.conf

Anyway to solve this problem?

The make testdeps is fine as follows:

# make testdeps
Testing for required Perl modules
/usr/bin/perl bin/perldeps.pl test
RRDs..............................................ok
GraphViz..........................................ok
Module::Build.....................................ok
CGI...............................................ok
Class::DBI........................................ok
Class::DBI::AbstractSearch........................ok
Apache2::Request..................................ok
HTML::Mason.......................................ok
Apache::Session...................................ok
URI::Escape.......................................ok
SQL::Translator...................................ok
SNMP::Info 2.06...................................ok
NetAddr::IP 4.042.................................ok
Apache2::AuthCookie...............................ok
Apache2::SiteControl..............................ok
Log::Dispatch.....................................ok
Log::Log4perl.....................................ok
Parallel::ForkManager.............................ok
Net::Patricia 1.20................................ok
Authen::Radius....................................ok
Test::Simple......................................ok
Net::IRR..........................................ok
Time::Local.......................................ok
File::Spec........................................ok
Net::Appliance::Session...........................ok
BIND::Config::Parser..............................ok
Net::DNS..........................................ok
Text::ParseWords..................................ok
Carp::Assert......................................ok
Digest::SHA.......................................ok
Net::DNS::ZoneFile::Fast..........................ok
Socket6...........................................ok
XML::Simple.......................................ok



-- 
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, 24 Mar 2017 04:34:32 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1911] (New) Mysql error: "Can't
        get     last insert id"
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1911 has been reported by Brian Candler.

----------------------------------------
Bug #1911: Mysql error: "Can't get last insert id"
https://osl.uoregon.edu/redmine/issues/1911

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


(Netdot 1.0.7, ubuntu 16.04, mysql)

Problem: "Can't get last insert id" when trying to insert device, either from 
web interface or CLI.

<pre>
# /usr/local/netdot/bin/updatedevices.pl -H 100.68.100.254 -I -c NetManage
...
INFO - Inserting new Device: 100.68.100.254
ERROR: Error while inserting Device: Can't insert new Device: Can't get last 
insert id at /usr/local/netdot/bin/updatedevices.pl line 199.
 at /usr/local/netdot/bin/updatedevices.pl line 199.
</pre>

After cranking up debugging in etc/Site.conf:

<pre>
                  log4perl.category.Netdot::Model           = DEBUG, Syslog
                  log4perl.category.Netdot::Model::Device   = DEBUG, Syslog
</pre>

then I get:

<pre>
DEBUG - vtp-cndo.ws.nsrc.org type is: Server
INFO - Inserting new Device: 100.68.100.254
DEBUG - Device::insert: Device 2 already exists in DB as vtp-cndo.ws.nsrc.org
WARN - Device::assign_snmp_target: vtp-cndo.ws.nsrc.org: Could not insert 
snmp_target address: 100.68.100.254: Error while inserting Ipblock: Can't 
insert new Ipblock: Can't get last insert id at 
/usr/local/netdot/lib/Netdot/Model/Device.pm line 5693.
 at /usr/local/netdot/lib/Netdot/Model/Device.pm line 5693.

DEBUG - vtp-cndo.ws.nsrc.org does not provide a valid base MAC. Using first 
available interface MAC.
DEBUG - vtp-cndo.ws.nsrc.org: Could not insert base MAC: 5254004378F9: Error 
while inserting PhysAddr: Can't insert new PhysAddr: Can't get last insert id 
at /usr/local/netdot/lib/Netdot/Model/Device.pm line 5665.
 at /usr/local/netdot/lib/Netdot/Model/Device.pm line 5665.

DEBUG - vtp-cndo.ws.nsrc.org: No suitable base MAC found
ERROR: Error while inserting Asset: Can't insert new Asset: DBD::mysql::st 
execute failed: Cannot add or update a child row: a foreign key constraint 
fails (`netdot`.`asset`, CONSTRAINT `fk_physaddr_1` FOREIGN KEY (`physaddr`) 
REFERENCES `physaddr` (`id`)) [for Statement "INSERT INTO asset (physaddr, 
product_id, reserved_for)
VALUES (?, ?, ?)
" with ParamValues: 0=2, 1='1', 2=undef] at 
/usr/share/perl5/DBIx/ContextualFetch.pm line 52.
 at /usr/local/netdot/bin/updatedevices.pl line 199.
</pre>

It's clear the id column is defined correctly as autoincrement:

<pre>
mysql> desc physaddr;
+------------+--------------+------+-----+---------------------+----------------+
| Field      | Type         | Null | Key | Default             | Extra          
|
+------------+--------------+------+-----+---------------------+----------------+
| address    | varchar(128) | NO   | UNI | NULL                |                
|
| first_seen | timestamp    | NO   | MUL | 1970-01-02 00:00:01 |                
|
| id         | bigint(20)   | NO   | PRI | NULL                | auto_increment 
|
| last_seen  | timestamp    | NO   | MUL | 1970-01-02 00:00:01 |                
|
| static     | tinyint(1)   | NO   |     | 0                   |                
|
+------------+--------------+------+-----+---------------------+----------------+
5 rows in set (0.00 sec)
</pre>

And indeed in each case the insert has actually been successful (e.g. the 
device was inserted with id 2), so when I re-run the updatedevices.pl script it 
gets a bit further (finding the existing device, existing MAC address, existing 
asset, existing interface etc)

Aside: I think there's another bug here. Netdot isn't doing its updates within 
a transaction, or is not rolling back the transaction on exception, and I think 
it should.


-- 
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, 24 Mar 2017 04:44:51 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1912] (New) Mysql error: "Data
        truncated for column 'physaddr'"
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1912 has been reported by Brian Candler.

----------------------------------------
Bug #1912: Mysql error: "Data truncated for column 'physaddr'"
https://osl.uoregon.edu/redmine/issues/1912

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


Continuing after 1911, I get this:

<pre>
INFO - vtp-cndo.ws.nsrc.org: SNMP target address set to 100.68.100.254
DEBUG - vtp-cndo.ws.nsrc.org does not provide a valid base MAC. Using first 
available interface MAC.
DEBUG - vtp-cndo.ws.nsrc.org: Using existing 5254004378F9 as base bridge address
DEBUG - vtp-cndo.ws.nsrc.org: Old Ifs: 1, New Ifs: 18
DEBUG - vtp-cndo.ws.nsrc.org: Old IPs: 0, New IPs: 34
DEBUG - vtp-cndo.ws.nsrc.org: Interface with number 1 found
DEBUG - vtp-cndo.ws.nsrc.org: Interface 1 (lo) updated
DEBUG - vtp-cndo.ws.nsrc.org [lo]: IP 0000:0000:0000:0000:0000:0000:0000:0001 
is a loopback. Skipping.
DEBUG - Error while inserting PhysAddr: Can't insert new PhysAddr: Can't get 
last insert id at /usr/local/netdot/lib/Netdot/Model/Interface.pm line 445.
 at /usr/local/netdot/lib/Netdot/Model/Interface.pm line 445.

ERROR: Error while inserting Interface: Can't insert new Interface: 
DBD::mysql::st execute failed: Data truncated for column 'physaddr' at row 1 
[for Statement "INSERT INTO interface (bpdu_filter_enabled, bpdu_guard_enabled, 
neighbor_fixed, doc_status, dp_remote_id, overwrite_descr, monitored, 
admin_status, speed, dp_remote_ip, auto_dns, loop_guard_enabled, device, 
snmp_managed, monitorstatus, name, root_guard_enabled, neighbor_missed, 
description, dp_remote_type, dp_remote_port, oper_status, ignore_ip, type, 
number, physaddr)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
?, ?)
" with ParamValues: 0=0, 1=0, 2=0, 3='snmp', 4=undef, 5=1, 6=0, 7='up', 8=0, 
9=undef, 10='1', 11=0, 12='1', 13=1, 14='3', 15='br-cnd11', 16=0, 17=0, 
18=undef, 19=undef, 20=undef, 21='up', 22=0, 23='ethernet-csmacd', 24='10', 
25='86638C52BF8F'] at /usr/share/perl5/DBIx/ContextualFetch.pm line 52.
 at /usr/local/netdot/lib/Netdot/Model/Device.pm line 6252.
</pre>

This is wrong. interface.physaddr is defined as a BIGINT(30) column and should 
contain the physaddr *id* not the MAC address itself.

Looks like this is a cascading error:
- something went wrong when inserting the physaddr
- instead of aborting, it blindly carried on
- it decided to use the MAC address instead of the physaddr id

I think I can see what's happening: in sub snmp_update 
(lib/Netdot/Model/Interface.pm), all the values from @$info->{$field}@ are 
copied to @$iftmp{$field}@, which this includes @$info->{physaddr}@

But this is not reset on error:

<pre>
$iftmp{physaddr} = $physaddr->id if $physaddr;
</pre>

I think should be instead:

<pre>
$iftmp{physaddr} = $physaddr ? $physaddr->id : undef;
</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, 24 Mar 2017 05:07:15 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1911] Mysql error: "Can't get
        last    insert id"
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1911 has been updated by Brian Candler.


Turns out this is a known issue with Class::DBI and mysql 5.7:

https://rt.cpan.org/Public/Bug/Display.html?id=118491

That includes a patch you can make to @/usr/share/perl5/Class/DBI.pm@, and I 
can confirm this fixes the problem.

Ubuntu has Class::DBI 3.0.17 which is the latest - from October 2007!  It seems 
that Class::DBI is abandonware :-(
----------------------------------------
Bug #1911: Mysql error: "Can't get last insert id"
https://osl.uoregon.edu/redmine/issues/1911#change-3385

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


(Netdot 1.0.7, ubuntu 16.04, mysql)

Problem: "Can't get last insert id" when trying to insert device, either from 
web interface or CLI.

<pre>
# /usr/local/netdot/bin/updatedevices.pl -H 100.68.100.254 -I -c NetManage
...
INFO - Inserting new Device: 100.68.100.254
ERROR: Error while inserting Device: Can't insert new Device: Can't get last 
insert id at /usr/local/netdot/bin/updatedevices.pl line 199.
 at /usr/local/netdot/bin/updatedevices.pl line 199.
</pre>

After cranking up debugging in etc/Site.conf:

<pre>
                  log4perl.category.Netdot::Model           = DEBUG, Syslog
                  log4perl.category.Netdot::Model::Device   = DEBUG, Syslog
</pre>

then I get:

<pre>
DEBUG - vtp-cndo.ws.nsrc.org type is: Server
INFO - Inserting new Device: 100.68.100.254
DEBUG - Device::insert: Device 2 already exists in DB as vtp-cndo.ws.nsrc.org
WARN - Device::assign_snmp_target: vtp-cndo.ws.nsrc.org: Could not insert 
snmp_target address: 100.68.100.254: Error while inserting Ipblock: Can't 
insert new Ipblock: Can't get last insert id at 
/usr/local/netdot/lib/Netdot/Model/Device.pm line 5693.
 at /usr/local/netdot/lib/Netdot/Model/Device.pm line 5693.

DEBUG - vtp-cndo.ws.nsrc.org does not provide a valid base MAC. Using first 
available interface MAC.
DEBUG - vtp-cndo.ws.nsrc.org: Could not insert base MAC: 5254004378F9: Error 
while inserting PhysAddr: Can't insert new PhysAddr: Can't get last insert id 
at /usr/local/netdot/lib/Netdot/Model/Device.pm line 5665.
 at /usr/local/netdot/lib/Netdot/Model/Device.pm line 5665.

DEBUG - vtp-cndo.ws.nsrc.org: No suitable base MAC found
ERROR: Error while inserting Asset: Can't insert new Asset: DBD::mysql::st 
execute failed: Cannot add or update a child row: a foreign key constraint 
fails (`netdot`.`asset`, CONSTRAINT `fk_physaddr_1` FOREIGN KEY (`physaddr`) 
REFERENCES `physaddr` (`id`)) [for Statement "INSERT INTO asset (physaddr, 
product_id, reserved_for)
VALUES (?, ?, ?)
" with ParamValues: 0=2, 1='1', 2=undef] at 
/usr/share/perl5/DBIx/ContextualFetch.pm line 52.
 at /usr/local/netdot/bin/updatedevices.pl line 199.
</pre>

It's clear the id column is defined correctly as autoincrement:

<pre>
mysql> desc physaddr;
+------------+--------------+------+-----+---------------------+----------------+
| Field      | Type         | Null | Key | Default             | Extra          
|
+------------+--------------+------+-----+---------------------+----------------+
| address    | varchar(128) | NO   | UNI | NULL                |                
|
| first_seen | timestamp    | NO   | MUL | 1970-01-02 00:00:01 |                
|
| id         | bigint(20)   | NO   | PRI | NULL                | auto_increment 
|
| last_seen  | timestamp    | NO   | MUL | 1970-01-02 00:00:01 |                
|
| static     | tinyint(1)   | NO   |     | 0                   |                
|
+------------+--------------+------+-----+---------------------+----------------+
5 rows in set (0.00 sec)
</pre>

And indeed in each case the insert has actually been successful (e.g. the 
device was inserted with id 2), so when I re-run the updatedevices.pl script it 
gets a bit further (finding the existing device, existing MAC address, existing 
asset, existing interface etc)

Aside: I think there's another bug here. Netdot isn't doing its updates within 
a transaction, or is not rolling back the transaction on exception, and I think 
it should.


-- 
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: 5
Date: Fri, 24 Mar 2017 05:08:30 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1904] Cannot start apache2 with
        Netdot::Mason
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1904 has been updated by Brian Candler.


Mysql error "Can't get last insert id" is issue #1911. Ubuntu 16.04 comes with 
mysql-5.7, but Class::DBI has not been updated to work with it.
----------------------------------------
Bug #1904: Cannot start apache2 with Netdot::Mason
https://osl.uoregon.edu/redmine/issues/1904#change-3386

Author: Dracula Lai
Status: New
Priority: High
Assignee: 
Category: 
Target version: 
Resolution: 


Followed the installation instruction up to the point of linking 
/etc/apache2/conf-enabled/netdot.conf.
Apache2 version is Apache/2.4.18 running on Ubuntu 16.04
Other versions are mod_apreq2-20090110/2.8.0 mod_perl/2.0.9 Perl/v5.22.1
The 'service apache2 restart' will be failed with the following error:

# systemctl status apache2.service
??? apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           ????apache2-systemd.conf
   Active: failed (Result: exit-code) since Fri 2016-08-05 11:19:00 HKT; 31min 
ago
     Docs: man:systemd-sysv-generator(8)
  Process: 21374 ExecStop=/etc/init.d/apache2 stop (code=exited, 
status=0/SUCCESS)
  Process: 21520 ExecStart=/etc/init.d/apache2 start (code=exited, 
status=1/FAILURE)

Aug 05 11:18:39 monitor systemd[1]: Stopped LSB: Apache2 web server.
Aug 05 11:18:39 monitor systemd[1]: Starting LSB: Apache2 web server...
Aug 05 11:18:39 monitor apache2[21520]:  * Starting Apache httpd web server 
apache2
Aug 05 11:18:40 monitor apache2[21520]: AH00558: apache2: Could not reliably 
determine the server's fully qualified domain name, us
Aug 05 11:19:00 monitor apache2[21520]:  *
Aug 05 11:19:00 monitor apache2[21520]:  * The apache2 instance did not start 
within 20 seconds. Please read the log files to disco
Aug 05 11:19:00 monitor systemd[1]: apache2.service: Control process exited, 
code=exited status=1
Aug 05 11:19:00 monitor systemd[1]: Failed to start LSB: Apache2 web server.
Aug 05 11:19:00 monitor systemd[1]: apache2.service: Unit entered failed state.
Aug 05 11:19:00 monitor systemd[1]: apache2.service: Failed with result 
'exit-code'.


The problem has been trimmed down that it stops when it calls the 'use 
Netdot::Mason;' in the netdot.conf

Anyway to solve this problem?

The make testdeps is fine as follows:

# make testdeps
Testing for required Perl modules
/usr/bin/perl bin/perldeps.pl test
RRDs..............................................ok
GraphViz..........................................ok
Module::Build.....................................ok
CGI...............................................ok
Class::DBI........................................ok
Class::DBI::AbstractSearch........................ok
Apache2::Request..................................ok
HTML::Mason.......................................ok
Apache::Session...................................ok
URI::Escape.......................................ok
SQL::Translator...................................ok
SNMP::Info 2.06...................................ok
NetAddr::IP 4.042.................................ok
Apache2::AuthCookie...............................ok
Apache2::SiteControl..............................ok
Log::Dispatch.....................................ok
Log::Log4perl.....................................ok
Parallel::ForkManager.............................ok
Net::Patricia 1.20................................ok
Authen::Radius....................................ok
Test::Simple......................................ok
Net::IRR..........................................ok
Time::Local.......................................ok
File::Spec........................................ok
Net::Appliance::Session...........................ok
BIND::Config::Parser..............................ok
Net::DNS..........................................ok
Text::ParseWords..................................ok
Carp::Assert......................................ok
Digest::SHA.......................................ok
Net::DNS::ZoneFile::Fast..........................ok
Socket6...........................................ok
XML::Simple.......................................ok



-- 
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: 6
Date: Fri, 24 Mar 2017 05:23:21 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1913] (New) Naming method
        'sysname'       ignores sysname
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1913 has been reported by Brian Candler.

----------------------------------------
Bug #1913: Naming method 'sysname' ignores sysname
https://osl.uoregon.edu/redmine/issues/1913

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


Here is a device with a valid sysName:

<pre>
# snmpwalk -v2c -c NetManage 100.68.100.235 sysName
SNMPv2-MIB::sysName.0 = STRING: transit1.nren.ws.nsrc.org
</pre>

This is what I want the device to be known as in Netdot.

The forward DNS matches its SNMP IP:

<pre>
# dig +short transit1.nren.ws.nsrc.org
100.68.100.235
</pre>

But the reverse DNS points to a more detailed name (including the interface).

<pre>
# dig +short -x 100.68.100.235
fa0-0.transit1.nren.ws.nsrc.org.
# dig +short fa0-0.transit1.nren.ws.nsrc.org
100.68.100.235
</pre>

Site.conf has:

<pre>
DEVICE_NAMING_METHOD_ORDER => [ 'sysname', 'snmp_target' ],
</pre>

Therefore I was expecting it to take the Netdot device name from the sysName. 
But when I add the device, it uses the reverse DNS for the target address 
instead.

<pre>
# /usr/local/netdot/bin/updatedevices.pl -H 100.68.100.235 -I -c xxxxxxxx
...
SNMP::Info::specify() - Changed Class to SNMP::Info::Layer3::Cisco.
DEBUG - SNMPv2 session with host 100.68.100.235 established
DEBUG - Device::get_snmp_info: SNMP target is 100.68.100.235
...
DEBUG - Device::get_snmp_info: Finished getting SNMP info from 100.68.100.235
DEBUG - Device::discover: Device 100.68.100.235 does not yet exist
DEBUG - Device::_get_main_ip: Trying method sysname
DEBUG - Device::_get_main_ip: Chose 100.68.100.235 using naming method: sysname
DEBUG - Device::assign_name: 100.68.100.235 resolves to 
fa0-0.transit1.nren.ws.nsrc.org
INFO - Inserted new RR: fa0-0.transit1.nren.ws.nsrc.org
</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 120, Issue 3
********************************************

Reply via email to