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