Opened 5 years ago

Closed 4 years ago

Last modified 20 months ago

#630 closed patch (fixed)

sendmail_mailqueue plugin .hoststats fix.

Reported by: ahaveland Owned by: nobody
Priority: normal Milestone: Munin 1.4
Component: plugins Version: 1.2.5
Severity: minor Keywords: sendmail_mailqueue, sendmail, plugin
Cc:

Description

I was baffled for a while when I could see 4 qf files in the queue directory, but munin was actually showing about 20 on the graph.
It turned out that the sendmail_mailqueue plugin was also counting any files in the .hoststat dir that began with a "q"!

On systems using host status with sendmail:
sendmail.mc contains
define(confHOST_STATUS_DIRECTORY', .hoststat')dnl

Fix for the plugin is to either add -maxdepth 1 to the find to avoid descending into subdirs, or just to exclude ".hoststat":

mspmails=find ${MSP_QUEUE} -maxdepth 1 -type f -name '[qQ]*' 2>/dev/null | wc -l
mtamails=find ${MTA_QUEUE} -maxdepth 1 -type f -name '[qQ]*' 2>/dev/null | wc -l

OR

mspmails=find ${MSP_QUEUE} -type f -name '[qQ]*' 2>/dev/null | grep -v '\.hoststat' | wc -l
mtamails=find ${MTA_QUEUE} -type f -name '[qQ]*' 2>/dev/null | grep -v '\.hoststat' | wc -l

The first option is more efficient if the queue is flat, but the second option will count mails stored in any other subdirectories.

Hope someone else finds this useful.
Andy.

Change History (1)

comment:1 Changed 4 years ago by janl

  • Milestone set to Munin 1.4
  • Resolution set to fixed
  • Status changed from new to closed
  • Type changed from defect to patch

Fixed in r2627.

Note: See TracTickets for help on using tickets.