Skip to content

Commit

Permalink
Merge pull request #128 from ARGOeu/devel
Browse files Browse the repository at this point in the history
Prepare to release v0.4.11
  • Loading branch information
kkoumantaros authored May 8, 2020
2 parents b8b4cb5 + 3d1740d commit e4bf746
Show file tree
Hide file tree
Showing 23 changed files with 169 additions and 384 deletions.
26 changes: 25 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ pipeline {
}
archiveArtifacts artifacts: '**/*.rpm', fingerprint: true
}
post {
always {
cleanWs()
}
}
}
stage ('Centos 6') {
agent {
Expand All @@ -42,11 +47,30 @@ pipeline {
}
archiveArtifacts artifacts: '**/*.rpm', fingerprint: true
}
post {
always {
cleanWs()
}
}
}
}
post {
always {
cleanWs()
}
success {
script{
if ( env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'devel' ) {
slackSend( message: ":rocket: New version for <$BUILD_URL|$PROJECT_DIR>:$BRANCH_NAME Job: $JOB_NAME !")
}
}
}
failure {
script{
if ( env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'devel' ) {
slackSend( message: ":rain_cloud: Build Failed for <$BUILD_URL|$PROJECT_DIR>:$BRANCH_NAME Job: $JOB_NAME")
}
}
}
}
}
}
20 changes: 9 additions & 11 deletions argo-ncg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Summary: ARGO Nagios config generator
Name: argo-ncg
Version: 0.4.10
Version: 0.4.11
Release: 1%{?dist}
License: ASL 2.0
Group: Network/Monitoring
Expand Down Expand Up @@ -37,22 +37,22 @@ install --directory $RPM_BUILD_ROOT%{_sbindir}
install --directory $RPM_BUILD_ROOT/usr/libexec/%{name}
install --mode=755 ncg.pl $RPM_BUILD_ROOT%{_sbindir}
install --mode=755 ncg.reload.sh $RPM_BUILD_ROOT%{_sbindir}
install --mode=755 argo-unicore-keystore.sh $RPM_BUILD_ROOT/usr/libexec/%{name}
install --mode=755 argo-unicore-truststore.sh $RPM_BUILD_ROOT/usr/libexec/%{name}
install --mode=755 argo-java-keystore.sh $RPM_BUILD_ROOT/usr/libexec/%{name}
install --mode=755 argo-java-truststore.sh $RPM_BUILD_ROOT/usr/libexec/%{name}

#
# Config
#
install --directory $RPM_BUILD_ROOT%{configdir}/ncg.conf.d/
install --directory $RPM_BUILD_ROOT%{configdir}/ncg-localdb.d/
install ncg.conf $RPM_BUILD_ROOT%{configdir}
install ncg-vars.conf $RPM_BUILD_ROOT%{configdir}
install ncg.localdb $RPM_BUILD_ROOT%{configdir}
install ncg.localdb.example $RPM_BUILD_ROOT%{configdir}
install check_logfiles_ncg.conf $RPM_BUILD_ROOT%{configdir}
install --directory $RPM_BUILD_ROOT/etc/nagios/argo-ncg.d
install --directory $RPM_BUILD_ROOT/etc/nagios/globus

cp -r unicore $RPM_BUILD_ROOT/etc/nagios
#
# modules
#
Expand All @@ -72,20 +72,16 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%config(noreplace) %{configdir}/ncg.conf.d
%config(noreplace) %{configdir}/ncg.conf
%config(noreplace) %{configdir}/ncg-vars.conf
%config(noreplace) %{configdir}/ncg.localdb
%config(noreplace) %{configdir}/ncg.localdb.example
%config(noreplace) %{configdir}/ncg-localdb.d
%config(noreplace) /etc/nagios/argo-ncg.d
%config(noreplace) /etc/nagios/unicore/log4j-ucc.properties
%config(noreplace) /etc/nagios/unicore/log4j-ucc-debug.properties
%config(noreplace) /etc/nagios/unicore/log4j-uvosclc.properties
%config(noreplace) /etc/nagios/unicore/log4j-uvosclc-debug.properties
/etc/nagios/unicore/UNICORE_Job.u
%{configdir}/check_logfiles_ncg.conf
%{_sbindir}/ncg.pl
%{_sbindir}/ncg.reload.sh
/usr/libexec/%{name}/argo-unicore-keystore.sh
/usr/libexec/%{name}/argo-unicore-truststore.sh
/usr/libexec/%{name}/argo-java-keystore.sh
/usr/libexec/%{name}/argo-java-truststore.sh

%{perllib}/NCG.pm
%{perllib}/NCG/
Expand All @@ -99,6 +95,8 @@ if [ -f /etc/init.d/ncg ] ; then
fi

%changelog
* Fri May 8 2020 Emir Imamagic <[email protected] - 0.4.11-1
- Version bump
* Fri Apr 10 2020 Emir Imamagic <[email protected]> - 0.4.10-1
- Version bump
* Thu Mar 26 2020 Emir Imamagic <[email protected]> - 0.4.9-1
Expand Down
35 changes: 35 additions & 0 deletions config/ncg-vars.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Set ARGO Monitoring Engine hostname
# (default: hostname)
# NAGIOS_SERVER =

# Set following option if you wish to receive
# email alerts for Nagios internal checks
# (default: root@localhost)
# NAGIOS_ADMIN = root@localhost

# ARGO WEB-API root URL
# (default: https://api.argo.grnet.gr)
# WEBAPI_ROOT_URL = https://api.argo.grnet.gr

# ARGO WEB-API token must be provided
# in order to fetch metric profiles
# (default: )
# WEBAPI_TOKEN = MY_WEBAPI_TOKEN

# List of metric profiles used for configuring
# ARGO Monitoring Engine
# (default: )
# PROFILES = MON

# ARGO POEM URL
# (default: https://training.poem.devel.argo.grnet.gr)
# POEM_ROOT_URL = https://training.poem.devel.argo.grnet.gr

# ARGO POEM token must be provided in order
# to fetch metric definitions
# (default: )
# POEM_TOKEN = MY_POEM_TOKEN

# GOCDB API root URL
# (default: https://gocdb.egi.eu/gocdbpi)
# GOCDB_ROOT_URL = https://gocdb.egi.eu/gocdbpi
87 changes: 22 additions & 65 deletions config/ncg.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,106 +3,63 @@
# For further details see:
# http://search.cpan.org/dist/Config-General/

# Global variables which can be used in module
# configuration (e.g. LDAP_ADDRESS=$BDII).
# Variables in curly brackets are environment
# variables.

# Set following option if you wish to receive
# email alerts for Nagios internal checks
# default root@localhost
# [email protected]

# list of VOs for which you wish to run checks
VO = dteam

#
# Some optional config
#
# NAGIOS_SERVER = nagios.fqdn
# ENABLE_UNICORE_PROBES=1
# MYPROXY_SERVER = myproxy.fqdn
# include standard variables
include ncg-vars.conf

# Configuration of individual NCG modules.
# First level block represents abstract module.

<NCG::ConfigGen>

# Second level block defines specific module
# parameters passed at invocation.

<Nagios>
NAGIOS_ROLE = ngi
INCLUDE_EMPTY_HOSTS = 0
ENABLE_NOTIFICATIONS = 0
SEND_TO_DASHBOARD = 0
CHECK_HOSTS = 0
TENANT = ARGO-TEST
ROBOT_CERT=/etc/nagios/globus/robocert.pem
ROBOT_KEY=/etc/nagios/globus/robokey.pem
USE_ROBOT_CERT=1
SEND_TO_MSG = 0
</Nagios>

</NCG::ConfigGen>

# NCG modules for gathering site information
<NCG::SiteSet>
<GOCDB>
GOCDB_ROOT_URL=https://goc.egi.eu/gocdbpi
ENABLE_UNICORE_PROBES=$ENABLE_UNICORE_PROBES
ROC=NGI_HR
GOCDB_ROOT_URL=$GOCDB_ROOT_URL
SCOPE=$GOCDB_SCOPE
</GOCDB>
<File>
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
</File>
</NCG::SiteSet>

<NCG::SiteInfo>
<GOCDB>
GOCDB_ROOT_URL=https://goc.egi.eu/gocdbpi
GOCDB_ROOT_URL=$GOCDB_ROOT_URL
SCOPE=$GOCDB_SCOPE
</GOCDB>
<File>
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
</File>
</NCG::SiteInfo>

# NCG modules for gathering metrics & attributes
<NCG::LocalMetrics>
<WEBAPI>
WEBAPI_ROOT_URL = https://api.devel.argo.grnet.gr
PROFILES = ARGO_TEST,ARGO_MON,MW_MONITOR,OPS_MONITOR
TOKEN = TOKEN_STRING
WEBAPI_ROOT_URL = $WEBAPI_ROOT_URL
PROFILES = $PROFILES
TOKEN = $WEBAPI_TOKEN
</WEBAPI>
<File>
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
</File>
</NCG::LocalMetrics>

<NCG::MetricConfig>
<POEM>
POEM_ROOT_URL = http://egi.poem.devel.argo.grnet.gr
TOKEN = POEM_TOKEN_STRING
POEM_ROOT_URL = $POEM_ROOT_URL
TOKEN = $POEM_TOKEN
</POEM>
</NCG::MetricConfig>

<NCG::LocalMetricsAttrs>
<Active>
GOCDB_ROOT_URL=https://goc.egi.eu/gocdbpi
ENABLE_UNICORE_PROBES=$ENABLE_UNICORE_PROBES
BDII_HOST=bdii.fqdn
INCLUDE_PROXY_CHECKS = 1
INCLUDE_MSG_CHECKS_SEND = 0
</Active>
<LDAP>
LDAP_ADDRESS=bdii.fqdn
BDII_LEVEL=top
</LDAP>
<Active/>
<File>
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
</File>
</NCG::LocalMetricsAttrs>

# Include any custom configuration.
<NCG::ConfigGen>
<Nagios/>
</NCG::ConfigGen>

# include custom configurations
include ncg.conf.d/*.conf
13 changes: 0 additions & 13 deletions config/unicore/UNICORE_Job.u

This file was deleted.

7 changes: 0 additions & 7 deletions config/unicore/log4j-ucc-debug.properties

This file was deleted.

7 changes: 0 additions & 7 deletions config/unicore/log4j-ucc.properties

This file was deleted.

7 changes: 0 additions & 7 deletions config/unicore/log4j-uvosclc-debug.properties

This file was deleted.

7 changes: 0 additions & 7 deletions config/unicore/log4j-uvosclc.properties

This file was deleted.

40 changes: 40 additions & 0 deletions src/argo-java-keystore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

ROBOT_CERT=/etc/nagios/globus/robocert.pem
ROBOT_KEY=/etc/nagios/globus/robokey.pem
KEYSTORE_DIR=/etc/nagios/globus
NCG_CONFIG_FILE=/etc/argo-ncg/ncg-localdb.d/java-keystore.conf

if [ ! -f $ROBOT_CERT ]; then
echo "Please install robot certificate to $ROBOT_CERT"
exit -1
fi
if [ ! -f $ROBOT_KEY ]; then
echo "Please install robot key to $ROBOT_KEY"
exit -1
fi

# if parameter is passed, reuse password
if [ "$#" -eq 0 ]; then
KEYSTORE_PASS=`head /dev/urandom | tr -dc A-Za-z0-9 | head -c20`
else
KEYSTORE_OLD_PASS=`grep "^GLOBAL_ATTRIBUTE\!KEYSTORE_PASSWORD\!" $NCG_CONFIG_FILE 2>/dev/null`
if [ $? -ne 0 ]; then
echo "Cannot find old password in $NCG_CONFIG_FILE"
exit -1
else
KEYSTORE_PASS=${KEYSTORE_OLD_PASS#'GLOBAL_ATTRIBUTE!KEYSTORE_PASSWORD!'}
fi
fi

# Generate keystore
rm -f $KEYSTORE_DIR/keystore.jks.tmp $KEYSTORE_DIR/tmp.p12
openssl pkcs12 -export -in $ROBOT_CERT -inkey $ROBOT_KEY -name mon_agent -out $KEYSTORE_DIR/tmp.p12 -passout pass:$KEYSTORE_PASS
keytool -importkeystore -srckeystore $KEYSTORE_DIR/tmp.p12 -srcstoretype PKCS12 -deststoretype jks -deststorepass $KEYSTORE_PASS -destkeystore $KEYSTORE_DIR/keystore.jks.tmp -srcstorepass $KEYSTORE_PASS -destalias mon_agent -srcalias mon_agent
rm -f $KEYSTORE_DIR/tmp.p12
chown nagios:nagios $KEYSTORE_DIR/keystore.jks.tmp
chmod 400 $KEYSTORE_DIR/keystore.jks.tmp
mv -f $KEYSTORE_DIR/keystore.jks.tmp $KEYSTORE_DIR/keystore.jks

# Pass keypass to NCG
echo "GLOBAL_ATTRIBUTE!KEYSTORE_PASSWORD!$KEYSTORE_PASS" > $NCG_CONFIG_FILE
File renamed without changes.
Loading

0 comments on commit e4bf746

Please sign in to comment.