Handle hostnames with upper-case letters
[webmin.git] / status / apache-monitor.pl
1 # apache-monitor.pl
2 # Monitor the apache server on this host
3
4 # Check the PID file to see if apache is running
5 sub get_apache_status
6 {
7 return { 'up' => -1 } if (!&foreign_check($_[1]));
8 &foreign_require($_[1], "apache-lib.pl");
9 return { 'up' => -1 } if (!&foreign_check($_[1]));
10 local %aconfig = &foreign_config($_[1]);
11 return { 'up' => -1 } if (!-x $aconfig{'httpd_path'});
12
13 if (&foreign_call($_[1], "is_apache_running")) {
14         local $pidfile = &foreign_call($_[1], "get_pid_file");
15         local @st = stat($pidfile);
16         return { 'up' => 1,
17                  'desc' => &text('up_since', scalar(localtime($st[9]))) };
18         }
19 else {
20         return { 'up' => 0 };
21         }
22 }
23
24 sub parse_apache_dialog
25 {
26 &depends_check($_[0], "apache");
27 }
28
29 1;
30