Build precise queries to find exactly what you need
Press ESC to close
It works! But somehow in my system not every successful backup is listed via list jobname. I edited the plugin to use status client, for directly connecting to the fd of the client and it’s status. Therefore you also have to convert the date. Following changes where made (just copy line to line:
open (JOBLIST,”echo ‘status client=$client’ | $bconsoleCommand |”);
my $latestBackupAge=-1;
while() { my($line) = $_; #print $line; # split into columns (and remove whitespaces) my ($_dummy,$_jobId,$_level,$_jobFiles,$_jobBytes,$_jobBytesMetric,$_jobStatus,$_finishedDate,$_finishedTime,$_client)=split(/s+/,$line); if ( $_jobBytes eq “0” ) { ($_dummy,$_jobId,$_level,$_jobFiles,$_jobBytes,$_jobStatus,$_finishedDate,$_finishedTime,$_client)=split(/s+/,$line); } $_finishedDate =~ s/Dez/Dec/; $_finishedDate =~ s/Mrz/Mar/; $_finishedDate =~ s/Okt/Oct/; $_finishedDate =~ s/Mai/May/;
my $_startTime = “$_finishedDate-$_finishedTime”; if ( $_jobStatus ne “OK” ) { next; # only jobs which terminated correctly } if ( $_client ne “backup_$client” ) { next; # only jobs for this client } if (!( $level eq “*” || $_level eq $level )) { next; # only jobs for the reqired level (or any if $level=”*”) } my $in_fmt = ‘%d-%b-%y-%H:%M’; my $out_fmt = ‘%Y-%m-%d %H:%M:%S’; my $date = Time::Piece->strptime($_startTime, $in_fmt); my $_startTime = $date->strftime($out_fmt); my ($_y,$_m,$_d,$_H,$_M,$_S);
($_y,$_m,$_d,$_H,$_M,$_S) = ( $_startTime=~/^(d{4})-(d{2})-(d{2})s+(d{2}):(d{2}):(d{2})$/ );
if (! $_y ) { next; # require valid startTime }
my $_startTimeAsUnixtime=timelocal($_S, $_M, $_H, $_d, $_m-1, $_y);
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!