2 # Monitor the squid server on this host
4 # Check the PID file to see if squid is running
7 return { 'up' => -1 } if (!&foreign_check($_[1]));
8 &foreign_require($_[1], "squid-lib.pl");
9 return { 'up' => -1 } if (!&foreign_check($_[1]));
10 local %sconfig = &foreign_config($_[1]);
11 return { 'up' => -1 } if (!-r $sconfig{'squid_conf'});
12 local $conf = &foreign_call($_[1], "get_config");
13 local $str = &foreign_call($_[1], "find_config", "pid_filename", $conf);
16 $file = $str->{'values'}->[0];
19 $file = $sconfig{'pid_file'};
21 if (open(PID, $file) && <PID> =~ /(\d+)/ && kill(0, $1)) {
23 local @st = stat($file);
25 'desc' => &text('up_since', scalar(localtime($st[9]))) };
32 sub parse_squid_dialog
34 &depends_check($_[0], "squid");