Build precise queries to find exactly what you need
Press ESC to close
Below is a patch to make the script working with a PostgreSQL backend, and a quick-fix for instances where query returns 0E0:
+ my $dsn = “DBI:Pg:database=$sqlDB;host=localhost”; + $sql_query = “SELECT SUM(JobErrors) AS errors, COUNT(*) AS count, Job.JobId, Job.JobStatus, Log.LogText + FROM Job LEFT JOIN Log on Job.JobId = Log.JobId + WHERE (Name=’$opt_job’) AND (JobStatus=’T’) AND (EndTime IS NOT NULL) + AND ((EndTime = ‘$date_stop’)) + GROUP BY Job.JobId, Job.JobStatus, Log.LogText;”; – my @job_stats = sql_exec(); + my $sth = $dbh->prepare($sql_query); + my $rv = $sth->execute() or die “Error executing query: ‘$sql_query’: $DBI::errstrn”; + if ($rv fetchrow_array(); + $errors = $job_stats[0]; + $count = $job_stats[1]; + $jobid = $job_stats[2]; + $joblog = $job_stats[3]; + }
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!