5 use FS::UID qw( adminsuidsetup );
6 use FS::Cron::check qw(
7 check_queued check_selfservice check_apache check_bop_failures
8 check_sg check_sg_login check_sgng
12 my $user = shift or die &usage;
14 #die "no notification email given" unless @emails;
16 eval { adminsuidsetup $user };
18 if ( $@ ) { alert("Database down: $@", @emails); exit; }
20 check_queued or alert('Queue daemon not running', @emails);
21 check_selfservice or alert(error_msg(), @emails);
22 check_apache or alert('Apache not running: '. error_msg(), @emails);
24 #no-ops unless you are sg
25 my $sg = 'FS::ClientAPI::SG';
26 check_sg or alert("$sg not responding: ". error_msg(), @emails);
27 check_sg_login or alert("$sg login errort: ". error_msg(), @emails);
28 check_sgng or alert("${sg}NG not responding: ". error_msg(), @emails);
30 check_bop_failures or alert(error_msg(), @emails);