Handle hostnames with upper-case letters
[webmin.git] / status / sendmail-monitor.pl
1 # sendmail-monitor.pl
2 # Monitor the sendmail server on this host
3
4 # Check the PID file to see if sendmail is running
5 sub get_sendmail_status
6 {
7 return { 'up' => -1 } if (!&foreign_check($_[1]));
8 &foreign_require($_[1], "sendmail-lib.pl");
9 local %sconfig = &foreign_config($_[1]);
10 return { 'up' => -1 } if (!-r $sconfig{'sendmail_cf'});
11 if (&sendmail::is_sendmail_running()) {
12         local @pidfiles = split(/\t+/, $sconfig{'sendmail_pid'});
13         local @st = stat($pidfiles[0]);
14         return { 'up' => 1,
15                  'desc' => @pidfiles ? 
16                         &text('up_since', scalar(localtime($st[9]))) : undef };
17         }
18 else {
19         return { 'up' => 0 };
20         }
21 }
22
23 sub parse_sendmail_dialog
24 {
25 &depends_check($_[0], "sendmail");
26 }
27
28 1;
29