* Added Clusterware (CRS) plugins (as a platform).
* Moved Serviceguard plugins to separate platform (+fixes) * Other fixes
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# -- post-install --
|
||||
post_install() {
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-install script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-install script"
|
||||
}
|
||||
|
||||
# -- post-remove --
|
||||
post_remove() {
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-uninstall script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-uninstall script"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
# Maintainer: Patrick Van der Veken <patrick@kudos.be>
|
||||
|
||||
_pkgname="check_health"
|
||||
pkgname="hc-clusterware-platform"
|
||||
pkgver="%BUILD_DATE%"
|
||||
pkgrel=1
|
||||
pkgdesc="The KUDOS Health Checker (HC) for UNIX (Clusterware plugins)"
|
||||
arch=("any")
|
||||
url="https://github.com/patvdv/${_pkgname}"
|
||||
license=('GPL3')
|
||||
makedepends=('git')
|
||||
depends=('hc-linux')
|
||||
source=("${_pkgname}::git+${url}.git#branch=master")
|
||||
install=".install"
|
||||
sha256sums=('SKIP')
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/${_pkgname}"
|
||||
install -d -m 755 ${pkgdir}/opt/hc/lib
|
||||
install -d -m 755 ${pkgdir}/opt/hc/lib/platform
|
||||
install -d -m 755 ${pkgdir}/opt/hc/lib/platform/clusterware
|
||||
install -D -m 755 opt/hc/lib/platform/clusterware/check_clusterware_resource_config.sh ${pkgdir}/opt/hc/lib/platform/clusterware/check_clusterware_resource_config.sh
|
||||
install -D -m 755 opt/hc/lib/platform/clusterware/check_clusterware_resource_status.sh ${pkgdir}/opt/hc/lib/platform/clusterware/check_clusterware_resource_status.sh
|
||||
install -d -m 755 ${pkgdir}/etc/opt/hc
|
||||
install -D -m 644 etc/opt/hc/check_clusterware_resource_config.conf.dist ${pkgdir}/etc/opt/hc/check_clusterware_resource_config.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_clusterware_resource_status.conf.dist ${pkgdir}/etc/opt/hc/check_clusterware_resource_status.conf.dist
|
||||
install -d -m 755 ${pkgdir}/etc/opt/hc/core
|
||||
install -d -m 755 ${pkgdir}/etc/opt/hc/core/templates
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
Package: hc-clusterware-platform
|
||||
Version: %BUILD_DATE%
|
||||
Architecture: all
|
||||
Maintainer: Patrick Van der Veken <patrick@kudos.be>
|
||||
Essential: no
|
||||
Installed-Size: 300
|
||||
Depends: hc-linux
|
||||
Section: tools
|
||||
Priority: extra
|
||||
Description: The KUDOS Health Checker (HC) for UNIX (Clusterware plugins).
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-install script ..."
|
||||
# debian: reset ownerships
|
||||
chown -R root:root /opt/hc /etc/opt/hc 2>/dev/null
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-install script"
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-uninstall script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-uninstall script"
|
||||
@@ -0,0 +1,83 @@
|
||||
%define build_timestamp %(date +"%Y%m%d")
|
||||
|
||||
Name: hc-clusterware-platform
|
||||
Version: %{build_timestamp}
|
||||
Release: 1
|
||||
|
||||
Summary: The KUDOS Health Checker (HC) for UNIX (Clusterware plugins)
|
||||
Group: Tools/Monitoring
|
||||
|
||||
License: GNU General Public License either version 2 of the License, or (at your option) any later version
|
||||
URL: http://www.kudos.be
|
||||
|
||||
Requires: ksh,hc-linux
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_topdir}/%{name}-%{version}-root
|
||||
|
||||
%description
|
||||
The Health Checker is collection of scripts (plugins) designed to perform regular - but not intensive - health checks on UNIX/Linux systems. It provides plugins for AIX, HP-UX and Linux as well customer specific checks. Checks may include topics such file system mounts, process checks, file consistency etc.
|
||||
This package contains Serviceguard platform specific plugins.
|
||||
|
||||
%prep
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
install -d -m 755 $RPM_BUILD_ROOT/opt/hc/lib
|
||||
install -d -m 755 $RPM_BUILD_ROOT/opt/hc/lib/platform
|
||||
install -d -m 755 $RPM_BUILD_ROOT/opt/hc/lib/platform/clusterware
|
||||
cp ../SOURCES/opt/hc/lib/platform/clusterware/check_clusterware_resource_config.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/clusterware/check_clusterware_resource_config.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/clusterware/check_clusterware_resource_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/clusterware/check_clusterware_resource_status.sh
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/opt/hc
|
||||
cp ../SOURCES/etc/opt/hc/check_clusterware_resource_config.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_clusterware_resource_config.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_clusterware_resource_status.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_clusterware_resource_status.conf.dist
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/opt/hc/core
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/opt/hc/core/templates
|
||||
|
||||
%post
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-install script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-install script"
|
||||
|
||||
%postun
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-uninstall script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-uninstall script"
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,755)
|
||||
%dir /opt/hc/lib
|
||||
%dir /opt/hc/lib/platform
|
||||
%dir /opt/hc/lib/platform/clusterware
|
||||
%attr(755, root, root) /opt/hc/lib/platform/clusterware/check_clusterware_resource_config.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/clusterware/check_clusterware_resource_status.sh
|
||||
%dir /etc/opt/hc
|
||||
%attr(644, root, root) /etc/opt/hc/check_clusterware_resource_config.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_clusterware_resource_status.conf.dist
|
||||
%dir /etc/opt/hc/core
|
||||
%dir /etc/opt/hc/core/templates
|
||||
|
||||
%changelog
|
||||
* Sa Apr 20 2019 <patrick@kudos.be> - 0.0.1
|
||||
- Initial build
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env ksh
|
||||
#******************************************************************************
|
||||
# @(#) build script for HC RPM packages (uses 'rpmbuild')
|
||||
#******************************************************************************
|
||||
# @(#) Copyright (C) 2014 by KUDOS BVBA (info@kudos.be). All rights reserved.
|
||||
#
|
||||
# This program is a free software; you can redistribute it and/or modify
|
||||
# it under the same terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
|
||||
#******************************************************************************
|
||||
|
||||
#******************************************************************************
|
||||
# Requires following build (dir) structures:
|
||||
#
|
||||
# hc_build_linux_rpms.sh
|
||||
# BUILD/
|
||||
# BUILDROOT/
|
||||
# RPMS/
|
||||
# SOURCES/opt/
|
||||
# SOURCES/opt/hc/bin/<hc_scripts>
|
||||
# SOURCES/opt/hc/lib/*/<hc_plugins>
|
||||
# SOURCES/etc/opt/hc/<hc_configs>
|
||||
# SPECS/<spec_files>
|
||||
# SRPMS/
|
||||
#
|
||||
# Build order:
|
||||
# 1) Copy sources/scripts to the correct locations
|
||||
# 2) Copy template, build and installer script files into correct locations
|
||||
# 3) Execute hc_build_linux_rpms.sh
|
||||
# 4) RPM packages may be found in the RPMS directory
|
||||
#******************************************************************************
|
||||
|
||||
BUILD_DIR="$(dirname $0)"
|
||||
|
||||
# clean up previous packages
|
||||
rm -f ${BUILD_DIR}/RPMS/*/* >/dev/null
|
||||
|
||||
# build main packages
|
||||
rpmbuild -bb ${BUILD_DIR}/SPECS/hc-clusterware-platform.spec
|
||||
|
||||
print "List of built packages:"
|
||||
ls -l ${BUILD_DIR}/RPMS/*/*
|
||||
|
||||
exit 0
|
||||
|
||||
#******************************************************************************
|
||||
# END of script
|
||||
#******************************************************************************
|
||||
@@ -0,0 +1,155 @@
|
||||
#!/usr/bin/env ksh
|
||||
#******************************************************************************
|
||||
# @(#) CGK build script for HC SD packages (uses 'swpackage')
|
||||
#******************************************************************************
|
||||
# @(#) Copyright (C) 2014 by KUDOS BVBA (info@kudos.be). All rights reserved.
|
||||
#
|
||||
# This program is a free software; you can redistribute it and/or modify
|
||||
# it under the same terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
|
||||
#******************************************************************************
|
||||
|
||||
#******************************************************************************
|
||||
# Requires following build (dir) structures:
|
||||
#
|
||||
# build/hpux/<build_files>
|
||||
# build/hpux/check_health-build_hpux_depots.sh
|
||||
# opt/hc/bin/<hc_scripts>
|
||||
# opt/hc/lib/*/<hc_plugins>
|
||||
# etc/opt/hc/<hc_configs>
|
||||
# depots/
|
||||
#
|
||||
# Build order:
|
||||
# 1) Copy sources/scrips to the correct locations
|
||||
# 2) Copy pristine version of the build spec file to preserver %BUILD_DATE% (.psf)
|
||||
# 3) Copy template, build and installer script files into correct locations
|
||||
# 4) Execute check_health-build_hpux_depots.sh
|
||||
# 5) SD packages may be found in the 'depots' directory
|
||||
#******************************************************************************
|
||||
|
||||
BUILD_DATE="$(date +'%Y%m%d')"
|
||||
BUILD_PRETTY_DATE="$(date +'%Y.%m.%d')"
|
||||
BUILD_DIR=$(dirname "${0}")
|
||||
DEPOTS_DIR="${BUILD_DIR}/../../depots"
|
||||
|
||||
case "${1}" in
|
||||
prod)
|
||||
SW_DEPOT_LOC="/var/opt/ignite/depots/3rdparty"
|
||||
;;
|
||||
*)
|
||||
SW_DEPOT_LOC="/var/opt/ignite/depots/3rdparty-test"
|
||||
;;
|
||||
esac
|
||||
|
||||
# replace BUILD_DATE placeholder in PSF file(s)
|
||||
function fix_build_date
|
||||
{
|
||||
find . -name "*.psf" | while read -r FILE
|
||||
do
|
||||
if (( $(grep -c '%BUILD_DATE%' "${FILE}") == 0 ))
|
||||
then
|
||||
print -u2 "ERROR: no %BUILD_DATE% placeholder in ${FILE}!"
|
||||
exit 1
|
||||
else
|
||||
perl -pi -e "s/%BUILD_DATE%/${BUILD_PRETTY_DATE}/g" "${FILE}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# check for depot directory or clean up previous packages
|
||||
if [[ -d "${DEPOTS_DIR}" ]]
|
||||
then
|
||||
# shellcheck disable=SC2086
|
||||
rm -f ${DEPOTS_DIR}/hc_hpux*.sd ${DEPOTS_DIR}/hc_display*.sd ${DEPOTS_DIR}/hc_notify*.sd >/dev/null
|
||||
else
|
||||
mkdir -p "${DEPOTS_DIR}" || exit 1
|
||||
fi
|
||||
|
||||
# build hc_hpux package
|
||||
cd "${BUILD_DIR}/hc_hpux/" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_hpux.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_hpux-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_hpux.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
# build hc_hpux_platform package
|
||||
cd "${BUILD_DIR}/hc_hpux_platform" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_hpux_platform.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_hpux_platform-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_hpux_platform.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
# build hc_display_csv package
|
||||
cd "${BUILD_DIR}/hc_display_csv" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_display_csv.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_display_csv-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_display_csv.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
# build hc_display_init package
|
||||
cd "${BUILD_DIR}/hc_display_init" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_display_init.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_display_init-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_display_init.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
# build hc_display_json package
|
||||
cd "${BUILD_DIR}/hc_display_json" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_display_json.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_display_json-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_display_json.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
# build hc_display_terse package
|
||||
cd "${BUILD_DIR}/hc_display_terse" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_display_terse.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_display_terse-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_display_terse.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
# build hc_display_zenoss package
|
||||
cd "${BUILD_DIR}/hc_display_zenoss" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_display_zenoss.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_display_zenoss-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_display_zenoss.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
# build hc_notify_sms package
|
||||
cd "${BUILD_DIR}/hc_notify_sms" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_notify_sms.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_notify_sms-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_notify_sms.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
# build hc_notify_eif package
|
||||
cd "${BUILD_DIR}/hc_notify_eif" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_notify_eif.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_notify_eif-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_notify_eif.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
# -- additional depots --
|
||||
# build hc_serviceguard_platform package
|
||||
cd "${BUILD_DIR}/hc_serviceguard_platform" || exit 1
|
||||
fix_build_date
|
||||
swpackage -s hc_serviceguard_platform.psf -x media_type=tape -d "${DEPOTS_DIR}/hc_serviceguard_platform-${BUILD_DATE}.sd"
|
||||
swpackage -s hc_serviceguard_platform.psf @ ${SW_DEPOT_LOC}
|
||||
cd - || exit 1
|
||||
|
||||
print "INFO: list of built packages (local @${DEPOTS_DIR}):"
|
||||
# shellcheck disable=SC2086
|
||||
ls -l ${DEPOTS_DIR}/hc_hpux*.sd ${DEPOTS_DIR}/hc_display*.sd ${DEPOTS_DIR}/hc_notify*.sd
|
||||
|
||||
print "INFO: list of built packages (central @${SW_DEPOT_LOC}):"
|
||||
swlist @ ${SW_DEPOT_LOC} | grep "HC-"
|
||||
|
||||
exit 0
|
||||
|
||||
#******************************************************************************
|
||||
# END of script
|
||||
#******************************************************************************
|
||||
@@ -83,11 +83,6 @@ This is the OS/platform plugin package"
|
||||
file -m 755 check_hpux_postfix_status.sh
|
||||
file -m 755 check_hpux_root_crontab.sh
|
||||
file -m 755 check_hpux_sfm_status.sh
|
||||
file -m 755 check_hpux_sg_package_status.sh
|
||||
file -m 755 check_hpux_sg_package_config.sh
|
||||
file -m 755 check_hpux_sg_cluster_status.sh
|
||||
file -m 755 check_hpux_sg_cluster_config.sh
|
||||
file -m 755 check_hpux_sg_qs_status.sh
|
||||
file -m 755 check_hpux_sshd_status.sh
|
||||
file -m 755 check_hpux_syslog.sh
|
||||
file -m 755 check_hpux_syslogd_status.sh
|
||||
@@ -122,10 +117,6 @@ This is the OS/platform plugin package"
|
||||
file -m 755 check_hpux_patch_version.conf.dist
|
||||
file -m 644 check_hpux_root_crontab.conf.dist
|
||||
file -m 644 check_hpux_sfm_status.conf.dist
|
||||
file -m 644 check_hpux_sg_package_status.conf.dist
|
||||
file -m 644 check_hpux_sg_package_config.conf.dist
|
||||
file -m 644 check_hpux_sg_cluster_status.conf.dist
|
||||
file -m 644 check_hpux_sg_cluster_config.conf.dist
|
||||
file -m 644 check_hpux_syslog.conf.dist
|
||||
end
|
||||
|
||||
|
||||
@@ -41,11 +41,6 @@ package() {
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_hpssacli.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_hpssacli.sh
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_process_limits.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_process_limits.sh
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_root_crontab.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_root_crontab.sh
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_sg_cluster_config.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_sg_cluster_config.sh
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_sg_cluster_status.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_sg_cluster_status.sh
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_sg_package_config.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_sg_package_config.sh
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_sg_package_status.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_sg_package_status.sh
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_sg_qs_status.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_sg_qs_status.sh
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_vz_ct_counters.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_vz_ct_counters.sh
|
||||
install -D -m 755 opt/hc/lib/platform/linux/check_linux_vz_ct_status.sh ${pkgdir}/opt/hc/lib/platform/linux/check_linux_vz_ct_status.sh
|
||||
install -d -m 755 ${pkgdir}/etc/opt/hc
|
||||
@@ -62,10 +57,6 @@ package() {
|
||||
install -D -m 644 etc/opt/hc/check_linux_ntp_status.conf.dist ${pkgdir}/etc/opt/hc/check_linux_ntp_status.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_linux_process_limits.conf.dist ${pkgdir}/etc/opt/hc/check_linux_process_limits.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_linux_root_crontab.conf.dist ${pkgdir}/etc/opt/hc/check_linux_root_crontab.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_linux_sg_cluster_config.conf.dist ${pkgdir}/etc/opt/hc/check_linux_sg_cluster_config.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_linux_sg_cluster_status.conf.dist ${pkgdir}/etc/opt/hc/check_linux_sg_cluster_status.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_linux_sg_package_config.conf.dist ${pkgdir}/etc/opt/hc/check_linux_sg_package_config.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_linux_sg_package_status.conf.dist ${pkgdir}/etc/opt/hc/check_linux_sg_package_status.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_linux_vz_ct_counters.conf.dist ${pkgdir}/etc/opt/hc/check_linux_vz_ct_counters.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_linux_vz_ct_status.conf.dist ${pkgdir}/etc/opt/hc/check_linux_vz_ct_status.conf.dist
|
||||
install -d -m 755 ${pkgdir}/etc/opt/hc/core
|
||||
|
||||
@@ -49,11 +49,6 @@ cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_hplog.sh $RPM_BUILD_ROOT/opt
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_hpssacli.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_hpssacli.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_process_limits.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_process_limits.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_root_crontab.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_root_crontab.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_sg_cluster_config.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_sg_cluster_config.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_sg_cluster_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_sg_cluster_status.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_sg_package_config.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_sg_package_config.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_sg_package_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_sg_package_status.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_sg_qs_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_sg_qs_status.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_vz_ct_counters.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_vz_ct_counters.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/linux/check_linux_vz_ct_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_vz_ct_status.sh
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/opt/hc
|
||||
@@ -70,10 +65,6 @@ cp ../SOURCES/etc/opt/hc/check_linux_mysqld_status.conf.dist $RPM_BUILD_ROOT/etc
|
||||
cp ../SOURCES/etc/opt/hc/check_linux_ntp_status.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_ntp_status.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_linux_process_limits.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_process_limits.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_linux_root_crontab.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_root_crontab.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_linux_sg_cluster_config.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_sg_cluster_config.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_linux_sg_cluster_status.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_sg_cluster_status.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_linux_sg_package_config.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_sg_package_config.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_linux_sg_package_status.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_sg_package_status.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_linux_vz_ct_counters.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_vz_ct_counters.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_linux_vz_ct_status.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_vz_ct_status.conf.dist
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/opt/hc/core
|
||||
@@ -138,11 +129,6 @@ echo "INFO: finished post-uninstall script"
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_hpssacli.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_process_limits.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_root_crontab.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_sg_cluster_config.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_sg_cluster_status.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_sg_package_config.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_sg_package_status.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_sg_qs_status.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_vz_ct_counters.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_vz_ct_status.sh
|
||||
%dir /etc/opt/hc
|
||||
@@ -159,10 +145,6 @@ echo "INFO: finished post-uninstall script"
|
||||
%attr(644, root, root) /etc/opt/hc/check_linux_ntp_status.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_linux_process_limits.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_linux_root_crontab.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_linux_sg_cluster_config.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_linux_sg_cluster_status.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_linux_sg_package_config.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_linux_sg_package_status.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_linux_vz_ct_counters.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_linux_vz_ct_status.conf.dist
|
||||
%dir /etc/opt/hc/core
|
||||
@@ -171,6 +153,8 @@ echo "INFO: finished post-uninstall script"
|
||||
%attr(644, root, root) /etc/opt/hc/core/templates/mail_body.tpl-check_linux_root_crontab
|
||||
|
||||
%changelog
|
||||
* Sat Apr 20 2019 <patrick@kudos.be> - 0.3.0
|
||||
- Removed Serviceguard plugins
|
||||
* Tue Mar 26 2019 <patrick@kudos.be> - 0.2.0
|
||||
- New git tree organization
|
||||
* Sat Mar 09 2019 <patrick@kudos.be> - 0.1.5
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env ksh
|
||||
#******************************************************************************
|
||||
# @(#) build script for HC SD packages (uses 'swpackage')
|
||||
#******************************************************************************
|
||||
# @(#) Copyright (C) 2014 by KUDOS BVBA (info@kudos.be). All rights reserved.
|
||||
#
|
||||
# This program is a free software; you can redistribute it and/or modify
|
||||
# it under the same terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
|
||||
#******************************************************************************
|
||||
|
||||
#******************************************************************************
|
||||
# Requires following build (dir) structures:
|
||||
#
|
||||
# build/hpux/<build_files>
|
||||
# build/hpux/build_hpux_depots.sh
|
||||
# opt/hc/bin/<hc_scripts>
|
||||
# opt/hc/lib/*/<hc_plugins>
|
||||
# etc/opt/hc/<hc_configs>
|
||||
# depots/
|
||||
#
|
||||
# Build order:
|
||||
# 1) Copy sources/scrips to the correct locations
|
||||
# 2) Copy pristine version of the build spec file to preserver %BUILD_DATE% (.psf)
|
||||
# 3) Copy template, build and installer script files into correct locations
|
||||
# 4) Execute build_hpux_depots.sh
|
||||
# 5) SD packages may be found in the 'depots' directory
|
||||
#******************************************************************************
|
||||
|
||||
BUILD_DATE="$(date +'%Y%m%d')"
|
||||
BUILD_PRETTY_DATE="$(date +'%Y.%m.%d')"
|
||||
BUILD_DIR="$(dirname $0)"
|
||||
|
||||
# clean up previous packages
|
||||
if [[ -d ../../depots ]]
|
||||
then
|
||||
rm -f ../../depots/* 2>/dev/null
|
||||
else
|
||||
mkdir -p ../../depots 2>/dev/null
|
||||
fi
|
||||
|
||||
# see if we have BUILD_DATE placeholder in PSF files
|
||||
find ${BUILD_DIR} -name "*.psf" | while read FILE
|
||||
do
|
||||
if (( $(grep -c '%BUILD_DATE%' ${FILE}) == 0 ))
|
||||
then
|
||||
print -u2 "ERROR: no %BUILD_DATE% placeholder in ${FILE}!"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# replace BUILD_DATE placeholder in PSF files
|
||||
find ${BUILD_DIR} -name "*.psf" | while read FILE
|
||||
do
|
||||
perl -pi -e "s/%BUILD_DATE%/${BUILD_PRETTY_DATE}/g" ${FILE}
|
||||
done
|
||||
|
||||
# build hc_serviceguard_platform package
|
||||
cd ${BUILD_DIR}/hc_serviceguard_platform || exit 1
|
||||
swpackage -s hc_serviceguard_platform.psf -x media_type=tape -d ../../../depots/hc-serviceguard-platform-${BUILD_DATE}.sd
|
||||
cd - || exit 1
|
||||
|
||||
print "List of built packages:"
|
||||
ls -l ../../depots/*
|
||||
|
||||
# when installed on an ignite server: possible addition of depot registration here
|
||||
|
||||
exit 0
|
||||
|
||||
#******************************************************************************
|
||||
# END of script
|
||||
#******************************************************************************
|
||||
@@ -0,0 +1,102 @@
|
||||
# Depot definition:
|
||||
depot
|
||||
layout_version 1.0
|
||||
|
||||
# Vendor definition:
|
||||
vendor
|
||||
tag KUDOS
|
||||
title "KUDOS BVBA - http://www.kudos.be"
|
||||
end
|
||||
|
||||
# Bundle definitions:
|
||||
bundle
|
||||
tag HC-SERVICEGUARD-PLATFORM
|
||||
title "The Health Checker (HC) for UNIX (Serviceguard plugins)"
|
||||
os_name HP-UX
|
||||
revision %BUILD_DATE%
|
||||
architecture HP-UX_B.11_32/64
|
||||
machine_type ia64*
|
||||
vendor_tag KUDOS
|
||||
contents HC-SERVICEGUARD-PLATFORM,r=,a=,v=
|
||||
end
|
||||
|
||||
# Product definitions:
|
||||
product
|
||||
tag HC-SERVICEGUARD-PLATFORM
|
||||
revision %BUILD_DATE%
|
||||
category tools
|
||||
category_title Tools
|
||||
title "The Health Checker (HC) for UNIX (Serviceguard plugins)"
|
||||
description "The Health Checker is collection of scripts (plugins)
|
||||
designed to perform regular - but not intensive - health checks on
|
||||
UNIX/Linux systems. It provides plugins for AIX, HP-UX and Linux as
|
||||
well customer specific checks. Checks may include topics such file
|
||||
system mounts, process checks, file consistency etc.
|
||||
This is the OS/platform plugin package"
|
||||
architecture S700/S800_HP-UX_10/HP-UX_11/IA64_HP-UX_11
|
||||
machine_type 9000/7*|9000/8*|ia64*
|
||||
os_name HP-UX
|
||||
os_release ?.1?.*
|
||||
os_version [A-Z]
|
||||
directory /opt/hc
|
||||
is_locatable false
|
||||
is_patch false
|
||||
|
||||
postinstall scripts/hc_serviceguard_platform.postinstall
|
||||
postremove scripts/hc_serviceguard_platform.postremove
|
||||
|
||||
# Fileset definitions:
|
||||
fileset
|
||||
tag plugins
|
||||
title UX Health Checker (Serviceguard plugins)
|
||||
is_kernel false
|
||||
is_locatable false
|
||||
is_reboot false
|
||||
is_sparse false
|
||||
is_patch false
|
||||
prerequisite HC-HPUX-MAIN
|
||||
|
||||
file_permissions -u 0222 -o root -g sys
|
||||
|
||||
directory ../../../opt/hc/lib/platform/serviceguard=/opt/hc/lib/platform/serviceguard
|
||||
file -m 755 check_serviceguard_package_status.sh
|
||||
file -m 755 check_serviceguard_package_config.sh
|
||||
file -m 755 check_serviceguard_cluster_status.sh
|
||||
file -m 755 check_serviceguard_cluster_config.sh
|
||||
file -m 755 check_serviceguard_qs_status.sh
|
||||
end
|
||||
|
||||
fileset
|
||||
tag config
|
||||
title UX Health Checker (Serviceguard plugins: configuration)
|
||||
is_kernel false
|
||||
is_locatable false
|
||||
is_reboot false
|
||||
is_sparse false
|
||||
is_patch false
|
||||
prerequisite HC-SERVICEGUARD-PLATFORM.plugins
|
||||
|
||||
file_permissions -u 0222 -o root -g sys
|
||||
|
||||
directory ../../../etc/opt/hc/=/etc/opt/hc
|
||||
file -m 644 check_serviceguard_package_status.conf.dist
|
||||
file -m 644 check_serviceguard_package_config.conf.dist
|
||||
file -m 644 check_serviceguard_cluster_status.conf.dist
|
||||
file -m 644 check_serviceguard_cluster_config.conf.dist
|
||||
end
|
||||
|
||||
fileset
|
||||
tag templates
|
||||
title UX Health Checker (OS/Platform plugins: templates)
|
||||
is_kernel false
|
||||
is_locatable false
|
||||
is_reboot false
|
||||
is_sparse false
|
||||
is_patch false
|
||||
prerequisite HC-SERVICEGUARD-PLATFORM.plugins
|
||||
|
||||
file_permissions -u 0222 -o root -g sys
|
||||
|
||||
directory ../../../etc/opt/hc/core/templates=/etc/opt/hc/core/templates
|
||||
end
|
||||
end
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env ksh
|
||||
#******************************************************************************
|
||||
# @(#) post-install script for HC-SERVICEGUARD-PLATFORM SD package
|
||||
#******************************************************************************
|
||||
# @(#) Copyright (C) 2014 by KUDOS BVBA (info@kudos.be). All rights reserved.
|
||||
#
|
||||
# This program is a free software; you can redistribute it and/or modify
|
||||
# it under the same terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
|
||||
#******************************************************************************
|
||||
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
print "INFO: starting post-install script ..."
|
||||
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks || print -u2 "WARN: updating symlinks failed"
|
||||
else
|
||||
print -u2 "ERROR: could not locate or excute the HC main script (${HC_BIN})"
|
||||
fi
|
||||
|
||||
print "INFO: finished post-install script"
|
||||
|
||||
exit 0
|
||||
|
||||
#******************************************************************************
|
||||
# END of script
|
||||
#******************************************************************************
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env ksh
|
||||
#******************************************************************************
|
||||
# @(#) post-remove script for HC-PLATFORM SD package
|
||||
#******************************************************************************
|
||||
# @(#) Copyright (C) 2014 by KUDOS BVBA (info@kudos.be). All rights reserved.
|
||||
#
|
||||
# This program is a free software; you can redistribute it and/or modify
|
||||
# it under the same terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
|
||||
#******************************************************************************
|
||||
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
print "INFO: starting post-remove script ..."
|
||||
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks || print -u2 "WARN: updating symlinks failed"
|
||||
else
|
||||
print -u2 "ERROR: could not locate or excute the HC main script (${HC_BIN})"
|
||||
fi
|
||||
|
||||
print "INFO: finished post-remove script"
|
||||
|
||||
exit 0
|
||||
|
||||
#******************************************************************************
|
||||
# END of script
|
||||
#******************************************************************************
|
||||
@@ -0,0 +1,33 @@
|
||||
# -- post-install --
|
||||
post_install() {
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-install script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-install script"
|
||||
}
|
||||
|
||||
# -- post-remove --
|
||||
post_remove() {
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-uninstall script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-uninstall script"
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
# Maintainer: Patrick Van der Veken <patrick@kudos.be>
|
||||
|
||||
_pkgname="check_health"
|
||||
pkgname="hc-serviceguard-platform"
|
||||
pkgver="%BUILD_DATE%"
|
||||
pkgrel=1
|
||||
pkgdesc="The KUDOS Health Checker (HC) for UNIX (Serviceguard plugins)"
|
||||
arch=("any")
|
||||
url="https://github.com/patvdv/${_pkgname}"
|
||||
license=('GPL3')
|
||||
makedepends=('git')
|
||||
depends=('hc-linux')
|
||||
source=("${_pkgname}::git+${url}.git#branch=master")
|
||||
install=".install"
|
||||
sha256sums=('SKIP')
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/${_pkgname}"
|
||||
install -d -m 755 ${pkgdir}/opt/hc/lib
|
||||
install -d -m 755 ${pkgdir}/opt/hc/lib/platform
|
||||
install -d -m 755 ${pkgdir}/opt/hc/lib/platform/serviceguard
|
||||
install -D -m 755 opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_config.sh ${pkgdir}/opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_config.sh
|
||||
install -D -m 755 opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_status.sh ${pkgdir}/opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_status.sh
|
||||
install -D -m 755 opt/hc/lib/platform/serviceguard/check_serviceguard_package_config.sh ${pkgdir}/opt/hc/lib/platform/serviceguard/check_serviceguard_package_config.sh
|
||||
install -D -m 755 opt/hc/lib/platform/serviceguard/check_serviceguard_package_status.sh ${pkgdir}/opt/hc/lib/platform/serviceguard/check_serviceguard_package_status.sh
|
||||
install -D -m 755 opt/hc/lib/platform/serviceguard/check_serviceguard_qs_status.sh ${pkgdir}/opt/hc/lib/platform/serviceguard/check_serviceguard_qs_status.sh
|
||||
install -d -m 755 ${pkgdir}/etc/opt/hc
|
||||
install -D -m 644 etc/opt/hc/check_serviceguard_cluster_config.conf.dist ${pkgdir}/etc/opt/hc/check_serviceguard_cluster_config.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_serviceguard_cluster_status.conf.dist ${pkgdir}/etc/opt/hc/check_serviceguard_cluster_status.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_serviceguard_package_config.conf.dist ${pkgdir}/etc/opt/hc/check_serviceguard_package_config.conf.dist
|
||||
install -D -m 644 etc/opt/hc/check_serviceguard_package_status.conf.dist ${pkgdir}/etc/opt/hc/check_serviceguard_package_status.conf.dist
|
||||
install -d -m 755 ${pkgdir}/etc/opt/hc/core
|
||||
install -d -m 755 ${pkgdir}/etc/opt/hc/core/templates
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
Package: hc-serviceguard-platform
|
||||
Version: %BUILD_DATE%
|
||||
Architecture: all
|
||||
Maintainer: Patrick Van der Veken <patrick@kudos.be>
|
||||
Essential: no
|
||||
Installed-Size: 300
|
||||
Depends: hc-linux
|
||||
Section: tools
|
||||
Priority: extra
|
||||
Description: The KUDOS Health Checker (HC) for UNIX (Serviceguard plugins).
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-install script ..."
|
||||
# debian: reset ownerships
|
||||
chown -R root:root /opt/hc /etc/opt/hc 2>/dev/null
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-install script"
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-uninstall script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-uninstall script"
|
||||
@@ -0,0 +1,93 @@
|
||||
%define build_timestamp %(date +"%Y%m%d")
|
||||
|
||||
Name: hc-serviceguard-platform
|
||||
Version: %{build_timestamp}
|
||||
Release: 1
|
||||
|
||||
Summary: The KUDOS Health Checker (HC) for UNIX (Serviceguard plugins)
|
||||
Group: Tools/Monitoring
|
||||
|
||||
License: GNU General Public License either version 2 of the License, or (at your option) any later version
|
||||
URL: http://www.kudos.be
|
||||
|
||||
Requires: ksh,hc-linux
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_topdir}/%{name}-%{version}-root
|
||||
|
||||
%description
|
||||
The Health Checker is collection of scripts (plugins) designed to perform regular - but not intensive - health checks on UNIX/Linux systems. It provides plugins for AIX, HP-UX and Linux as well customer specific checks. Checks may include topics such file system mounts, process checks, file consistency etc.
|
||||
This package contains Serviceguard platform specific plugins.
|
||||
|
||||
%prep
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
install -d -m 755 $RPM_BUILD_ROOT/opt/hc/lib
|
||||
install -d -m 755 $RPM_BUILD_ROOT/opt/hc/lib/platform
|
||||
install -d -m 755 $RPM_BUILD_ROOT/opt/hc/lib/platform/serviceguard
|
||||
cp ../SOURCES/opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_config.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_config.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_status.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/serviceguard/check_serviceguard_package_config.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/serviceguard/check_serviceguard_package_config.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/serviceguard/check_serviceguard_package_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/serviceguard/check_serviceguard_package_status.sh
|
||||
cp ../SOURCES/opt/hc/lib/platform/serviceguard/check_serviceguard_qs_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/serviceguard/check_serviceguard_qs_status.sh
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/opt/hc
|
||||
cp ../SOURCES/etc/opt/hc/check_serviceguard_cluster_config.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_serviceguard_cluster_config.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_serviceguard_cluster_status.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_serviceguard_cluster_status.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_serviceguard_package_config.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_serviceguard_package_config.conf.dist
|
||||
cp ../SOURCES/etc/opt/hc/check_serviceguard_package_status.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_serviceguard_package_status.conf.dist
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/opt/hc/core
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/opt/hc/core/templates
|
||||
|
||||
%post
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-install script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-install script"
|
||||
|
||||
%postun
|
||||
# ------------------------- CONFIGURATION starts here -------------------------
|
||||
# location of check_health.sh
|
||||
HC_BIN="/opt/hc/bin/check_health.sh"
|
||||
PATH="$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
echo "INFO: starting post-uninstall script ..."
|
||||
# refresh symbolic FPATH links
|
||||
if [[ -x ${HC_BIN} ]]
|
||||
then
|
||||
${HC_BIN} --fix-symlinks
|
||||
(( $? == 0 )) || echo "WARN: updating symlinks failed"
|
||||
fi
|
||||
echo "INFO: finished post-uninstall script"
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,755)
|
||||
%dir /opt/hc/lib
|
||||
%dir /opt/hc/lib/platform
|
||||
%dir /opt/hc/lib/platform/serviceguard
|
||||
%attr(755, root, root) /opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_config.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/serviceguard/check_serviceguard_cluster_status.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/serviceguard/check_serviceguard_package_config.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/serviceguard/check_serviceguard_package_status.sh
|
||||
%attr(755, root, root) /opt/hc/lib/platform/serviceguard/check_serviceguard_qs_status.sh
|
||||
%dir /etc/opt/hc
|
||||
%attr(644, root, root) /etc/opt/hc/check_serviceguard_cluster_config.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_serviceguard_cluster_status.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_serviceguard_package_config.conf.dist
|
||||
%attr(644, root, root) /etc/opt/hc/check_serviceguard_package_status.conf.dist
|
||||
%dir /etc/opt/hc/core
|
||||
%dir /etc/opt/hc/core/templates
|
||||
|
||||
%changelog
|
||||
* Sa Apr 20 2019 <patrick@kudos.be> - 0.0.1
|
||||
- Initial build
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env ksh
|
||||
#******************************************************************************
|
||||
# @(#) build script for HC RPM packages (uses 'rpmbuild')
|
||||
#******************************************************************************
|
||||
# @(#) Copyright (C) 2014 by KUDOS BVBA (info@kudos.be). All rights reserved.
|
||||
#
|
||||
# This program is a free software; you can redistribute it and/or modify
|
||||
# it under the same terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
|
||||
#******************************************************************************
|
||||
|
||||
#******************************************************************************
|
||||
# Requires following build (dir) structures:
|
||||
#
|
||||
# hc_build_linux_rpms.sh
|
||||
# BUILD/
|
||||
# BUILDROOT/
|
||||
# RPMS/
|
||||
# SOURCES/opt/
|
||||
# SOURCES/opt/hc/bin/<hc_scripts>
|
||||
# SOURCES/opt/hc/lib/*/<hc_plugins>
|
||||
# SOURCES/etc/opt/hc/<hc_configs>
|
||||
# SPECS/<spec_files>
|
||||
# SRPMS/
|
||||
#
|
||||
# Build order:
|
||||
# 1) Copy sources/scripts to the correct locations
|
||||
# 2) Copy template, build and installer script files into correct locations
|
||||
# 3) Execute hc_build_linux_rpms.sh
|
||||
# 4) RPM packages may be found in the RPMS directory
|
||||
#******************************************************************************
|
||||
|
||||
BUILD_DIR="$(dirname $0)"
|
||||
|
||||
# clean up previous packages
|
||||
rm -f ${BUILD_DIR}/RPMS/*/* >/dev/null
|
||||
|
||||
# build main packages
|
||||
rpmbuild -bb ${BUILD_DIR}/SPECS/hc-serviceguard-platform.spec
|
||||
|
||||
print "List of built packages:"
|
||||
ls -l ${BUILD_DIR}/RPMS/*/*
|
||||
|
||||
exit 0
|
||||
|
||||
#******************************************************************************
|
||||
# END of script
|
||||
#******************************************************************************
|
||||
Reference in New Issue
Block a user