Commit 013f1340 authored by Marian Babik's avatar Marian Babik
Browse files

added support for DODAS project

parent 64be6c1c
FROM gitlab-registry.cern.ch/etf/docker/etf-exp:latest
LABEL maintainer="Marian Babik <Marian.Babik@cern.ch>"
LABEL description="WLCG ETF CMS"
LABEL version="1.0"
ENV NSTREAM_ENABLED=0
# OSG Middleware
RUN yum -y install yum-priorities
RUN rpm -Uvh https://repo.opensciencegrid.org/osg/3.4/osg-3.4-el7-release-latest.rpm
RUN sed "7i priority=99" -i /etc/yum.repos.d/epel.repo
# Core deps
RUN yum -y install voms globus-gsi-sysconfig globus-gsi-cert-utils globus-gssapi-gsi globus-gss-assist \
globus-gsi-proxy-core globus-gsi-credential globus-gsi-callback globus-gsi-openssl-error \
globus-openssl-module globus-gsi-proxy-ssl globus-callout
# Condor client
RUN yum -y install condor condor-python
# MW env
COPY docker/etf-cms/config/grid-env.sh /etc/profile.d/
RUN echo "source /etc/profile.d/grid-env.sh" >> /opt/omd/sites/$CHECK_MK_SITE/.profile
# VOMS config
# RUN mkdir -p /etc/vomses/
# COPY ./config/cms-lcg-voms2.cern.ch /etc/vomses/
# COPY ./config/cms-voms2.cern.ch /etc/vomses/
#RUN mkdir -p /etc/grid-security/vomsdir/cms/
#COPY ./config/lcg-voms2.cern.ch.lsc /etc/grid-security/vomsdir/cms/
#COPY ./config/voms2.cern.ch.lsc /etc/grid-security/vomsdir/cms/
# ETF base plugins
RUN yum -y install nagios-plugins-wlcg-condor nagios-plugins-globus nagios-plugins
# ETF JS setup + CMS metrics
RUN yum -y install python-jess python-nap && chmod 755 /usr/lib64/nagios/plugins/check_js
COPY ./docker/etf-cms-dodas/config/check_condor.cfg /etc/ncgx/metrics.d/
COPY ./docker/etf-cms-dodas/config/metrics.cfg /etc/ncgx/metrics.d/wlcg_cms.cfg
# ETF streaming
RUN mkdir -p /var/spool/nstream/outgoing && chmod 777 /var/spool/nstream/outgoing
RUN mkdir /etc/stompclt
COPY docker/etf-cms/config/ocsp_handler.cfg /etc/nstream/
# CMS config
COPY docker/etf-cms/config/cms_checks.cfg /etc/ncgx/conf.d/
COPY docker/etf-cms-dodas/config/etf_plugin_cms_dodas.py /usr/lib/ncgx/x_plugins/
# CMS payload
RUN mkdir -p /usr/libexec/grid-monitoring/probes/org.cms/wnjob
COPY SiteTests/SE/* /usr/libexec/grid-monitoring/probes/org.cms/
COPY nagios/config/org.cms.lcgadmin /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms.lcgadmin
COPY nagios/config/org.cms.production /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms.production
COPY nagios/org.cms.glexec /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms.glexec
COPY SiteTests/MonteCarlo /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms/probes/org.cms/testjob/
COPY SiteTests/testjob/tests /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms/probes/org.cms/testjob/tests
COPY SiteTests/FroNtier/tests /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms/probes/org.cms/testjob/tests
COPY nagios/config/cms_glexec-etf /etc/cron.d/cms_glexec
# ETF config
#COPY ./config/service_template.tpl /etc/ncgx/templates/
COPY docker/etf-cms-dodas/config/ncgx.cfg /etc/ncgx/
EXPOSE 443 6557
COPY docker/etf-cms/docker-entrypoint.sh /
ENTRYPOINT /docker-entrypoint.sh
metrics = {
"org.sam.CONDOR-JobState" : {
"command" : "/usr/lib64/nagios/plugins/check_js",
"args" : {
"--vo" : "::VO",
"--mb-destination" : "::MB_DESTINATION",
"--mb-uri" : "::MB_BROKER_HOST",
"--add-wntar-nag-nosamcfg" : "",
"--prefix": "org.sam.CONDOR",
"-t" : 600,
},
"docurl" : "https://etf.cern.ch/docs",
"doc" : "https://etf.cern.ch/docs",
"ocsp" : 0,
"max_check_attempts" : 2,
"timeout" : 600,
"interval" : 60,
"retry_interval" : 15
},
"org.sam.CONDOR-JobMonit" : {
"command" : "/usr/libexec/grid-monitoring/probes/condor/CONDORG-probe",
"args" : {
"--vo" : "::VO",
"-m" : "org.sam.CONDOR-JobMonit",
"--namespace" : "org.sam",
"--err-topics" : "ce_wms,creamce",
"-t" : 600,
"-v" : 3,
"--stdout" : "",
"--timeout-job-discard" : 84600,
"--timeout-job-idle" : 82800,
"--timeout-job-running" : 82800,
"--timeout-job-held" : 82800
},
"ocsp" : 0,
"max_check_attempts" : 2,
"timeout" : 600,
"interval" : 5,
"retry_interval" : 2,
"nagios_command" : "ncgx_check_native"
},
}
\ No newline at end of file
import logging
import itertools
import requests
import urlparse
import xml.etree.ElementTree as ET
from ncgx.inventory import Hosts, Checks, Groups
from vofeed.api import VOFeed
log = logging.getLogger('ncgx')
CE_STATE_METRICS = ('org.sam.CONDOR-JobState-/cms/Role=lcgadmin',)
CE_METRICS = (
'org.sam.CONDOR-JobSubmit-/cms/Role=lcgadmin',
'org.cms.WN-analysis-/cms/Role=lcgadmin',
'org.cms.WN-isolation-/cms/Role=lcgadmin',
'org.cms.WN-basic-/cms/Role=lcgadmin',
'org.cms.WN-cvmfs-/cms/Role=lcgadmin',
'org.cms.WN-env-/cms/Role=lcgadmin',
'org.cms.WN-frontier-/cms/Role=lcgadmin',
'org.cms.WN-mc-/cms/Role=lcgadmin',
'org.cms.WN-remotestageout-/cms/Role=lcgadmin',
'org.cms.WN-squid-/cms/Role=lcgadmin',
'org.cms.WN-xrootd-access-/cms/Role=lcgadmin',
'org.cms.WN-xrootd-fallback-/cms/Role=lcgadmin')
def run(url):
log.info("Processing vo feed: %s" % url)
# Get services from the VO feed, i.e
# list of tuples (hostname, flavor, endpoint)
feed = VOFeed(url)
services = feed.get_services()
# Add hosts, each tagged with corresponding flavors
# creates /etc/ncgx/conf.d/generated_hosts.cfg
h = Hosts()
for service in services:
h.add(service[0], tags=[service[1]])
h.serialize()
# Add host groups
sites = feed.get_groups("CMS_Site")
hg = Groups("host_groups")
for site, hosts in sites.iteritems():
for host in hosts:
hg.add(site, host)
hg.serialize()
# Add corresponding metrics to tags
# creates /etc/ncgx/conf.d/generated_checks.cfg
c = Checks()
# DODAS CEs
# Add corresponding metrics to tags
# creates /etc/ncgx/conf.d/generated_checks.cfg
c = Checks()
# HT-CONDOR-CEs
for service in services: # special handling for HTCONDOR-CEs (no BDII)
if service[1] == 'HTCONDOR-CE' and 'fnal' in service[0]:
for m in CE_STATE_METRICS:
c.add(m, hosts=(service[0],), params={'args': {'--resource': 'htcondor://%s' % service[0]}})
c.add_all(CE_METRICS, hosts=(service[0],))
for m in CE_STATE_METRICS:
c.add(m, hosts=('T3_IT_Opportunistic.dodas',), params={'args': {'--resource': 'dodas://T3_IT_Opportunistic.dodas/nosched/nolrms/noqueue',
'--jdl-ads': '\'+DESIRED_Sites=\"{0}\"_NL_+JOB_CMSSite=\"{0}\"\''.format('T3_IT_Opportunistic')}})
c.add_all(CE_METRICS, hosts=('T3_IT_Opportunistic.dodas',))
c.serialize()
# Add host groups
sites = feed.get_groups("CMS_Site")
hg = Groups("host_groups")
for site, hosts in sites.iteritems():
for host in hosts:
hg.add(site, host)
hg.serialize()
metrics = {
"org.globus.GridProxy-Get-cms" : {
"extends" : "org.globus.GridProxy-Get",
"interval" : 30,
"args" : {
"-x" : "::CMS_PROXY_PILOT2",
}
},
"org.globus.GridProxy-Get-/cms/Role=lcgadmin" : {
"extends" : "org.globus.GridProxy-Get",
"interval" : 30,
"args" : {
"-x" : "::CMS_PROXY_LCGADMIN",
"--vo-fqan" : "::CMS_FQAN_LCGADMIN",
}
},
"org.globus.GridProxy-Get-/cms/Role=pilot" : {
"extends" : "org.globus.GridProxy-Get",
"interval" : 30,
"args" : {
"-x" : "::CMS_PROXY_PILOT",
"--vo-fqan" : "::CMS_FQAN_PILOT",
}
},
"org.globus.GridProxy-Get-/cms/Role=production" : {
"extends" : "org.globus.GridProxy-Get",
"interval" : 30,
"args" : {
"-x" : "::CMS_PROXY_PROD",
"--vo-fqan" : "::CMS_FQAN_PROD",
}
},
"CMS-certificate-lifetime" : {
"extends" : "org.globus.MyProxy-ProxyLifetime",
"args" : {
"-x" : "::CMS_PROXY_LCGADMIN",
},
},
"org.globus.GridProxy-Valid-cms" : {
"extends" : "org.globus.GridProxy-Valid",
"depends" : "org.globus.GridProxy-Get-cms",
"args" : {
"-x" : "::CMS_PROXY_PILOT2",
}
},
"org.globus.GridProxy-Valid-/cms/Role=production" : {
"extends" : "org.globus.GridProxy-Valid",
"depends" : "org.globus.GridProxy-Get-/cms/Role=production",
"args" : {
"-x" : "::CMS_PROXY_PROD",
}
},
"org.globus.GridProxy-Valid-/cms/Role=pilot" : {
"extends" : "org.globus.GridProxy-Valid",
"depends" : "org.globus.GridProxy-Get-/cms/Role=pilot",
"args" : {
"-x" : "::CMS_PROXY_PILOT",
}
},
"org.globus.GridProxy-Valid-/cms/Role=lcgadmin" : {
"extends" : "org.globus.GridProxy-Valid",
"depends" : "org.globus.GridProxy-Get-/cms/Role=lcgadmin CMS-certificate-lifetime",
"args" : {
"-x" : "::CMS_PROXY_LCGADMIN",
}
},
"webdav.HTTP-All-/cms/Role=production" : {
"extends" : "webdav.HTTP-All"
},
"org.globus.MyProxy-ProxyLifetime-/cms/Role=production" : {
"extends" : "org.globus.MyProxy-ProxyLifetime",
"args" : {
"-x" : "::CMS_PROXY_PROD"
}
},
"org.globus.MyProxy-ProxyLifetime-/cms/Role=pilot" : {
"extends" : "org.globus.MyProxy-ProxyLifetime",
"args" : {
"-x" : "::CMS_PROXY_PILOT"
}
},
"org.globus.MyProxy-ProxyLifetime-/cms/Role=lcgadmin" : {
"extends" : "org.globus.MyProxy-ProxyLifetime",
"args" : {
"-x" : "::CMS_PROXY_LCGADMIN"
}
},
"org.sam.CONDOR-JobState-/cms/Role=lcgadmin" : {
"extends" : "org.sam.CONDOR-JobState",
"depends" : "org.globus.GridProxy-Valid-/cms/Role=lcgadmin",
"interval" : 15,
"retry_interval" : 15,
"args" : {
"-x" : "::CMS_PROXY_LCGADMIN",
"--suffix" : "/cms/Role=lcgadmin",
"--backend" : "scondor",
"--work-dir" : "/var/lib/gridprobes",
"--executable" : "/usr/libexec/grid-monitoring/probes/condor/wnjob_wlcg/nagrun.sh",
"--vo-fqan" : "::CMS_FQAN_LCGADMIN",
"--add-wntar-nag" : "/usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms,/usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms.lcgadmin",
}
},
"org.sam.CONDOR-JobSubmit-/cms/Role=lcgadmin" : {
"passive" : True,
"depends" : "org.sam.CONDOR-JobState-/cms/Role=lcgadmin"
},
"org.cms.SRM-AllCMS-/cms/Role=production" : {
"command" : "/usr/libexec/grid-monitoring/probes/org.cms/srmvometrics.py",
"args" : {
"--vo" : "::VO",
"--vo-fqan" : "::CMS_FQAN_PROD",
"-x" : "::CMS_PROXY_PROD",
"-m" : "org.cms.SRM-AllCMS",
},
"doc" : "",
"docurl" : "https://twiki.cern.ch/twiki/bin/view/LCG/SAMProbesMetrics#SRM",
"ocsp" : 1,
"timeout" : 600,
"interval" : 15,
"retry_interval" : 15,
"max_check_attempts" : 4,
},
"org.cms.SRM-GetCMSInfo-/cms/Role=production" : {
"depends" : "org.cms.SRM-AllCMS-/cms/Role=production",
"passive" : True,
},
"org.cms.SRM-VODel-/cms/Role=production" : {
"depends" : "org.cms.SRM-AllCMS-/cms/Role=production",
"passive" : True,
},
"org.cms.SRM-VOGet-/cms/Role=production" : {
"depends" : "org.cms.SRM-AllCMS-/cms/Role=production",
"passive" : True,
},
"org.cms.SRM-VOLs-/cms/Role=production" : {
"depends" : "org.cms.SRM-AllCMS-/cms/Role=production",
"passive" : True,
},
"org.cms.SRM-VOLsDir-/cms/Role=production" : {
"depends" : "org.cms.SRM-AllCMS-/cms/Role=production",
"passive" : True,
},
"org.cms.SRM-VOPut-/cms/Role=production" : {
"depends" : "org.cms.SRM-AllCMS-/cms/Role=production",
"passive" : True,
},
"org.cms.WN-cvmfs-/cms/Role=production" : {
"docurl" : "https://twiki.cern.ch/twiki/bin/view/CMS/LhcbItSamNagiosProbes#WnProbes",
"doc" : "https://twiki.cern.ch/twiki/bin/view/CMS/LhcbItSamNagiosProbes#WnProbes",
"passive" : True,
},
"org.cms.SE-xrootd-read" : {
"command" : "/usr/libexec/grid-monitoring/probes/org.cms/cmssam_xrootd_endpnt.py",
"args" : {
"--x509" : "::CMS_PROXY_PROD",
},
"doc" : "",
"docurl" : "https://twiki.cern.ch/twiki/bin/edit/CMSPublic/SAMLocalXrootd",
"ocsp" : 1,
"timeout" : 600,
"interval" : 15,
"retry_interval" : 15,
"max_check_attempts" : 4,
},
}
MB_BROKER_HOST="stomp://oldsam.msg.cern.ch:6163/"
MB_DESTINATION="/queue/grid.probe.metricOutput.EGEE.etf-cms-preprod_cern_ch"
PLUGINS = { "etf_plugin_cms_dodas" : { "url": "http://wlcg-sam-cms.cern.ch/dashboard/request.py/cmssitemapbdii"}}
VO = 'cms'
#ATTRIBUTE_OVERRIDE = [ ('ALL', {'interval' : 15}), ('ALL', { 'passive': False }), ('ALL', {'retry_interval' : 15}) ]
#COMMAND_OVERRIDE = { 'ALL' : 'ncgx_check!check_random!-s \"o,w,c,u\"' }
#SCHEDULE_OVERRIDE = 60
SCRIPTS = [ 'localhost', 'unique_tag']
AUTO_PASSIVE=True
NAGIOS_PATH="/opt/omd/sites/etf/etc/nagios/conf.d/wlcg"
HOSTKEY="/opt/omd/sites/etf/etc/nagios/globus/etf_srv_key.pem"
HOSTCERT="/opt/omd/sites/etf/etc/nagios/globus/etf_srv_cert.pem"
PROXY_LIFETIME="24"
PROXY_NAME="NagiosRetrieve-ETF-cms"
PROXY_USER="nagios"
X509_USER_PROXY_PROD="/opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_production"
VO_FQAN_PROD="/cms/Role=production"
X509_USER_PROXY_PILOT="/opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_pilot"
VO_FQAN_PILOT="/cms/Role=pilot"
X509_USER_PROXY_LCGADMIN="/opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_lcgadmin"
VO_FQAN_LCGADMIN="/cms/Role=lcgadmin"
X509_USER_PROXY_PILOT2="/opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms"
CMS_PROXY_PROD="/opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_production"
CMS_FQAN_PROD="/cms/Role=production"
CMS_PROXY_PILOT="/opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_pilot"
CMS_FQAN_PILOT="/cms/Role=pilot"
CMS_PROXY_LCGADMIN="/opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_lcgadmin"
CMS_FQAN_LCGADMIN="/cms/Role=lcgadmin"
CMS_PROXY_PILOT2="/opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms"
DEFAULT_CONTACT_GROUPS="check-mk-notify"
DEFINE_HOSTGROUPS=True
DEFINE_SERVICEGROUPS=True
DEFINE_CONTACTS=True
DNS_SERVER="137.138.17.5"
#!/bin/bash
set -e
_term() {
omd stop
if [ -f /var/run/crond.pid ]; then
kill -9 `cat /var/run/crond.pid`
rm -f /var/run/crond.pid
fi
rm -rf /opt/omd/sites/etf/etc/nagios/conf.d/wlcg/
}
trap _term SIGINT SIGTERM
cat << "EOF"
_____ _____ _____ ____ __ __ ____
| ____|_ _| ___| / ___| \/ / ___|
| _| | | | |_ | | | |\/| \___ \
| |___ | | | _| | |___| | | |___) |
|_____| |_| |_| \____|_| |_|____/
========================================
EOF
ncgx_version=`rpm -q --qf "%{VERSION}-%{RELEASE}" ncgx`
echo "ETF version: ${ncgx_version} Copyright CERN 2016"
echo "License: https://gitlab.cern.ch/etf/ncgx/blob/master/LICENSE"
echo "Check_MK version: $CHECK_MK_VERSION"
echo "Copyright by Mathias Kettner (https://mathias-kettner.de/check_mk.html)"
plugins=`rpm -qa | grep nagios-plugins`
echo "Plugins:"
echo "${plugins}"
echo ""
echo "Starting xinetd ..."
export XINETD_LANG="en_US" && /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
if [[ -n $CHECK_MK_USER_ID ]] ; then
echo "Changing $CHECK_MK_SITE uid to $CHECK_MK_USER_ID"
/usr/sbin/usermod -u $CHECK_MK_USER_ID $CHECK_MK_SITE
chown -R $CHECK_MK_SITE /etc/ncgx /var/cache/ncgx /var/cache/nap
chown -R $CHECK_MK_SITE /usr/libexec/grid-monitoring/probes/
fi
if [[ -n $CHECK_MK_GROUP_ID ]] ; then
echo "Creating group with gid $CHECK_MK_GROUP_ID"
/usr/sbin/groupadd -g $CHECK_MK_GROUP_ID sec
/usr/sbin/groupmems -g sec -a $CHECK_MK_SITE
fi
echo "Starting crond ..."
/usr/sbin/crond -m off -p -s
echo "Copying certificates ..."
if [ ! -f /etc/grid-security/hostcert.pem ]; then
echo "Failed to find certificates in /etc/grid-security"
exit
fi
mkdir -p /opt/omd/sites/etf/etc/nagios/globus/
cp /etc/grid-security/host*.pem /opt/omd/sites/etf/etc/nagios/globus/
cp /etc/grid-security/etf_srv*.pem /opt/omd/sites/etf/etc/nagios/globus/
chown -R ${CHECK_MK_SITE}.${CHECK_MK_SITE} /opt/omd/sites/etf/etc/nagios/globus/
chown ${CHECK_MK_SITE} /usr/lib64/nagios/plugins/check_js
echo "Configuring access ..."
echo "Configured admins: $CHECK_MK_ADMINS"
sed -i "s|admin_users.*|admin_users = [$CHECK_MK_ADMINS]|" /opt/omd/sites/$CHECK_MK_SITE/etc/check_mk/multisite.mk
if [ -f /etc/check_mk/contacts.mk ]; then
cp /etc/check_mk/contacts.mk /opt/omd/sites/$CHECK_MK_SITE/etc/check_mk/conf.d/wato/
fi
if [ -g /etc/check_mk/users.mk ]; then
cp /etc/check_mk/users.mk /opt/omd/sites/$CHECK_MK_SITE/etc/check_mk/conf.d/wato/
fi
cp /etc/ncgx/templates/generic/handlers.cfg /opt/omd/sites/etf/etc/nagios/conf.d/
omd start
rm -f /opt/omd/sites/etf/etc/nagios/conf.d/handlers.cfg
echo "Configuring main.mk: $ETF_HOSTED_BY"
if [ -z "${ETF_HOSTED_BY}" ]; then
echo " Variable ETF_HOSTED_BY is not defined, not touching main.mk"
else
if grep -q all_hosts /opt/omd/sites/$CHECK_MK_SITE/etc/check_mk/main.mk; then
sed "s/all_hosts.*/all_hosts += [ \"${ETF_HOSTED_BY}\" ]/g" -i /opt/omd/sites/$CHECK_MK_SITE/etc/check_mk/main.mk
else
echo "all_hosts += [ \"${ETF_HOSTED_BY}\" ]" >> /opt/omd/sites/$CHECK_MK_SITE/etc/check_mk/main.mk
fi
fi
echo "Configuring ETF ..."
if [ -z "${ETF_NAGIOS_HOST}" ]; then
echo " Variable ETF_NAGIOS_HOST is not defined, using hostname"
ETF_NAGIOS_HOST=`hostname`
echo "NAGIOS_HOST = \"${ETF_NAGIOS_HOST}\"" >> /etc/ncgx/ncgx.cfg
else
echo "NAGIOS_HOST = \"${ETF_NAGIOS_HOST}\"" >> /etc/ncgx/ncgx.cfg
fi
su etf -c "ncgx --log | tee /opt/omd/sites/etf/var/log/ncgx.log"
su - etf -c "cmk -II; cmk -O"
if [ "${NSTREAM_ENABLED}" -eq "1" ] ; then
echo "Nagios stream enabled ..."
else
echo "Nagios stream disabled ..."
/usr/bin/disable_nstream
fi
if [ "${ABRT_ENABLED}" -eq "1" ] ; then
echo "Enabling abrt ..."
sed -e "s/OpenGPGCheck = yes/OpenGPGCheck = no/g" -i /etc/abrt/abrt-action-save-package-data.conf
/usr/sbin/abrtd
fi
echo "Fetching CMS credentials ..."
su etf -c "/usr/lib/nagios/plugins/globus/refresh_proxy --vo-fqan /cms/Role=lcgadmin --myproxyuser nagios -H myproxy.cern.ch -t 120 --key /opt/omd/sites/etf/etc/nagios/globus/etf_srv_key.pem --vo cms --lifetime 24 --name NagiosRetrieve-ETF-cms -x /opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_lcgadmin --cert /opt/omd/sites/etf/etc/nagios/globus/etf_srv_cert.pem"
su etf -c "/usr/lib/nagios/plugins/globus/refresh_proxy --vo-fqan /cms/Role=production --myproxyuser nagios -H myproxy.cern.ch -t 120 --key /opt/omd/sites/etf/etc/nagios/globus/etf_srv_key.pem --vo cms --lifetime 24 --name NagiosRetrieve-ETF-cms -x /opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_production --cert /opt/omd/sites/etf/etc/nagios/globus/etf_srv_cert.pem"
su etf -c "/usr/lib/nagios/plugins/globus/refresh_proxy --myproxyuser nagios -H myproxy.cern.ch -t 120 --key /opt/omd/sites/etf/etc/nagios/globus/etf_srv_key.pem --vo cms --lifetime 24 --name NagiosRetrieve-ETF-cms -x /opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms --cert /opt/omd/sites/etf/etc/nagios/globus/etf_srv_cert.pem"
echo "Copying credentials ..."
/bin/cp -f /opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms.glexec/probes/org.cms.glexec/testjob/tests/payloadproxy-t2
/bin/chown ${CHECK_MK_SITE} /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms.glexec/probes/org.cms.glexec/testjob/tests/payloadproxy-t2
/bin/chmod go+r /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms.glexec/probes/org.cms.glexec/testjob/tests/payloadproxy-t2
/bin/cp -f /opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_production /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms/probes/org.cms/testjob/tests/prodproxy
/bin/chown ${CHECK_MK_SITE} /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms/probes/org.cms/testjob/tests/prodproxy
/bin/chmod go+r /usr/libexec/grid-monitoring/probes/org.cms/wnjob/org.cms/probes/org.cms/testjob/tests/prodproxy
echo "Reloading crontab ..."
su etf -c "omd reload crontab"
echo "Starting Apache ..."
/usr/sbin/httpd -DFOREGROUND
......@@ -31,6 +31,7 @@ if [[ -n $CHECK_MK_USER_ID ]] ; then
echo "Changing $CHECK_MK_SITE uid to $CHECK_MK_USER_ID"
/usr/sbin/usermod -u $CHECK_MK_USER_ID $CHECK_MK_SITE
chown -R $CHECK_MK_SITE /etc/ncgx /var/cache/ncgx /var/cache/nap
chown -R $CHECK_MK_SITE /usr/libexec/grid-monitoring/probes/
fi
if [[ -n $CHECK_MK_GROUP_ID ]] ; then
echo "Creating group with gid $CHECK_MK_GROUP_ID"
......
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