Send Netdot-users mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://osl.uoregon.edu/mailman/listinfo/netdot-users
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-users digest..."
Today's Topics:
1. Re: Database update problem (Roberto Greiner)
2. Re: Database update problem (Brian Candler)
----------------------------------------------------------------------
Message: 1
Date: Wed, 10 Sep 2014 16:30:03 -0300
From: Roberto Greiner <[email protected]>
Subject: Re: [Netdot-users] Database update problem
To: Brian Candler <[email protected]>, [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
Brian,
it took some time, but the duplication error reappeared today. I'm
adding the requested information below.
Roberto Greiner
On 04/07/2014 10:24, Brian Candler wrote:
> On 04/07/2014 12:48, Roberto Greiner wrote:
>> Hi,
>>
>> I ran the recipe and removed both interfaces. But when I ran the
>> updatedevices script, it crashed with the following message:
>>
>> root@leonis:/usr/local/netdot/bin# ./updatedevices.pl -I -H
>> xen-server-ii.ipiranga.unesp.br
>> INFO - ./updatedevices.pl started at Fri Jul 4 08:27:45 2014
>> INFO - Updating single device: xen-server-ii.ipiranga.unesp.br
>> INFO - xen-server-ii.ipiranga.unesp.br: Interface vif19.0 had number:
>> -1, now has: 63
>> Netdot::Model::Interface 936 destroyed without saving changes to
>> doc_status, number at ./updatedevices.pl line 199
>> ERROR: Error while updating Netdot::Model::Interface: Can't update 936:
>> DBD::mysql::st execute failed: Duplicate entry '17-63-vif19.0' for key
>> 'interface1' [for Statement "UPDATE interface
>> SET doc_status = ?, number = ?
>> WHERE id=?
>> " with ParamValues: 0='snmp', 1='63', 2='936'] at
>> /usr/share/perl5/DBIx/ContextualFetch.pm line 52.
>> at /usr/local/netdot/lib/Netdot/Model/Device.pm line 6171
>
> OK. The problem in this case is that the name is not unique (i.e. some
> other interface is called "vif19.0")
>
> I thought this meant there are database constraints saying that the
> interface number *and* the interface name both have to be unique for
> any interface on a given device, and these could conflict during an
> update(*).
>
> But actually, it turns out that the constraint is only on the number
> and name *both* being the same:
>
> (mysql)
> UNIQUE KEY `interface1` (`device`,`number`,`name`),
> (postgres)
> "interface1" UNIQUE CONSTRAINT, btree (device, number, name)
>
> That is: it's OK for two interfaces on a device to have number 4, or
> two interfaces on a device to be called Gi1/0/1; but not for there to
> be two interfaces which are (4, Gi1/0/1). I'm not sure if this is what
> Carlos had intended; it would be stronger to have two constraints, but
> would introduce the problem you described.
>
> From your error message it's clear that it's trying to do an update
> which would result in two interfaces which both had number 63 *and*
> name vif19.0. That looks wrong, unless the Linux box is reporting two
> rows with the same number or the same name.
>
> To debug this, the next time this happens can you show the output of:
>
The log message this time was:
Sep 10 16:00:07 leonis netdot: ERROR - Error while updating
Netdot::Model::Interface: Can't update 1902: DBD::mysql::st execute
failed: Duplicate entry '221-10-vif1.0' for key 'interface1' [for
Statement "UPDATE interface#012SET doc_status = ?, number = ?,
oper_status = ?, admin_status = ?#012WHERE id=?#012" with ParamValues:
0='snmp', 1='10', 2='up', 3='up', 4='1902'] at
/usr/share/perl5/DBIx/ContextualFetch.pm line 52.#012 at
/usr/local/netdot/lib/Netdot/Model/Device.pm line 6171#012
> (1) select id,number,name from interface where device=<deviceid>
Device=<deviceid> returns empty. id=<deviceid> returns the following:
mysql> select id,number,name from interface where id="1902";
+------+--------+--------+
| id | number | name |
+------+--------+--------+
| 1902 | 11 | vif1.0 |
+------+--------+--------+
1 row in set (0.00 sec)
>
> (2) updatedevices -I -H <hostname> -d
Ok, that's a long output:
INFO - ./updatedevices.pl started at Wed Sep 10 16:24:51 2014
INFO - Updating single device: lalande.ipiranga.unesp.br
DEBUG - Zone::search: lalande.ipiranga.unesp.br
DEBUG - Zone::search: ipiranga.unesp.br
DEBUG - Zone::search: found: ipiranga.unesp.br
DEBUG - Device::discover: Device lalande.ipiranga.unesp.br already
exists in DB
DEBUG - Device::_get_snmp_session: Trying SNMPv2 session with
200.145.9.38, community oor7On,a
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/3com
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/allied
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/arista
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/aruba
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/asante
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/cabletron
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/cisco
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/cyclades
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/dell
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/dlink
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/enterasys
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/extreme
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/foundry
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/hp
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/juniper
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/netscreen
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/net-snmp
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/nortel
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/rfc
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/megatec
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/linksys
SNMP::Info::_global layers : SNMPv2-MIB::sysServices.0 : .1.3.6.1.2.1.1.7.0
SNMP::Info::_global(layers) NOSUCHINSTANCE at
/usr/local/netdot/lib/Netdot/Model/Device.pm line 3915
SNMP::Info::_global description : SNMPv2-MIB::sysDescr.0 :
.1.3.6.1.2.1.1.1.0
Device doesn't implement sysServices but did return sysDescr. Might give
unexpected results.
at /usr/local/netdot/lib/Netdot/Model/Device.pm line 3915
SNMP::Info::_global id : SNMPv2-MIB::sysObjectID.0 : .1.3.6.1.2.1.1.2.0
SNMP::Info 3.17
SNMP::Info::device_type() layers:00000000 id:8072 sysDescr:"Linux
lalande 2.6.32.43-0.4.1.xs1.8.0.853.170791xen #1 SMP Mon Mar 3 06:36:39
EST 2014 i686"
SNMP::Info::_global layers : SNMPv2-MIB::sysServices.0 : .1.3.6.1.2.1.1.7.0
SNMP::Info::_global(layers) NOSUCHINSTANCE at
/usr/local/netdot/lib/Netdot/Model/Device.pm line 3915
SNMP::Info::_global layers : SNMPv2-MIB::sysServices.0 : .1.3.6.1.2.1.1.7.0
SNMP::Info::_global(layers) NOSUCHINSTANCE at
/usr/local/netdot/lib/Netdot/Model/Device.pm line 3915
SNMP::Info::_global layers : SNMPv2-MIB::sysServices.0 : .1.3.6.1.2.1.1.7.0
SNMP::Info::_global(layers) NOSUCHINSTANCE at
/usr/local/netdot/lib/Netdot/Model/Device.pm line 3915
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/3com
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/allied
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/arista
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/aruba
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/asante
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/cabletron
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/cisco
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/cyclades
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/dell
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/dlink
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/enterasys
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/extreme
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/foundry
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/hp
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/juniper
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/netscreen
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/net-snmp
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/nortel
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/rfc
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/megatec
SNMP::Info::init() - Adding new mibdir:/usr/share/netdisco/mibs/linksys
SNMP::Info::specify() - Changed Class to SNMP::Info::Layer3::NetSNMP.
DEBUG - Device::get_snmp_session: 200.145.9.38 is:
SNMP::Info::Layer3::NetSNMP
DEBUG - SNMPv2 session with host 200.145.9.38 established
SNMP::Info::_global id : SNMPv2-MIB::sysObjectID.0 : .1.3.6.1.2.1.1.2.0
DEBUG - Device::get_snmp_info: SNMP target is 200.145.9.38
SNMP::Info::_validate_autoload_method(hasCDP) Unable to resolve method.
SNMP::Info::_load_attr e_descr : ENTITY-MIB::entPhysicalDescr :
.1.3.6.1.2.1.47.1.1.1.1.2
SNMP::Info::_load_attr i_type : IF-MIB::ifType : .1.3.6.1.2.1.2.2.1.3
SNMP::Info::_load_attr i_alias : IF-MIB::ifAlias : .1.3.6.1.2.1.31.1.1.1.18
SNMP::Info::_load_attr orig_i_speed : IF-MIB::ifSpeed : .1.3.6.1.2.1.2.2.1.5
SNMP::Info::_load_attr i_up : IF-MIB::ifOperStatus : .1.3.6.1.2.1.2.2.1.8
SNMP::Info::_load_attr i_up_admin : IF-MIB::ifAdminStatus :
.1.3.6.1.2.1.2.2.1.7
SNMP::Info::_load_attr el_index : EtherLike-MIB::dot3StatsIndex :
.1.3.6.1.2.1.10.7.2.1.1
SNMP::Info::_load_attr el_duplex : EtherLike-MIB::dot3StatsDuplexStatus
: .1.3.6.1.2.1.10.7.2.1.19
SNMP::Info::_validate_autoload_method(i_duplex_admin) Unable to resolve
method.
SNMP::Info::_load_attr ip_index : IP-MIB::ipAdEntIfIndex :
.1.3.6.1.2.1.4.20.1.2
SNMP::Info::_load_attr ip_netmask : IP-MIB::ipAdEntNetMask :
.1.3.6.1.2.1.4.20.1.3
SNMP::Info::_load_attr i_mac : IF-MIB::ifPhysAddress : .1.3.6.1.2.1.2.2.1.6
SNMP::Info::_load_attr bp_index : BRIDGE-MIB::dot1dBasePortIfIndex :
.1.3.6.1.2.1.17.1.4.1.2
SNMP::Info::_load_attr qb_v_egress :
Q-BRIDGE-MIB::dot1qVlanStaticEgressPorts : .1.3.6.1.2.1.17.7.1.4.3.1.2
SNMP::Info::_load_attr qb_v_name : Q-BRIDGE-MIB::dot1qVlanStaticName :
.1.3.6.1.2.1.17.7.1.4.3.1.1
SNMP::Info::_load_attr v_name : Q-BRIDGE-MIB::dot1qVlanStaticName :
.1.3.6.1.2.1.17.7.1.4.3.1.1
SNMP::Info::_validate_autoload_method(v_state) Unable to resolve method.
SNMP::Info::_load_attr i_description : IF-MIB::ifDescr :
.1.3.6.1.2.1.2.2.1.2
SNMP::Info::_load_attr ip_addr6_pfx : IP-MIB::ipAddressPrefix :
.1.3.6.1.2.1.4.34.1.5
SNMP::Info::IPv6::ipv6_addr_prefix: data comes from IP-MIB.
SNMP::Info::_load_attr entPhysicalDescr : ENTITY-MIB::entPhysicalDescr :
.1.3.6.1.2.1.47.1.1.1.1.2
SNMP::Info::_load_attr e_type : ENTITY-MIB::entPhysicalVendorType :
.1.3.6.1.2.1.47.1.1.1.1.3
SNMP::Info::_load_attr e_parent : ENTITY-MIB::entPhysicalContainedIn :
.1.3.6.1.2.1.47.1.1.1.1.4
SNMP::Info::_load_attr e_name : ENTITY-MIB::entPhysicalName :
.1.3.6.1.2.1.47.1.1.1.1.7
SNMP::Info::_load_attr e_class : ENTITY-MIB::entPhysicalClass :
.1.3.6.1.2.1.47.1.1.1.1.5
SNMP::Info::_load_attr e_pos : ENTITY-MIB::entPhysicalParentRelPos :
.1.3.6.1.2.1.47.1.1.1.1.6
SNMP::Info::_load_attr e_descr : ENTITY-MIB::entPhysicalDescr :
.1.3.6.1.2.1.47.1.1.1.1.2
SNMP::Info::_load_attr e_hwver : ENTITY-MIB::entPhysicalHardwareRev :
.1.3.6.1.2.1.47.1.1.1.1.8
SNMP::Info::_load_attr e_fwver : ENTITY-MIB::entPhysicalFirmwareRev :
.1.3.6.1.2.1.47.1.1.1.1.9
SNMP::Info::_load_attr e_swver : ENTITY-MIB::entPhysicalSoftwareRev :
.1.3.6.1.2.1.47.1.1.1.1.10
SNMP::Info::_load_attr e_model : ENTITY-MIB::entPhysicalModelName :
.1.3.6.1.2.1.47.1.1.1.1.13
SNMP::Info::_load_attr e_serial : ENTITY-MIB::entPhysicalSerialNum :
.1.3.6.1.2.1.47.1.1.1.1.11
SNMP::Info::_load_attr e_fru : ENTITY-MIB::entPhysicalIsFRU :
.1.3.6.1.2.1.47.1.1.1.1.16
SNMP::Info::_load_attr bgp_peers : BGP4-MIB::bgpPeerLocalAddr :
.1.3.6.1.2.1.15.3.1.5
SNMP::Info::_load_attr bgp_peer_id : BGP4-MIB::bgpPeerIdentifier :
.1.3.6.1.2.1.15.3.1.1
SNMP::Info::_load_attr bgp_peer_as : BGP4-MIB::bgpPeerRemoteAs :
.1.3.6.1.2.1.15.3.1.9
SNMP::Info::_load_attr bgp_peer_state : BGP4-MIB::bgpPeerState :
.1.3.6.1.2.1.15.3.1.2
SNMP::Info::_global layers : SNMPv2-MIB::sysServices.0 : .1.3.6.1.2.1.1.7.0
SNMP::Info::_global(layers) NOSUCHINSTANCE at
/usr/local/netdot/lib/Netdot/Model/Device.pm line 786
SNMP::Info::_global ipforwarding : IP-MIB::ipForwarding.0 :
.1.3.6.1.2.1.4.1.0
SNMP::Info::_global description : SNMPv2-MIB::sysDescr.0 :
.1.3.6.1.2.1.1.1.0
SNMP::Info::_global netsnmp_vers : UCD-SNMP-MIB::versionTag.0 :
.1.3.6.1.4.1.2021.100.2.0
SNMP::Info::_global b_mac : BRIDGE-MIB::dot1dBaseBridgeAddress.0 :
.1.3.6.1.2.1.17.1.1.0
SNMP::Info::_global(b_mac) NOSUCHOBJECT at
/usr/local/netdot/lib/Netdot/Model/Device.pm line 803
SNMP::Info::_global mac : IF-MIB::ifPhysAddress.1 : .1.3.6.1.2.1.2.2.1.6.1
SNMP::Info::_global name : SNMPv2-MIB::sysName.0 : .1.3.6.1.2.1.1.5.0
SNMP::Info::_global router_ip : OSPF-MIB::ospfRouterId.0 :
.1.3.6.1.2.1.14.1.1.0
SNMP::Info::_global(router_ip) NOSUCHOBJECT at
/usr/local/netdot/lib/Netdot/Model/Device.pm line 805
SNMP::Info::_load_attr ospf_ip : OSPF-MIB::ospfHostIpAddress :
.1.3.6.1.2.1.14.6.1.1
SNMP::Info::_global contact : SNMPv2-MIB::sysContact.0 : .1.3.6.1.2.1.1.4.0
SNMP::Info::_global location : SNMPv2-MIB::sysLocation.0 :
.1.3.6.1.2.1.1.6.0
DEBUG - Device::get_snmp_info: 200.145.9.38: Interface tap10.0 ignored
per config option (IFRESERVED)
SNMP::Info::_load_attr ip_addr6_index : IP-MIB::ipAddressIfIndex :
.1.3.6.1.2.1.4.34.1.3
SNMP::Info::IPv6::ipv6_index: data comes from IP-MIB.
DEBUG - Device::get_snmp_info: Checking for BGPPeers
DEBUG - Device::get_snmp_info: Finished getting SNMP info from 200.145.9.38
DEBUG - lalande.ipiranga.unesp.br did not return base MAC. Using first
available interface MAC.
DEBUG - lalande.ipiranga.unesp.br: Using existing AC162D791B40 as base
bridge address
DEBUG - lalande.ipiranga.unesp.br: Old Ifs: 43, New Ifs: 22
DEBUG - lalande.ipiranga.unesp.br: Old IPs: 2, New IPs: 2
DEBUG - lalande.ipiranga.unesp.br: Interface with name lo found
DEBUG - lalande.ipiranga.unesp.br: Interface 1 (lo) updated
DEBUG - lalande.ipiranga.unesp.br: Interface with name vif1.0 found
INFO - lalande.ipiranga.unesp.br: Interface vif1.0 had number: 11, now
has: 10
Netdot::Model::Interface 1902 destroyed without saving changes to
doc_status, number, oper_status, admin_status at ./updatedevices.pl line 199
ERROR: Error while updating Netdot::Model::Interface: Can't update 1902:
DBD::mysql::st execute failed: Duplicate entry '221-10-vif1.0' for key
'interface1' [for Statement "UPDATE interface
SET doc_status = ?, number = ?, oper_status = ?, admin_status = ?
WHERE id=?
" with ParamValues: 0='snmp', 1='10', 2='up', 3='up', 4='1902'] at
/usr/share/perl5/DBIx/ContextualFetch.pm line 52.
at /usr/local/netdot/lib/Netdot/Model/Device.pm line 6171
>
> (3)
> snmpwalk -v2c -c <community> <hostname> ifName
IF-MIB::ifName.1 = STRING: lo
IF-MIB::ifName.2 = STRING: eth0
IF-MIB::ifName.3 = STRING: eth1
IF-MIB::ifName.4 = STRING: eth2
IF-MIB::ifName.5 = STRING: eth3
IF-MIB::ifName.6 = STRING: xenbr0
IF-MIB::ifName.7 = STRING: xenbr2
IF-MIB::ifName.8 = STRING: xenbr1
IF-MIB::ifName.9 = STRING: xenbr3
IF-MIB::ifName.10 = STRING: vif1.0
IF-MIB::ifName.12 = STRING: vif3.0
IF-MIB::ifName.14 = STRING: vif4.0
IF-MIB::ifName.16 = STRING: vif2.0
IF-MIB::ifName.18 = STRING: vif5.0
IF-MIB::ifName.20 = STRING: vif6.1
IF-MIB::ifName.22 = STRING: vif10.0
IF-MIB::ifName.23 = STRING: tap10.0
IF-MIB::ifName.24 = STRING: vif7.0
IF-MIB::ifName.26 = STRING: vif12.0
IF-MIB::ifName.28 = STRING: vif8.1
IF-MIB::ifName.30 = STRING: vif9.1
IF-MIB::ifName.32 = STRING: vif11.0
IF-MIB::ifName.34 = STRING: vif13.0
> snmpwalk -v2c -c <community> <hostname> ifDescr
IF-MIB::ifDescr.1 = STRING: "lo"
IF-MIB::ifDescr.2 = STRING: "eth0"
IF-MIB::ifDescr.3 = STRING: "eth1"
IF-MIB::ifDescr.4 = STRING: "eth2"
IF-MIB::ifDescr.5 = STRING: "eth3"
IF-MIB::ifDescr.6 = STRING: "xenbr0"
IF-MIB::ifDescr.7 = STRING: "xenbr2"
IF-MIB::ifDescr.8 = STRING: "xenbr1"
IF-MIB::ifDescr.9 = STRING: "xenbr3"
IF-MIB::ifDescr.10 = STRING: "vif1.0"
IF-MIB::ifDescr.12 = STRING: "vif3.0"
IF-MIB::ifDescr.14 = STRING: "vif4.0"
IF-MIB::ifDescr.16 = STRING: "vif2.0"
IF-MIB::ifDescr.18 = STRING: "vif5.0"
IF-MIB::ifDescr.20 = STRING: "vif6.1"
IF-MIB::ifDescr.22 = STRING: "vif10.0"
IF-MIB::ifDescr.23 = STRING: "tap10.0"
IF-MIB::ifDescr.24 = STRING: "vif7.0"
IF-MIB::ifDescr.26 = STRING: "vif12.0"
IF-MIB::ifDescr.28 = STRING: "vif8.1"
IF-MIB::ifDescr.30 = STRING: "vif9.1"
IF-MIB::ifDescr.32 = STRING: "vif11.0"
IF-MIB::ifDescr.34 = STRING: "vif13.0"
I hope that's all the info needed for debugging the problem. I will
refrain from removing the bogus entry in the database for a day or two,
in case you need any other information.
Thanks,
Roberto
--
-----------------------------------------------------
Marcos Roberto Greiner
Os otimistas acham que estamos no melhor dos mundos
Os pessimistas tem medo de que isto seja verdade
James Branch Cabell
-----------------------------------------------------
------------------------------
Message: 2
Date: Wed, 10 Sep 2014 21:38:06 +0100
From: Brian Candler <[email protected]>
Subject: Re: [Netdot-users] Database update problem
To: Roberto Greiner <[email protected]>,
[email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
On 10/09/2014 20:30, Roberto Greiner wrote:
> I hope that's all the info needed for debugging the problem. I will
> refrain from removing the bogus entry in the database for a day or two,
> in case you need any other information.
I won't be able to look at it - but maybe someone else can.
Regards,
Brian.
------------------------------
_______________________________________________
Netdot-users mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-users
End of Netdot-users Digest, Vol 70, Issue 2
*******************************************