From d21e7de16c6c4442731d8810bd374c9c09abbf25 Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Tue, 19 Dec 2017 13:55:46 +0100 Subject: [PATCH] Added build files for zenoss plugin --- .../hc_display_zenoss/hc_display_zenoss.reqs | 1 + .../hc_display_zenoss.template | 27 ++++++++ .../scripts/hc_display_zenoss.postinstall | 41 +++++++++++ .../scripts/hc_display_zenoss.postuninstall | 41 +++++++++++ .../hc_display_zenoss/hc_display_zenoss.psf | 64 +++++++++++++++++ .../scripts/hc_display_zenoss.postinstall | 41 +++++++++++ .../scripts/hc_display_zenoss.postremove | 41 +++++++++++ build/linux/SPECS/hc-display-zenoss.spec | 69 +++++++++++++++++++ 8 files changed, 325 insertions(+) create mode 100644 build/aix/hc_display_zenoss/hc_display_zenoss.reqs create mode 100644 build/aix/hc_display_zenoss/hc_display_zenoss.template create mode 100644 build/aix/hc_display_zenoss/scripts/hc_display_zenoss.postinstall create mode 100644 build/aix/hc_display_zenoss/scripts/hc_display_zenoss.postuninstall create mode 100644 build/hpux/hc_display_zenoss/hc_display_zenoss.psf create mode 100644 build/hpux/hc_display_zenoss/scripts/hc_display_zenoss.postinstall create mode 100644 build/hpux/hc_display_zenoss/scripts/hc_display_zenoss.postremove create mode 100644 build/linux/SPECS/hc-display-zenoss.spec diff --git a/build/aix/hc_display_zenoss/hc_display_zenoss.reqs b/build/aix/hc_display_zenoss/hc_display_zenoss.reqs new file mode 100644 index 0000000..f90fa90 --- /dev/null +++ b/build/aix/hc_display_zenoss/hc_display_zenoss.reqs @@ -0,0 +1 @@ +*prereq hc_aix.rte diff --git a/build/aix/hc_display_zenoss/hc_display_zenoss.template b/build/aix/hc_display_zenoss/hc_display_zenoss.template new file mode 100644 index 0000000..96d3a87 --- /dev/null +++ b/build/aix/hc_display_zenoss/hc_display_zenoss.template @@ -0,0 +1,27 @@ +Package Name: hc_display_zenoss +Package VRMF: %BUILD_DATE% +Update: N +Fileset + Fileset Name: hc_display_zenoss.rte + Fileset VRMF: %BUILD_DATE% + Fileset Description: Health Checker - core CSV plugin + USRLIBLPPFiles + EOUSRLIBLPPFiles + ROOTLIBLPPFiles + Post-installation Script: /export/nim/build/hc_display_zenoss/scripts/hc_display_zenoss.postinstall + Unpost-installation Script: /export/nim/build/hc_display_zenoss/scripts/hc_display_zenoss.postuninstall + EOROOTLIBLPPFiles + Bosboot required: N + License agreement acceptance required: N + Include license files in this package: N + Requisites: /export/nim/build/hc_display_zenoss/hc_display_zenoss.reqs + USRFiles + EOUSRFiles + ROOT Part: Y + ROOTFiles +/opt/hc/lib +/opt/hc/lib/core +/opt/hc/lib/platform/aix/display_zenoss.sh + EOROOTFiles + Relocatable: N +EOFileset diff --git a/build/aix/hc_display_zenoss/scripts/hc_display_zenoss.postinstall b/build/aix/hc_display_zenoss/scripts/hc_display_zenoss.postinstall new file mode 100644 index 0000000..2af0177 --- /dev/null +++ b/build/aix/hc_display_zenoss/scripts/hc_display_zenoss.postinstall @@ -0,0 +1,41 @@ +#!/usr/bin/env ksh +#****************************************************************************** +# @(#) post-install script for hc_display_zenoss LPP package +#****************************************************************************** +# @(#) Copyright (C) 2017 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 ETC dir +HC_ETC_DIR="/etc/opt/hc" +# 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 +#****************************************************************************** diff --git a/build/aix/hc_display_zenoss/scripts/hc_display_zenoss.postuninstall b/build/aix/hc_display_zenoss/scripts/hc_display_zenoss.postuninstall new file mode 100644 index 0000000..77c7f62 --- /dev/null +++ b/build/aix/hc_display_zenoss/scripts/hc_display_zenoss.postuninstall @@ -0,0 +1,41 @@ +#!/usr/bin/env ksh +#****************************************************************************** +# @(#) post-uninstall script for hc_display_zenoss LPP package +#****************************************************************************** +# @(#) Copyright (C) 2017 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 the HC configuration files +HC_ETC_DIR="/etc/opt/hc" +# 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-uninstall 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-uninstall script" + +exit 0 + +#****************************************************************************** +# END of script +#****************************************************************************** diff --git a/build/hpux/hc_display_zenoss/hc_display_zenoss.psf b/build/hpux/hc_display_zenoss/hc_display_zenoss.psf new file mode 100644 index 0000000..37a3f88 --- /dev/null +++ b/build/hpux/hc_display_zenoss/hc_display_zenoss.psf @@ -0,0 +1,64 @@ +# 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-DISPLAY-ZENOSS + title "The Health Checker (HC) for UNIX (core ZENOSS display plugin)" + os_name HP-UX + revision %BUILD_DATE% + architecture HP-UX_B.11_32/64 + machine_type ia64* + vendor_tag KUDOS + contents HC-DISPLAY-ZENOSS-MAIN,r=,a=,v= +end + +# Product definitions: +product + tag HC-DISPLAY-ZENOSS-MAIN + revision %BUILD_DATE% + category tools + category_title Tools + title "The Health Checker (HC) for UNIX (OS 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 core ZENOSS display 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_display_zenoss.postinstall + postremove scripts/hc_display_zenoss.postremove + + # Fileset definitions: + fileset + tag core_plugins + title UX Health Checker (core ZENOSS display 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 ../../sources/lib/core=/opt/hc/lib/core + file -m 755 display_zenoss.sh + end +end diff --git a/build/hpux/hc_display_zenoss/scripts/hc_display_zenoss.postinstall b/build/hpux/hc_display_zenoss/scripts/hc_display_zenoss.postinstall new file mode 100644 index 0000000..24bcc91 --- /dev/null +++ b/build/hpux/hc_display_zenoss/scripts/hc_display_zenoss.postinstall @@ -0,0 +1,41 @@ +#!/usr/bin/env ksh +#****************************************************************************** +# @(#) post-install script for HC-DISPLAY-ZENOSS SD package +#****************************************************************************** +# @(#) Copyright (C) 2017 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 ETC dir +HC_ETC_DIR="/etc/opt/hc" +# 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 +#****************************************************************************** diff --git a/build/hpux/hc_display_zenoss/scripts/hc_display_zenoss.postremove b/build/hpux/hc_display_zenoss/scripts/hc_display_zenoss.postremove new file mode 100644 index 0000000..1c2b9c0 --- /dev/null +++ b/build/hpux/hc_display_zenoss/scripts/hc_display_zenoss.postremove @@ -0,0 +1,41 @@ +#!/usr/bin/env ksh +#****************************************************************************** +# @(#) post-remove script for HC-DISPLAY-ZENOSS SD package +#****************************************************************************** +# @(#) Copyright (C) 2017 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 the HC configuration files +HC_ETC_DIR="/etc/opt/hc" +# 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 +#****************************************************************************** diff --git a/build/linux/SPECS/hc-display-zenoss.spec b/build/linux/SPECS/hc-display-zenoss.spec new file mode 100644 index 0000000..c62d9ba --- /dev/null +++ b/build/linux/SPECS/hc-display-zenoss.spec @@ -0,0 +1,69 @@ +%define build_timestamp %(date +"%Y%m%d") + +Name: hc-display-zenoss +Version: %{build_timestamp} +Release: 1 + +Summary: The KUDOS Health Checker (HC) for UNIX (ZENOSS display core plugin) +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 core plugins (display). + +%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/core +cp ../SOURCES/lib/core/display_zenoss.sh $RPM_BUILD_ROOT/opt/hc/lib/core/display_zenoss.sh + +%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/core +%attr(755, root, root) /opt/hc/lib/core/display_zenoss.sh + +%changelog +* Tue Dec 19 2017 - 0.0.1 +- Initial build