Handle hostnames with upper-case letters
[webmin.git] / status / jabber-monitor.pl
1 # jabber-monitor.pl
2 # Monitor the jabber server on this host
3
4 # Check the PID file to see if mon is running
5 sub get_jabber_status
6 {
7 return { 'up' => -1 } if (!&foreign_check($_[1]));
8 local %jconfig = &foreign_config($_[1]);
9 -r $jconfig{'jabber_config'} || return { 'up' => -1 };
10 &foreign_require($_[1], "jabber-lib.pl");
11 local $pidfile = &foreign_call($_[1], "jabber_pid_file");
12 if (open(PID, $pidfile) && ($pid = int(<PID>)) && kill(0, $pid)) {
13         return { 'up' => 1 };
14         }
15 else {
16         return { 'up' => 0 };
17         }
18 }
19
20 sub parse_jabber_dialog
21 {
22 &depends_check($_[0], "jabber");
23 eval "use XML::Parser";
24 &error(&text('jabber_eparser', "<tt>XML::Parser</tt>")) if ($@);
25 }
26
27 1;
28