mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-08 16:26:23 -04:00
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.
This commit is contained in:
parent
19c493e54c
commit
be9aa5aba2
1 changed files with 24 additions and 1 deletions
|
|
@ -605,7 +605,30 @@ sub process_arguments(){
|
|||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
}else{
|
||||
$mailq = 'sendmail' ;
|
||||
if (defined $utils::PATH_TO_QMAIL_QSTAT
|
||||
&& -x $utils::PATH_TO_QMAIL_QSTAT)
|
||||
{
|
||||
$mailq = 'qmail';
|
||||
}
|
||||
elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix'
|
||||
|| -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix')
|
||||
{
|
||||
$mailq = 'postfix';
|
||||
}
|
||||
elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4'
|
||||
|| -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim')
|
||||
{
|
||||
$mailq = 'exim';
|
||||
}
|
||||
elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer'
|
||||
|| -e '/usr/sbin/nullmailer-send'
|
||||
|| -e '/usr/local/sbin/nullmailer-send')
|
||||
{
|
||||
$mailq = 'nullmailer';
|
||||
}
|
||||
else {
|
||||
$mailq = 'sendmail';
|
||||
}
|
||||
}
|
||||
|
||||
return $ERRORS{'OK'};
|
||||
|
|
|
|||
Loading…
Reference in a new issue