Build precise queries to find exactly what you need
Press ESC to close
I have this working well with Postgres. A couple minor changes from the previous suggested changes:
$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;”;
(EndTime >= as opposed to =)
When there isn’t a match, you don’t get an array of 0’s or nulls, but just an empty array.
So I check for that:
if ($#job_stats == -1) { @job_stats = (0,0,0,0) }
This is the easiest fix; the rest of the code expects that array to exist, so I just set it to zeroes.
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!