Skip to content
Snippets Groups Projects
Commit 2d4eb4db authored by Jakub Cegan's avatar Jakub Cegan
Browse files

Task #613 pridano cmd

* ted uz opravdu pridano ...
parent 5b262f79
No related branches found
No related tags found
No related merge requests found
...@@ -274,8 +274,8 @@ sub run{ ...@@ -274,8 +274,8 @@ sub run{
while ($i < scalar(@sql_queries)) { while ($i < scalar(@sql_queries)) {
my ($rc,$err) = send_query(\$dbh,\@sql_queries,\%bad_events); my ($rc,$err) = send_query(\$dbh,\@sql_queries,\%bad_events);
if (!$rc){ if (!$rc){
print "Warden watchdog - $err\n"; #print "Warden watchdog - $err\n";
#syslog("err|Warden watchdog - $err\n"); syslog("err|Warden watchdog - $err\n");
} }
$i++; $i++;
} }
...@@ -284,8 +284,8 @@ sub run{ ...@@ -284,8 +284,8 @@ sub run{
my %input = (contact => $contact, domain => $domain_name, text => $text, subject => $email_subject, email_conf => $email_server_conf); my %input = (contact => $contact, domain => $domain_name, text => $text, subject => $email_subject, email_conf => $email_server_conf);
my ($rc,$err) = send_report(\%input); my ($rc,$err) = send_report(\%input);
if (!$rc){ if (!$rc){
print $err; #print $err;
#syslog("err|Warden client - networkReporter $err\n"); syslog("err|Warden client - networkReporter $err\n");
} }
} }
......
...@@ -10,6 +10,28 @@ use strict; ...@@ -10,6 +10,28 @@ use strict;
use warnings; use warnings;
use WardenWatchdog; use WardenWatchdog;
use Getopt::Long;
sub help {
my $help =" USAGE: ./wardenWatchdog.pl -c '/path/WardenWatchdog.conf' -i 7
OPTIONS
-c conf configuration file name and path
-i interval interval in days from now back to the past
";
print $help;
return 1;
}
my ($help, $config, $interval);
if (@ARGV < 3 || defined($help) || !GetOptions('help|?|h' => \$help, 'c|conf=s' => \$config, 'i|interval=i' => \$interval)){
help();
}
else{
my ($rc,$err) = WardenWatchdog::run($config,$interval);
if(!$rc){
print "WardenWatchdog error: $err";
}
}
WardenWatchdog::run('WardenWatchdog.conf',7);
1; 1;
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