init III
This commit is contained in:
57
Perl CGI C2/admin/save_service.pl
Normal file
57
Perl CGI C2/admin/save_service.pl
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/perl
|
||||
|
||||
use Mysql;
|
||||
use strict;
|
||||
use CGI qw(:standard);
|
||||
|
||||
my $check=param('check');
|
||||
my $v0 = param('descr');
|
||||
my $v1 = param('sid');
|
||||
my $v2 = param('pid');
|
||||
|
||||
my $ping=param('ping');
|
||||
my $snmp=param('snmp');
|
||||
my $konst=param('konst');
|
||||
|
||||
my $calc1=param('calc1');
|
||||
my $calc2=param('calc2');
|
||||
my $calc3=param('calc3');
|
||||
|
||||
my $result1=param('result1');
|
||||
my $result2=param('result2');
|
||||
|
||||
my $dbh = DBI->connect("DBI:mysql:database=c2;host=localhost",'root','', {RaiseError => 1});
|
||||
|
||||
print header();
|
||||
|
||||
print "<html>\n";
|
||||
print "<head>\n";
|
||||
print "<style type='text/css'>\n";
|
||||
print "select { font-size:8pt }\n";
|
||||
|
||||
print "</style>\n";
|
||||
|
||||
print "</head>\n";
|
||||
print "<body>\n";
|
||||
|
||||
if ($check eq "ping") {
|
||||
$dbh->do("insert into services (description,service_ind,position,todo,variable) values ('$v0','$v1','$v2','P','$ping')");
|
||||
}
|
||||
elsif ($check eq "snmp") {
|
||||
$dbh->do("insert into services (description,service_ind,position,todo,variable) values ('$v0','$v1','$v2','S','$snmp')");
|
||||
}
|
||||
elsif ($check eq "konst") {
|
||||
$dbh->do("insert into services (description,service_ind,position,todo,variable) values ('$v0','$v1','$v2','K','$konst')");
|
||||
}
|
||||
elsif ($check eq "calc") {
|
||||
my $calc = "$calc1" . "$calc2" . "$calc3";
|
||||
$dbh->do("insert into services (description,service_ind,position,todo,variable) values ('$v0','$v1','$v2','C','$calc')");
|
||||
}
|
||||
elsif ($check eq "result") {
|
||||
my $result = "$result1" . "-" . "$result2";
|
||||
$dbh->do("insert into services (description,service_ind,position,todo,variable) values ('$v0','$v1','$v2','R','$result')");
|
||||
}
|
||||
|
||||
# $dbh->do("insert into alerts (description,alert_type,mail_from,mail_to,enterprise,specific,generic,destination,port,community,txt_msg) values ('$v0','$v1','$v2','$v3','$v4','$v6','$v5','$v7','$v8','$v9','$v10')");
|
||||
|
||||
print "</body>\n</html>\n";
|
||||
Reference in New Issue
Block a user