Commit 62cbd860 authored by Maarten Litmaath's avatar Maarten Litmaath
Browse files

v1.5:

- Added AliEn proxy and LDAP tests to jalien_vobox_services script.
- Added option to let it run LCG tests instead of JAliEn tests.
- Let MonALISA invoke the script both with and without that option.
parent a069a9d3
#!/usr/bin/perl
###############################################################################
# Script to report the status of VObox credentials etc.
# v1.4 - 2021-09-27
# v1.5 - 2021-10-06
# Authors:
# Maarten Litmaath <Maarten.Litmaath@cern.ch>
###############################################################################
......@@ -9,6 +9,8 @@
use strict;
use warnings;
my $lcg = $0 =~ m,lcg[^/]*$, || $#ARGV >= 0 && $ARGV[0] eq '-lcg';
###############################################################################
# clean the environment
###############################################################################
......@@ -198,7 +200,7 @@ sub test1
my $service = "Proxy Renewal";
my $daemon = '/etc/init.d/alice-box-proxyrenewal';
return unless -e $daemon;
return unless $lcg && -e $daemon;
my $res = `$daemon status 2>&1` || "Failed to execute $daemon status";
......@@ -222,7 +224,7 @@ sub test4
my $service = "Proxy Server";
my $proxy_server = $ENV{MYPROXY_SERVER};
return unless $proxy_server;
return unless $lcg && $proxy_server;
if (!$proxy_server) {
dumpStatus($service, 1, "The myproxy server is not defined");
......@@ -244,7 +246,7 @@ sub test5
{
my $service = "Proxy of the machine";
return unless -e $renewalProxy;
return unless $lcg && -e $renewalProxy;
my $command = "grid-proxy-info -f $renewalProxy 2> /dev/null";
my ($err, $msg, $timeleft) =
......@@ -263,7 +265,7 @@ sub test6
my $hostcert = '/etc/grid-security/hostcert.pem';
my $left = 0;
return unless -e $hostcert;
return unless $lcg && -e $hostcert;
chomp(my $end = `openssl x509 -noout -enddate -in $hostcert`);
......@@ -290,6 +292,8 @@ sub test6
sub test7
{
return if $lcg;
my $service = "JAliEn cert";
my $left = 0;
my $jaliencert;
......@@ -323,20 +327,39 @@ sub test7
dumpStatus($service, 0, '', 'timeleft' => $left);
}
#############################################
# TEST 10:
# check if the AliEn LDAP server can be read
#############################################
###############################################################################
# TEST 8:
# Check the grid proxy used for job submission
###############################################################################
sub test10
sub test8
{
my $service = "AliEn proxy";
#
# this test is not specific to LCG and should be run by alienTests.pl
# group this one with the JAliEn tests for the time being...
#
return;
return if $lcg;
return unless $ENV{X509_USER_PROXY};
my $command = "grid-proxy-info 2> /dev/null";
my ($err, $msg, $timeleft) =
parse_proxy_timeleft($ENV{X509_USER_PROXY}, $command, $service);
dumpStatus($service, $err, $msg, 'timeleft' => $timeleft);
}
###############################################################################
# TEST 10:
# check if the AliEn LDAP server can be read
###############################################################################
sub test10
{
return if $lcg;
my $service = "read AliEn LDAP server";
my $service = "LDAP";
my $srv = 'alice-ldap.cern.ch:8389';
my $cmd = "ldapsearch -LLL -x -h $srv -b o=alice,dc=cern,dc=ch"
......@@ -353,15 +376,21 @@ sub test10
}
}
#
# always print the status of the CE
#
###############################################################################
# TEST 11:
# check the JAliEn CE
###############################################################################
system('/cvmfs/alice.cern.ch/scripts/vobox/jalien-vobox.sh mlstatus ce');
sub test11
{
return if $lcg;
#
system('/cvmfs/alice.cern.ch/scripts/vobox/jalien-vobox.sh mlstatus ce');
}
###############################################################################
# print the results of the tests that have been defined
#
###############################################################################
for (my $i = 1; $i < 15; $i++)
{
......
#!/bin/bash
# JAliEn VObox Startup Scripts - MonaLisa
# v1.4 - 2021-09-27
# v1.5 - 2021-10-06
# Authors:
# Kalana Dananjaya <kwijethu@cern.ch>
# Costin Grigoras <Costin.Grigoras@cern.ch>
......@@ -116,7 +116,8 @@ function setup() {
add+=("^monLogTail{Cluster=AliEnServicesLogs,Node=CE,command=tail -n 15 -F $ceLogFile 2>&1}%3")
cmd=/cvmfs/alice.cern.ch/scripts/vobox/jalien_vobox_services
add+=("*AliEnServicesStatus{monStatusCmd, localhost, \"logDir=$baseLogDir $cmd,timeout=800\"}%900")
add+=("*AliEnTestsStatus{monStatusCmd, localhost, \"logDir=$baseLogDir $cmd,timeout=800\"}%900")
add+=("*LCGServicesStatus{monStatusCmd, localhost, \"logDir=$baseLogDir $cmd -lcg,timeout=800\"}%900")
template "$farmHome/Service/myFarm/myFarm.conf" "$logDir/myFarm/myFarm.conf"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment