summaryrefslogtreecommitdiff
path: root/httemplate/misc/process/nms-add_router.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc/process/nms-add_router.html')
-rw-r--r--httemplate/misc/process/nms-add_router.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/httemplate/misc/process/nms-add_router.html b/httemplate/misc/process/nms-add_router.html
new file mode 100644
index 000000000..c3b42a8d3
--- /dev/null
+++ b/httemplate/misc/process/nms-add_router.html
@@ -0,0 +1,21 @@
+<& /elements/header-popup.html, 'Router added' &>
+ <SCRIPT TYPE="text/javascript">
+ window.top.location.reload();
+ </SCRIPT>
+</BODY></HTML>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configure network monitoring');
+
+my $host = $cgi->param('host');
+errorpage_popup('invalid host') unless $host =~ /^[0-9.a-zA-Z\-]+$/;
+
+my $community = $cgi->param('community');
+errorpage_popup('invalid SNMP community string') unless $community =~ /^[0-9.a-zA-Z\-]*$/;
+
+my $nms = new FS::NetworkMonitoringSystem;
+my $error = $nms->add_router($host,$community);
+errorpage_popup($error) if $error;
+
+</%init>