diff options
Diffstat (limited to 'web/api')
-rwxr-xr-x | web/api/write/switch-add | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/web/api/write/switch-add b/web/api/write/switch-add index 56e5cb2..d210567 100755 --- a/web/api/write/switch-add +++ b/web/api/write/switch-add @@ -11,6 +11,7 @@ use strict; use warnings; use JSON; use Data::Dumper; +use nms::oplog qw(oplog); $nms::web::cc{'max-age'} = "0"; @@ -83,10 +84,11 @@ foreach my $tmp2 (@tmp) { $nms::web::dbh->do("INSERT INTO SWITCHES (mgmt_v4_addr, sysname, poll_frequency, community, lldp_chassis_id, mgmt_v6_addr, placement,subnet4,subnet6,distro_name) VALUES ($template{'mgmt_v4_addr'}, $template{'sysname'}, $template{'poll_frequency'}, $template{'community'}, $template{'lldp_chassis_id'}, $template{'mgmt_v6_addr'}, $template{'placement'},$template{'subnet4'},$template{'subnet6'},$template{'distro_name'});"); push @added, $switch{'sysname'}; + oplog($switch{'sysname'}, "Switch added: " . $switch{'sysname'}); } } $json{'switches_addded'} = \@added; -print "X-ban: /api/.*switches.*\n"; +print "X-ban: /api/.*\n"; finalize_output(); |