summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeni Golov <evgeni@golov.de>2014-02-27 07:31:05 (GMT)
committerJan Wagner <waja@cyconet.org>2014-02-27 19:33:14 (GMT)
commitbe9aa5aba24640b15205060cda442d02f7be799c (patch)
tree1291db590c2ea70a72093589af5918d80b704cd9
parent19c493e54c27a51d7a5372ff4b4cb4fa5ad74733 (diff)
downloadmonitoring-plugins-be9aa5aba24640b15205060cda442d02f7be799c.tar.gz
check_mailq: try to autodetect which mailq implementation we are using
This is done by looking at some common directories and files each MTA installs on the system. If no known file is found, the old default sendmail is used. Of course this still can be overridden by -M.
-rwxr-xr-xplugins-scripts/check_mailq.pl25
1 files changed, 24 insertions, 1 deletions
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl
index 2a805b6..cc040eb 100755
--- a/plugins-scripts/check_mailq.pl
+++ b/plugins-scripts/check_mailq.pl
@@ -605,7 +605,30 @@ sub process_arguments(){
605 exit $ERRORS{'UNKNOWN'}; 605 exit $ERRORS{'UNKNOWN'};
606 } 606 }
607 }else{ 607 }else{
608 $mailq = 'sendmail' ; 608 if (defined $utils::PATH_TO_QMAIL_QSTAT
609 && -x $utils::PATH_TO_QMAIL_QSTAT)
610 {
611 $mailq = 'qmail';
612 }
613 elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix'
614 || -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix')
615 {
616 $mailq = 'postfix';
617 }
618 elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4'
619 || -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim')
620 {
621 $mailq = 'exim';
622 }
623 elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer'
624 || -e '/usr/sbin/nullmailer-send'
625 || -e '/usr/local/sbin/nullmailer-send')
626 {
627 $mailq = 'nullmailer';
628 }
629 else {
630 $mailq = 'sendmail';
631 }
609 } 632 }
610 633
611 return $ERRORS{'OK'}; 634 return $ERRORS{'OK'};