aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/api/private/switch-add
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly.no>2016-03-17 21:31:30 +0000
committerKristian Lyngstol <kly@kly.no>2016-03-17 21:31:30 +0000
commitb7887d4b7181e057d77a5f5d093de0400052bd0b (patch)
tree5c5653a19c9469bd2923fd11015cbfe06ef7e2b3 /web/nms.gathering.org/api/private/switch-add
parent151f2403dec93d32199afea4ceff9833b8980cf4 (diff)
parent8eb1b43ce136e808fbd90aeb11eecd03eaa821d8 (diff)
Merge branch 'master' of ssh://github.com/tech-server/tgmanage
Diffstat (limited to 'web/nms.gathering.org/api/private/switch-add')
-rwxr-xr-xweb/nms.gathering.org/api/private/switch-add8
1 files changed, 7 insertions, 1 deletions
diff --git a/web/nms.gathering.org/api/private/switch-add b/web/nms.gathering.org/api/private/switch-add
index 979a1d8..3d7b119 100755
--- a/web/nms.gathering.org/api/private/switch-add
+++ b/web/nms.gathering.org/api/private/switch-add
@@ -22,7 +22,7 @@ my @dups;
my $sth = $nms::web::dbh->prepare("SELECT sysname FROM switches WHERE sysname=?");
-my @fields = ('ip', 'sysname', 'switchtype', 'last_updated', 'locked', 'poll_frequency', 'community', 'lldp_chassis_id', 'secondary_ip', 'subnet4', 'subnet6', 'placement');
+my @fields = ('ip', 'sysname', 'switchtype', 'last_updated', 'locked', 'poll_frequency', 'community', 'lldp_chassis_id', 'secondary_ip', 'subnet4', 'subnet6', 'placement', 'distro', 'secondary_ip');
sub convertplace
{
@@ -64,6 +64,9 @@ foreach my $tmp2 (@tmp) {
if (not defined($switch{'ip'}) and defined($switch{'mgtmt4'})) {
$switch{'ip'} = $switch{'mgtmt4'};
}
+ if (not defined($switch{'secondary_ip'}) and defined($switch{'mgtmt6'})) {
+ $switch{'secondary_ip'} = $switch{'mgtmt6'};
+ }
my ($x1,$x2,$y1,$y2);
$x1 = $placement{'x1'};
$y1 = $placement{'y1'};
@@ -99,6 +102,9 @@ foreach my $tmp2 (@tmp) {
if (not defined($switch{'ip'}) and defined($switch{'mgtmt4'})) {
$switch{'ip'} = $switch{'mgtmt4'};
}
+ if (not defined($switch{'secondary_ip'}) and defined($switch{'mgtmt6'})) {
+ $switch{'secondary_ip'} = $switch{'mgtmt6'};
+ }
my @set;
map {
if (defined($template{$_})) {