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. Asset Product keeps changing (Justin Miller)
2. Re: Netdot 1.0.6 release (Patrick M. Landry)
----------------------------------------------------------------------
Message: 1
Date: Thu, 17 Apr 2014 16:10:17 -0400
From: Justin Miller <[email protected]>
Subject: [Netdot-users] Asset Product keeps changing
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
I've just installed 1.0.6 on wheezy.
When I discover the first piece of hardware, the product shows up as "mikrotik
x86". The next piece of hardware that is discovered shows up as "mikrotik
RB493AH" which is correct, but the previous device now also has it's product
changed to "mikrotik RB493AH". The next one is "mikrotik RB433AH" and all the
previous are also changed to this. Which ever device I discover changes all
previous devices to that new product type.
MikroTik is the manufacture and RB493AH is the product or model.
Am I doing something wrong, is this a bug, or is this an issue with SNMP:info
translations for mikrotik device types?
Justin
------------------------------
Message: 2
Date: Thu, 17 Apr 2014 18:02:54 -0500 (CDT)
From: "Patrick M. Landry" <[email protected]>
Subject: Re: [Netdot-users] Netdot 1.0.6 release
To: Netdot-users <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
I am upgrading from 1.0.4 running mysql. The "make install" generated the
following error:
# cat upgrade/error.log
DBD::mysql::db do failed: Cannot add or update a child row: a foreign key
constraint fails (`netdot`.<result 2 when explaining filename '#sql-758_2'>,
CONSTRAINT `fk_bgplocalas` FOREIGN KEY (`bgplocalas`) REFERENCES `asn` (`id`))
at ../lib/DBUTIL.pm line 592.
ERROR while executing ALTER TABLE device ADD CONSTRAINT `fk_bgplocalas` FOREIGN
KEY (`bgplocalas`) REFERENCES `asn` (`id`): DBD::mysql::db do failed: Cannot
add or update a child row: a foreign key constraint fails (`netdot`.<result 2
when explaining filename '#sql-758_2'>, CONSTRAINT `fk_bgplocalas` FOREIGN KEY
(`bgplocalas`) REFERENCES `asn` (`id`)) at ../lib/DBUTIL.pm line 592.
I believe this is because the device.bgplocalas field has not yet been
populated when trying to add the foreign key contraint to the device table
generating the foreign key error.
The fix was to move the creation of the device.fk_bgplocalas key after the
update statement which populates the device.bgplocalas field.
# diff -C 3 updatedb /var/tmp/updatedb
*** updatedb 2014-04-11 08:38:28.000000000 -0500
--- /var/tmp/updatedb 2014-04-17 17:41:47.071631814 -0500
***************
*** 208,219 ****
push @statements, "INSERT INTO asn (number) SELECT DISTINCT bgplocalas
FROM device WHERE bgplocalas IS NOT NULL;";
push @statements, "ALTER TABLE device MODIFY bgplocalas bigint;";
- push @statements, "ALTER TABLE device ADD CONSTRAINT `fk_bgplocalas`
FOREIGN KEY (`bgplocalas`) ".
- "REFERENCES `asn` (`id`);";
push @statements, "CREATE INDEX bgplocalas ON device (bgplocalas);";
push @statements, "UPDATE device,asn SET device.bgplocalas=asn.id WHERE
device.bgplocalas=asn.number;";
push @statements, "ALTER TABLE bgppeering ADD COLUMN contactlist
bigint;";
push @statements, "ALTER TABLE bgppeering ADD CONSTRAINT
`fk_contactlist_bgppeering` FOREIGN KEY (`contactlist`) ".
"REFERENCES `contactlist` (`id`);";
--- 208,220 ----
push @statements, "INSERT INTO asn (number) SELECT DISTINCT bgplocalas
FROM device WHERE bgplocalas IS NOT NULL;";
push @statements, "ALTER TABLE device MODIFY bgplocalas bigint;";
push @statements, "CREATE INDEX bgplocalas ON device (bgplocalas);";
push @statements, "UPDATE device,asn SET device.bgplocalas=asn.id WHERE
device.bgplocalas=asn.number;";
+ push @statements, "ALTER TABLE device ADD CONSTRAINT `fk_bgplocalas`
FOREIGN KEY (`bgplocalas`) ".
+ "REFERENCES `asn` (`id`);";
+
push @statements, "ALTER TABLE bgppeering ADD COLUMN contactlist
bigint;";
push @statements, "ALTER TABLE bgppeering ADD CONSTRAINT
`fk_contactlist_bgppeering` FOREIGN KEY (`contactlist`) ".
"REFERENCES `contactlist` (`id`);";
--
patrick
Patrick Landry
University of Louisiana at Lafayette
Director, University Computer Support Services
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Landry, Patrick.vcf
Type: text/directory
Size: 11870 bytes
Desc: not available
Url :
http://osl.uoregon.edu/pipermail/netdot-users/attachments/20140417/2daf57d3/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Landry, Patrick.vcf
Type: text/directory
Size: 11870 bytes
Desc: not available
Url :
http://osl.uoregon.edu/pipermail/netdot-users/attachments/20140417/2daf57d3/attachment-0001.bin
------------------------------
_______________________________________________
Netdot-users mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-users
End of Netdot-users Digest, Vol 65, Issue 7
*******************************************