summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/nms-add_router.html7
-rw-r--r--httemplate/misc/process/nms-add_iface.html3
-rw-r--r--httemplate/misc/process/nms-add_router.html8
3 files changed, 15 insertions, 3 deletions
diff --git a/httemplate/misc/nms-add_router.html b/httemplate/misc/nms-add_router.html
index 35ef7bf72..c41e61977 100644
--- a/httemplate/misc/nms-add_router.html
+++ b/httemplate/misc/nms-add_router.html
@@ -7,6 +7,13 @@ Router Hostname/IP
)
%>
<BR>
+SNMP Community String (optional)
+<% include('/elements/input-text.html',
+ 'field' => 'community',
+ )
+%>
+<BR>
+<BR>
<INPUT TYPE="submit" NAME="submit" ID="submit_nms-add_router" VALUE="Add Router">
</FORM>
diff --git a/httemplate/misc/process/nms-add_iface.html b/httemplate/misc/process/nms-add_iface.html
index 0d37ea233..5f51e5ce1 100644
--- a/httemplate/misc/process/nms-add_iface.html
+++ b/httemplate/misc/process/nms-add_iface.html
@@ -5,7 +5,8 @@
</BODY></HTML>
<%init>
-# XXX: access rights
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configure network monitoring');
my $host = $cgi->param('host');
die 'invalid host' unless $host =~ /^[0-9.a-zA-Z\-]+$/;
diff --git a/httemplate/misc/process/nms-add_router.html b/httemplate/misc/process/nms-add_router.html
index bc437d2b3..a77d897d2 100644
--- a/httemplate/misc/process/nms-add_router.html
+++ b/httemplate/misc/process/nms-add_router.html
@@ -2,12 +2,16 @@
</BODY></HTML>
<%init>
-# XXX: access rights
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configure network monitoring');
my $host = $cgi->param('host');
die 'invalid host' unless $host =~ /^[0-9.a-zA-Z\-]+$/;
+my $community = $cgi->param('community');
+die 'invalid SNMP community string' unless $community =~ /^[0-9.a-zA-Z\-]*$/;
+
my $nms = new FS::NetworkMonitoringSystem;
-$nms->add_router($host);
+$nms->add_router($host,$community);
</%init>