summaryrefslogtreecommitdiff
path: root/httemplate/misc/process/nms-add_router.html
blob: a4c3423da0b74f7d19089bf6e58f83e483008f40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<& /elements/header-popup.html, 'Router added' &>
  <SCRIPT TYPE="text/javascript">
    topreload();
  </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>