Skip to content
Snippets Groups Projects
Commit 02b94ffc authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

k nove registrovanym receiverum defaultne pridavana i validita

parent 71d785dc
No related branches found
No related tags found
No related merge requests found
...@@ -89,16 +89,17 @@ switch () { ...@@ -89,16 +89,17 @@ switch () {
} }
# defined variables by script # defined variables by script
my $client_type = "r"; my $client_type = "r";
my $registered = DateTime->now; my $valid = "t";
my $service = undef; my $registered = DateTime->now;
my $description_tags = undef; my $service = undef;
my $description_tags = undef;
# read config file # read config file
my $conf_file = "$etc/warden-server.conf"; my $conf_file = "$etc/warden-server.conf";
our $SYSLOG = undef; our $SYSLOG = undef;
our $SYSLOG_VERBOSE = undef; our $SYSLOG_VERBOSE = undef;
our $SYSLOG_FACILITY = undef; our $SYSLOG_FACILITY = undef;
our $DB_NAME = undef; our $DB_NAME = undef;
our $DB_USER = undef; our $DB_USER = undef;
our $DB_PASS = undef; our $DB_PASS = undef;
...@@ -122,8 +123,8 @@ if (defined $result) { ...@@ -122,8 +123,8 @@ if (defined $result) {
WardenCommon::sendMsg($SYSLOG, $SYSLOG_VERBOSE, $SYSLOG_FACILITY, "err", "Attempt to re-register the receiver [hostname: '$hostname', type: '$type', cidr: '$ip_net_client']"); WardenCommon::sendMsg($SYSLOG, $SYSLOG_VERBOSE, $SYSLOG_FACILITY, "err", "Attempt to re-register the receiver [hostname: '$hostname', type: '$type', cidr: '$ip_net_client']");
WardenCommon::errMsg("Receiver has already been registered at $warden_server in '$result'"); WardenCommon::errMsg("Receiver has already been registered at $warden_server in '$result'");
} else { } else {
$sth = $DBH->prepare("INSERT INTO clients VALUES (?,?,?,?,?,?,?,?,?,?);") or die "Cannot prepare statement: " . $DBH->errstr; $sth = $DBH->prepare("INSERT INTO clients VALUES (?,?,?,?,?,?,?,?,?,?,?);") or die "Cannot prepare statement: " . $DBH->errstr;
my $ret_val = $sth->execute(undef, $hostname, $registered, $requestor, $service, $client_type, $type, $receive_own_events, $description_tags, $ip_net_client) or die "Cannot execute statement: " . $sth->errstr; my $ret_val = $sth->execute(undef, $hostname, $registered, $requestor, $service, $client_type, $type, $receive_own_events, $description_tags, $ip_net_client, $valid) or die "Cannot execute statement: " . $sth->errstr;
if ($ret_val == 1) { if ($ret_val == 1) {
WardenCommon::sendMsg($SYSLOG, $SYSLOG_VERBOSE, $SYSLOG_FACILITY, "info", "New receiver [hostname: '$hostname', type: '$type', cidr: '$ip_net_client'] was registered"); WardenCommon::sendMsg($SYSLOG, $SYSLOG_VERBOSE, $SYSLOG_FACILITY, "info", "New receiver [hostname: '$hostname', type: '$type', cidr: '$ip_net_client'] was registered");
WardenCommon::succMsg("Registration of receiver from $hostname was SUCCESSFUL!!!"); WardenCommon::succMsg("Registration of receiver from $hostname was SUCCESSFUL!!!");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment