add SG and SGNG ping, RT#4610
[freeside.git] / FS / bin / freeside-check
1 #!/usr/bin/perl
2 #!/usr/bin/perl -w
3
4 use strict;
5 use Email::Send;
6 use FS::UID qw( adminsuidsetup );
7 use FS::Cron::check qw(
8   check_queued check_selfservice check_apache check_bop_failures
9   check_sg check_sgng
10   alert error_msg
11 );
12
13 my $user = shift or die &usage;
14 my @emails = @ARGV;
15 #die "no notification email given" unless @emails;
16
17 eval { adminsuidsetup $user };
18
19 if ( $@ ) { alert("Database down: $@", @emails); exit; }
20
21 check_queued       or alert('Queue daemon not running', @emails);
22 check_selfservice  or alert(error_msg(), @emails);
23 check_apache       or alert('Apache not running: '. error_msg(), @emails);
24
25 #no-ops unless you are sg
26 check_sg           or alert('FS::ClientAPI::SG not responding',   @emails);
27 check_sgng         or alert('FS::ClientAPI::SGNG not responding', @emails);
28
29 check_bop_failures or alert(error_msg(), @emails);
30