#!/bin/perl use strict; use mysql; use CGI qw(:standard); my $edit = param('edit'); my $edit1 = param('edit1'); my $descr=param('descr'); my $typ=param('typ'); my $mf=param('mf'); my $mt=param('mt'); my $se=param('se'); my $sg=param('sg'); my $ss=param('ss'); my $st=param('st'); my $sp=param('sp'); my $sc=param('sc'); my $sm=param('sm'); my $dbh = DBI->connect("DBI:mysql:database=c2;host=localhost",'root','', {RaiseError => 1}); print header(); print "\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "Alert editieren\n"; if ($edit eq "") { my $sth = $dbh->prepare("select ind,description,alert_type from alerts order by 'description'"); $sth->execute; print "\n"; } else { if ($edit1 eq "Edit") { my $sth = $dbh->prepare("select ind,description,alert_type,mail_from,mail_to,enterprise,generic,specific,destination,port,community,txt_msg from alerts where ind='$edit'"); $sth->execute; while (my $ref = $sth->fetchrow_arrayref()) { print "\n"; } } if ($edit1 eq "Speichern") { #$dbh->do("update hosts set description='$descr', hostname='$hostn', ip='$ipadd', rw_community='$rwcom', ro_community='$rocom', snmp_port='$snmpp' where ind='$edit'"); #$dbh->do( $dbh->do("update alerts set description='$descr', alert_type='$typ', mail_from='$mf', mail_to='$mt', enterprise='$se', generic='$sg', specific='$ss', destination='$st', port='$sp', community='$sc', txt_msg='$sm' where ind='$edit'"); print "