#if ( !defined $sth ) {die("Cannot prepare last ID statement in saveNewEvent: $DBI::errstr\n")}
#$sth->execute;
#my $id= $sth->fetchrow();
#write2log ("info", "Stored new event (#$id) from $ip (CN: $cn; AN: $an)");
#if (! defined $id) {
# write2log ("err", "Event from $ip ($cn) was not save: INSERT INTO events VALUES (NULL,$cn,$service,$detected,$received,$type,$source_type,$source,$target_proto,$target_port,$attack_scale,$note,$priority,$timeout,$valid);");
# die("Event was not save at warden server - database return empty ID!");
# obtain cidr based on rigth common name, service and client_type
$sth=$DBH->prepare("SELECT hostname, receive_own_events, ip_net_client FROM clients WHERE hostname IN ($alt_names) AND type = ? AND client_type = ? LIMIT 1;");
if(!defined$sth){die("Cannot prepare authorization statement in getNewEvents: $DBI::errstr\n")}
$sth=$DBH->prepare_cached("SELECT registered FROM clients WHERE hostname = ? AND requestor = ? AND service = ? AND client_type = ? AND type = ? AND receive_own_events = ? AND description_tags = ? AND ip_net_client = ? LIMIT 1;");
$sth=$DBH->prepare("SELECT registered FROM clients WHERE hostname = ? AND requestor = ? AND service = ? AND client_type = ? AND type = ? AND receive_own_events = ? AND description_tags = ? AND ip_net_client = ? LIMIT 1;");
if(!defined$sth){die("Cannot prepare check statement in registerSender: $DBI::errstr\n")}
$sth=$DBH->prepare_cached("SELECT registered FROM clients WHERE hostname = ? AND requestor = ? AND service = ? AND client_type = ? AND type = ? AND receive_own_events = ? AND description_tags = ? AND ip_net_client = ? LIMIT 1;");
$sth=$DBH->prepare("SELECT registered FROM clients WHERE hostname = ? AND requestor = ? AND service = ? AND client_type = ? AND type = ? AND receive_own_events = ? AND description_tags = ? AND ip_net_client = ? LIMIT 1;");
if(!defined$sth){die("Cannot prepare check statement in registerReceiver: $DBI::errstr\n")}