Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
uses logfile parsing to determine number of emails processed by postfix in the last 5 minutes.
Performance issue on large logfiles is fixed in v1.1
Performance more improved by using awk in version 2.
HINT!!! If the version2 does not work, and you get 0 as result, First make sure nagios/nrpe has read permissions on the mail.log, secondly there might be a mismatch in the LOCALE variabels between the shell and the postfix environment. In that case do the following: 1) open a shell 2) give the command: awk -v now=`date +%s` ‘BEGIN{print strftime(“%b %d %T”, now)}’ 3) the result is something like this: mrt 29 11:46:01 4) open your maillog and take a look at the date format. (Probably it is: Mar 29 10:34:56) As you see, one says mrt, the other Mar. This will not work. 5) execute the following in the shell: export LC_TIME=en_US 6) give the awk command again. If this changes the output of the awk to the same output as used in the maillog, add this EXPORT-line somewhere in the script and you are done. 7) kairu0 found that it was not the locale that was wrong, but that the log files uses spaces instead of 0. Ie. “Aug 6” instead of “Aug 06”. In that case replace the strftime(“%b %d %T” with strftime(“%b %e %T” on two locations in the script. 8) if that did not work, try to figure out what locale command you should give, or contact me.
Current Version
2
Last Release Date
2013-03-20
Owner
Frank IJskes
License
GPL
Compatible With
check_postifx_processed (old version)
Improved version 1.1: check_postfix_processed
This script parses the /var/log/. IFS is used so the date/time field is seen as different columns instead of 1 field. Grep finds the lines where the logs says: sent This is processed by awk to get the required fields. Tac is used to serch bottom up. If the time of the log is less different then the currenttime-NO_OF_SECONDS then we have a hit. The hits are counted and returned to nagios. It can be used in combination with process_perf_data 1 / pnp4nagios There are 3 version available. The last 2 version have the best performance, lowest loads. Please read all the notes if you have difficulties using the latest.
0
awk -v now=`date +%s` 'BEGIN{print strftime("%b %d %T", now)}' gives me Aug 06 19:57:43 and log file have padded zeros Aug 6 19:57:11 I use 'BEGIN{print strftime("%b %e %T", now-seconds)}'` in the script to get it to work.
Once I figured out the permissions were incorrect for the nagios user, this plugin started working like a charm!
You must be logged in to submit a review.
To:
From: