catalog/INDEX010064400000000000003000000014060774770636200131420ustar00rootsys00000000000000distribution layout_version 1.0 data_model_revision 2.40 uuid 0ff3cfea-09f5-11d8-a463-0800095405f7 mod_time 1067420914 create_time 1067420914 path_max 255 name_max 100 media sequence_number 1 product tag scc data_model_revision 2.40 instance_id 1 control_directory scc revision 1.4.28 title "System Configuration Collector" description "System Configuration Collector" mod_time 1067420914 create_time 1067420914 machine_type 9000/* os_name HP-UX os_release ?.1?.* directory / all_filesets scc-run is_locatable false fileset tag scc-run data_model_revision 2.40 instance_id 1 control_directory scc-run size 393865 revision 1.4.28 title "System Configuration Collector" description "System Configuration Collector" mod_time 1067420914 create_time 1067420914 state available catalog/dfiles/INDEX010064400000000000003000000003010774770636200144010ustar00rootsys00000000000000distribution layout_version 1.0 data_model_revision 2.40 uuid 0ff3cfea-09f5-11d8-a463-0800095405f7 mod_time 1067420914 create_time 1067420914 path_max 255 name_max 100 media sequence_number 1 catalog/dfiles/INFO010064400000000000003000000002120774770636200142660ustar00rootsys00000000000000control_file path INDEX size 193 mode 0444 mtime 1067420914 tag INDEX control_file path INFO size 198 mode 0444 mtime 1067420914 tag INFO catalog/scc/pfiles/INDEX010044400000000000003000000005050774770636200151710ustar00rootsys00000000000000product tag scc data_model_revision 2.40 instance_id 1 control_directory scc revision 1.4.28 title "System Configuration Collector" description "System Configuration Collector" mod_time 1067420914 create_time 1067420914 machine_type 9000/* os_name HP-UX os_release ?.1?.* directory / all_filesets scc-run is_locatable false catalog/scc/pfiles/INFO010044400000000000003000000002120774770636200150500ustar00rootsys00000000000000control_file path INDEX size 325 mode 0444 mtime 1067420914 tag INDEX control_file path INFO size 198 mode 0444 mtime 1067420914 tag INFO catalog/scc/scc-run/INDEX010044400000000000003000000004000774770636200152530ustar00rootsys00000000000000fileset tag scc-run data_model_revision 2.40 instance_id 1 control_directory scc-run size 393865 revision 1.4.28 title "System Configuration Collector" description "System Configuration Collector" mod_time 1067420914 create_time 1067420914 state available catalog/scc/scc-run/INFO010044400000000000003000000152760774770636200151600ustar00rootsys00000000000000control_file path INDEX size 256 mode 0444 mtime 1067420914 tag INDEX control_file path INFO size 6905 mode 0444 mtime 1067420914 tag INFO control_file path postinstall size 2263 cksum 180442244 mode 0544 mtime 1067417688 tag postinstall control_file path preinstall size 2544 cksum 2607512823 mode 0544 mtime 1067417688 tag preinstall control_file path preremove size 1219 cksum 46038497 mode 0544 mtime 1067417688 tag preremove file path /etc/opt type d mode 0700 uid 0 gid 3 owner root group sys file path /etc/opt/scc type d mode 0700 uid 0 gid 3 owner root group sys file path /etc/opt/scc/conf type d mode 0700 uid 0 gid 3 owner root group sys file path /etc/opt/scc/newconfig type d mode 0700 uid 0 gid 3 owner root group sys file path /etc/opt/scc/newconfig/scc-localize type f size 4383 cksum 4047506302 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt type d mode 0700 uid 0 gid 3 owner root group sys file path /opt/scc type d mode 0700 uid 0 gid 3 owner root group sys file path /opt/scc/bin type d mode 0700 uid 0 gid 3 owner root group sys file path /opt/scc/bin/scc type f size 8918 cksum 4027332031 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc-collect type f size 7340 cksum 1351989096 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc-log type f size 12696 cksum 552444196 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc-log2html type f size 6253 cksum 562076797 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc-plugin type f size 2705 cksum 299222512 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc-snap2html type f size 13836 cksum 153046701 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc_modules type d mode 0700 uid 0 gid 3 owner root group sys file path /opt/scc/bin/scc_modules/scc_0000_s_general type f size 7312 cksum 3375258262 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc_modules/scc_0100_s_boot type f size 5032 cksum 3639889149 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc_modules/scc_0200_s_hardware type f size 20262 cksum 1961216461 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc_modules/scc_0300_s_kernel type f size 4977 cksum 3928146695 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc_modules/scc_0400_s_vol_mngt type f size 27512 cksum 3318295013 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417687 file path /opt/scc/bin/scc_modules/scc_0500_s_network type f size 17697 cksum 3650845151 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/bin/scc_modules/scc_0600_s_software type f size 27459 cksum 3087934791 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/bin/scc_modules/scc_0700_s_hp_ov type f size 12361 cksum 351045263 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/bin/scc_modules/scc_0700_u_hp_ovou_srv type f size 81242 cksum 2567450926 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/bin/scc_modules/scc_0800_s_oracle type f size 4983 cksum 3651290131 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/bin/scc_modules/scc_0900_s_system type f size 6576 cksum 908007348 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/bin/scc_modules/scc_1000_s_users type f size 5785 cksum 1524903558 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/bin/scc_modules/scc_utils type f size 6658 cksum 4219118283 mode 0500 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/doc type d mode 0700 uid 0 gid 3 owner root group sys file path /opt/scc/doc/COPYING type f size 18009 cksum 3111790264 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/doc/scc-4.html type f size 6097 cksum 781750196 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/doc/scc-5.html type f size 6835 cksum 1356568251 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/doc/scc-collect.html type f size 7608 cksum 1073422600 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/doc/scc-log.html type f size 6782 cksum 2677096677 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/doc/scc-log2html.html type f size 2018 cksum 3889210973 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/doc/scc-plugin.html type f size 2654 cksum 502448658 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/doc/scc-snap2html.html type f size 2059 cksum 3257721496 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/doc/scc.html type f size 10065 cksum 895412654 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/man type d mode 0700 uid 0 gid 3 owner root group sys file path /opt/scc/man/man1 type d mode 0700 uid 0 gid 3 owner root group sys file path /opt/scc/man/man1/scc-collect.1 type f size 5891 cksum 3035377291 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/man/man1/scc-log.1 type f size 5255 cksum 1364163693 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/man/man1/scc-log2html.1 type f size 1249 cksum 2846033396 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/man/man1/scc-plugin.1 type f size 1820 cksum 2517974153 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/man/man1/scc-snap2html.1 type f size 1289 cksum 1720323093 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/man/man1/scc.1 type f size 7725 cksum 3966723653 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/man/man4 type d mode 0700 uid 0 gid 3 owner root group sys file path /opt/scc/man/man4/scc.4 type f size 5362 cksum 2156960487 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /opt/scc/man/man5 type d mode 0700 uid 0 gid 3 owner root group sys file path /opt/scc/man/man5/scc.5 type f size 5973 cksum 2355543965 mode 0400 uid 0 gid 3 owner root group sys mtime 1067417688 file path /var/opt type d mode 0700 uid 0 gid 3 owner root group sys file path /var/opt/scc type d mode 0700 uid 0 gid 3 owner root group sys file path /var/opt/scc/data type d mode 0700 uid 0 gid 3 owner root group sys file path /var/opt/scc/data/plugin_data type d mode 0700 uid 0 gid 3 owner root group sys file path /var/opt/scc/tmp type d mode 0700 uid 0 gid 3 owner root group sys catalog/scc/scc-run/postinstall010054400000000000003000000043270774770013000167600ustar00rootsys00000000000000#!/bin/sh # Shell script to run after the install of the SCC software. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.18 $ SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP SCC_DATA=${SCC_TOP}/data SCC_TMP=${SCC_TOP}/tmp SCC_CONF=/etc/opt/scc/conf export SCC_DATA SCC_TMP SCC_CONF umask 077 # Just before the install we run the current version to detect any changes # in the configuration of the system. After the install we remove the current # snapshot to avoid comparison of the snapshots. This enables us to change # the format of the snapshots without flooding the logfiles with differences. name=`uname -n | sed -e 's/\..*//'` if [ ! -f ${SCC_DATA}/scc.${name}.lock -a ! -f ${SCC_DATA}/scc.${name}.install ] then echo "WARNING: Lock- and or install-file do not exist during install." exit 2 fi # Remove current snapshot and create new snapshot. echo "NOTE: Running scc to create a snapshot with the new version" echo "NOTE: of the software. This may take some minutes." # During installs on HP-UX, stm often hangs; do not run it. SCC_IGNORE_STM="yes"; export SCC_IGNORE_STM # During installs, rpm is locked; indicate the installation phase: SCC_INSTALL_PHASE="postinstall"; export SCC_INSTALL_PHASE rm -f ${SCC_DATA}/scc.${name}.lock ${SCC_DATA}/scc.${name}.install ${SCC_BIN}/scc-log -c "install of SCC release 1.4.28" -r echo "NOTE: The snapshot and logbook can be found in ${SCC_DATA}" exit 0 catalog/scc/scc-run/preinstall010054400000000000003000000047600774770013000165620ustar00rootsys00000000000000#!/bin/sh # Shell script to run before the install of the SCC software. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.24 $ SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP SCC_DATA=${SCC_TOP}/data SCC_TMP=${SCC_TOP}/tmp SCC_CONF=/etc/opt/scc/conf export SCC_DATA SCC_TMP SCC_CONF umask 077 mkdir -p ${SCC_DATA} ${SCC_TMP} 2>/dev/null name=`uname -n | sed -e 's/\..*//'` # Just before the install we run the current version to detect any changes # in the configuration of the system. After the install we remove the current # snapshot to avoid comparison of the snapshots. This enables us to change # the format of the snapshots without flooding the logfiles with differences. if [ -x ${SCC_BIN}/scc-log ] then echo "NOTE: Running scc to create a snapshot with the current" echo "NOTE: version of the software. This may take some minutes." if [ -f ${SCC_DATA}/scc.${name}.lock ] then echo "ERROR: install aborted, another instance of scc" echo "ERROR: is active." exit 2 else # During installs on HP-UX stm often hangs; do not run it. SCC_IGNORE_STM="yes"; export SCC_IGNORE_STM # During installs, rpm is locked; indicate the installation phase: SCC_INSTALL_PHASE="preinstall"; export SCC_INSTALL_PHASE ${SCC_BIN}/scc-log fi fi # Avoid that scc is started between the pre- and the post-install. # We create the lock-file for scc-log together with a file indicating to # the postinstall that the install is running. touch ${SCC_DATA}/scc.${name}.lock ${SCC_DATA}/scc.${name}.install # The new release can have fewer system modules. Remove all system modules # before we install the new modules. rm -f ${SCC_BIN}/scc_modules/scc_[0-9][0-9][0-9][0-9]_s_* exit 0 catalog/scc/scc-run/preremove010054400000000000003000000023030774770013000164000ustar00rootsys00000000000000#!/bin/sh # Shell script to run before removing the SCC software. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.14 $ SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP SCC_DATA=${SCC_TOP}/data SCC_TMP=${SCC_TOP}/tmp SCC_CONF=/etc/opt/scc/conf export SCC_DATA SCC_TMP SCC_CONF umask 077 if [ -x ${SCC_BIN}/scc-log ] then # Remove all datafiles. ${SCC_BIN}/scc-log -u fi exit 0 scc/scc-run/etc/opt/004070000000000000003000000000003777777777700144555ustar00rootsys00000000000000scc/scc-run/etc/opt/scc/004070000000000000003000000000003777777777700152255ustar00rootsys00000000000000scc/scc-run/etc/opt/scc/conf/004070000000000000003000000000003777777777700161525ustar00rootsys00000000000000scc/scc-run/etc/opt/scc/newconfig/004070000000000000003000000000003777777777700172045ustar00rootsys00000000000000scc/scc-run/etc/opt/scc/newconfig/scc-localize010050000000000000003000000104370774770013000214350ustar00rootsys00000000000000#!/bin/sh # Shell script to customize the collection of data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.5 $ # Purpose of this file: # scc-collect and its modules use sensible defaults to avoid that # many systems require a configuration file. When the defaults are # insufficient, copy /etc/opt/scc/newconfig/scc-localize # to /etc/opt/scc/conf/scc-localize and uncomment the required variables. # Be sure to preserve the execution permission of the file. ############################################################################## # General variables ############################################################################## # To add timing info to the snapshot (under class "var:profiling::") # uncomment the following line: # export SCC_PROFILING=yes ############################################################################## # Variables for Oracle ############################################################################## # The default location for the oratab file is /etc/oratab. Uncomment # the ORATAB variable if this file is in another location. # export ORATAB=/etc/oratab # Usually the Oracle commands (svrmgrl / sqlplus) can be executed with # a su -c command, without using the .profile. ORACLE_SID and ORACLE_HOME # are set anyway before calling su, so the .profile is not needed for that. # However, sometimes critical settings and commands for for example memory # windows are executed by the .profile, and in this case ORA_USE_PROFILE # must be set to 1. If so, make sure the .profile for the oracle user does # not contain TTY setting commands and the like if executed by su. # export ORA_USE_PROFILE=0 # Usually the SQL*Net config files are located in either /etc, # $ORACLE_HOME/network/admin, or both, but if they are located elsewhere, # use TNS_ADMIN to specify that location # export TNS_ADMIN= # By default all Oracle users are listed. To suppres this, set ORA_LIST_USERS # to 0 # export ORA_LIST_USERS=1 ############################################################################## # Variables for hardware chapter ############################################################################## # With ioscan on HP-UX, detached hardware gets the state NO_HW. In some # circumstances this should be ignored, for example on a SAN with BC / BCV / # snapshot functionality. If so, set IGNORE_NO_HW to 1. # export IGNORE_NO_HW=1 # On some systems, (unpatched versions of) stm often hang. When upgrading # cannot be done immediately, set the following variable to ignore stm. As the # stm-data is variable in the snapshot, it does not matter for the logboook. # export SCC_IGNORE_STM=yes # EMC Symmetrix command line interface (SymCLI) can be installed in user- # specified directories. If SymCLI is available and is not installed in # /usr/symcli, specify the bin path in the the variable SYMCLI # export SYMCLI=/usr/symcli/bin ############################################################################## # Variables for OV Operations manager user-module ############################################################################## # By default the plug-in creates a configuration download. If this is # already done automatically (for backup purposes) the download # can be disabled by setting OPCDWN to 0. # export OPCDWN=1 # By default the following directory is used for configuration downloads: # ${SCC_TMP}/opcsplit. If a download should be used from a different location, # set the OPCDWN_DIR directory to that path. # export OPCDWN_DIR= # Do not exit, as this script is sourced. scc/scc-run/opt/004070000000000000003000000000003777777777700137025ustar00rootsys00000000000000scc/scc-run/opt/scc/004070000000000000003000000000003777777777700144525ustar00rootsys00000000000000scc/scc-run/opt/scc/bin/004070000000000000003000000000003777777777700152225ustar00rootsys00000000000000scc/scc-run/opt/scc/bin/scc010050000000000000003000000213260774770012700156600ustar00rootsys00000000000000#!/bin/sh # Shell script to collect and send configuration data for SCC. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.44 $ ProgName=${0##*/}; export ProgName SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP export SCC_DATA=${SCC_TOP}/data export SCC_TMP=${SCC_TOP}/tmp export SCC_CONF=/etc/opt/scc/conf export TMPDIR=${SCC_TMP} export TMP=${SCC_TMP} export SHELL=/bin/sh export LANG=C umask 077 mkdir -p ${SCC_DATA} ${SCC_TMP} 2>/dev/null PATH=${SCC_BIN}:/sbin:/usr/sbin:/usr/bin:/bin; export PATH # Use the following utilities for SunOS. if [ -x /usr/ccs/bin/what ] then alias what=/usr/ccs/bin/what fi if [ -x /usr/xpg4/bin/awk ] then alias awk=/usr/xpg4/bin/awk fi if [ -x /usr/xpg4/bin/grep ] then alias grep=/usr/xpg4/bin/grep fi test_dir="${SCC_TMP}/scc-d-$$" TMP_FILE="${SCC_TMP}/scc-f-$$" SYNTAX="Syntax error, use: ${ProgName} [ -c ] [ -d ] [ -e ] [ -f ] [ -i ] [ -k ] [ -m ] [ -n ] [ -p ] [ -s ] [ -t ]" empty_files=0 prog=mail max_interval=300 if tty -s then # Waiting is meant for lots of jobs scheduled at the same time. max_interval=0 # Do not wait when interactive. fi key_file="" max_months=0 dest="" mods="" remark="" fqn=0 no_run=0 smtp_server="" while [ $# -gt 0 ] do case "${1}" in -c) remark=$(echo "${2}" | tr -d "\012") # be sure that the remark is single-line shift 2;; -d) case "${2}" in [0-9]*) max_interval=${2};; *) echo "${ProgName}: non-numeric interval: ${2}" >&2 exit 1;; esac shift 2;; -e) mods="${2}"; # Pass on to scc-log shift 2;; -f) fqn=1 shift 1;; -i) smtp_server="${2}"; shift 2;; -k) key_file="${2}"; shift 2;; -m) case "${2}" in [0-9]*) max_months=${2};; *) echo "${ProgName}: non-numeric argument for -m option: ${2}" >&2 exit 1;; esac shift 2;; -n) no_run=1 shift 1;; -p) if [ -n "${dest}" ] then echo "${ProgName}: -p option must be used prior to -s option" >&2 exit 2 fi case "${2}" in cp|rcp|scp|mail|smtp) prog="${2}";; *) echo "${ProgName}: unknown transfer-method: ${2}" >&2 exit 2;; esac shift 2;; -s) dest="${2}" shift 2;; -t) empty_files=1 shift 1;; -*) echo ${SYNTAX} >&2 exit 1;; *) break;; esac done if [ $# -ne 0 ] then echo "${SYNTAX}" >&2 exit 1 fi our_name=$(hostname) # Determine the domain. if [ "${our_name}" = "${our_name%%.*}" ] then # No domain available in hostname. DOMAIN="" if [ -x /bin/dnsdomainname ] then DOMAIN=$(/bin/dnsdomainname 2>/dev/null) fi if [ "${DOMAIN}" = "" ] then DOMAIN=$(awk '/^domain/ { print $2 }' /etc/resolv.conf 2>/dev/null | tail -1) fi if [ "${DOMAIN}" = "" ] then DOMAIN=$(awk '/^search/ { print $2 }' /etc/resolv.conf 2>/dev/null | tail -1) fi if [ "${DOMAIN}" = "" ] then DOMAIN=$(nslookup ${our_name} 2>/dev/null | sed -n "s/^Name.*${our_name}\.//p") fi else DOMAIN=${our_name#*.} fi if [ ${fqn} -gt 0 ] then our_name="${our_name%%.*}.${DOMAIN}" else our_name=${our_name%%.*} # Erase domain. fi transfer_list="scc.${our_name}.cur scc.${our_name}.log scc.${our_name}.log.html scc.${our_name}.html" MAIL_NAME=scc-transfer-data REMOTE_NAME=scc.${our_name}.tar REMOTE_SIGNAL=scc.${our_name}.signal PASSPHRASE="passphrase" trap "rm -rf ${TMP_FILE} ${SCC_TMP}/${REMOTE_NAME}* ${SCC_TMP}/${REMOTE_SIGNAL} ${SCC_TMP}/${MAIL_NAME}* ${SCC_TMP}/${PASSPHRASE}* ${test_dir}" 0 trap "exit 2" 1 2 3 15 if [ ${empty_files} -gt 0 ] then # Create the empty test-files. mkdir ${test_dir} cd ${test_dir} for f in ${transfer_list} do touch ${f} done max_interval=0 # do not wait when testing. else if [ ${no_run} -eq 0 ] then # Produce new, real SCC-data nice ${SCC_BIN}/scc-log -c "${remark}" -e "${mods}" -m "${max_months}" if [ $? -ne 0 ] then exit 1 fi fi cd ${SCC_DATA} if [ -n "${dest}" -a ${fqn} -eq 1 ] then for s in cur html log log.html do cp scc.${our_name%%.*}.${s} scc.${our_name}.${s} done fi fi # Only send the files when we have a destination. if [ -n "${dest}" ] then # Only wait when we are going to send files. if [ ${max_interval} -gt 1 ] then # Wait for a maximized, random interval sleep $(( ${RANDOM} % ${max_interval} )) fi suffix="" p_exe="$(which gzip 2>/dev/null)" if [ -x "${p_exe}" ] then suffix=".gz"; else p_exe="$(which compress 2>/dev/null)" if [ -x "${p_exe}" ] then suffix=".Z"; else p_exe="cat" fi fi # Pack the data in a single file tar cf - ${transfer_list} | "${p_exe}" >${SCC_TMP}/${REMOTE_NAME}${suffix} if [ -n "${dest}" -a ${fqn} -eq 1 ] then for s in cur html log log.html do rm -f scc.${our_name}.${s} done fi cd ${SCC_TMP} case "${prog}" in mail|smtp) which uuencode 2>/dev/null >/dev/null if [ $? -ne 0 ] then echo "${ProgName}: uuencode not found" >&2 exit 2 fi # Encryption required? if [ -n "${key_file}" ] then e_exe="$(which openssl 2>/dev/null)" if [ ! -x "${e_exe}" ] then echo "${ProgName}: openssl not found" >&2 exit 2 fi if [ ! -f ${PASSPHRASE} ] then # Generate a random passphrase. # Replace \0 and \n to avoid short (possibly empty) passwords. openssl rand 40 | tr -s "\012\000" "n0" > ${PASSPHRASE} fi # Encrypt the scc-data with triple DES, using the random passphrase. openssl des3 \ -in ${REMOTE_NAME}${suffix} \ -out ${MAIL_NAME}${suffix}.e \ -pass file:./${PASSPHRASE} \ -e \ -salt -S 83AF2E2D8BE716C2 if [ ! -f ${PASSPHRASE}.e ] then # Encrypt the passphrase with the public key. openssl rsautl \ -in ${PASSPHRASE} \ -out ${PASSPHRASE}.e \ -inkey "${key_file}" \ -pubin \ -encrypt 2>/dev/null fi # Combine the encrypted scc-data and the encrypted passphrase. # The scc-server has to: # - untar the combined, encrypted scc-data and passphrase # - decrypt the passphrase (using it's own private key) # - decrypt the scc-data with the decrypted passphrase tar cf ${REMOTE_NAME}${suffix}.e.tar ${PASSPHRASE}.e ${MAIL_NAME}${suffix}.e rm -f ${PASSPHRASE} ${PASSPHRASE}.e ${REMOTE_NAME}${suffix} ${REMOTE_NAME}${suffix}.e suffix="${suffix}.e.tar" fi if [ "${prog}" = "mail" ] then uuencode ${MAIL_NAME}${suffix} <${REMOTE_NAME}${suffix} | mail "${dest}" else if [ -z "${smtp_server}" ] then # Split the email-address into host and account mail_account=${dest%%@*} smtp_server=${dest##*@} else mail_account=${dest} fi # Use smtp to transfer the data. # Use sleep to avoid that our commands are sent too fast to the SMTP-server. ( sleep 5 echo "helo ${our_name}" sleep 5 echo "mail from: root@${DOMAIN}" sleep 5 echo "rcpt to: ${mail_account}" sleep 5 echo "data" sleep 5 echo "to: ${mail_account}" echo "" sleep 5 uuencode ${MAIL_NAME}${suffix} <${REMOTE_NAME}${suffix} echo "." sleep 5 echo "quit" sleep 5 ) | telnet ${smtp_server} 25 >/dev/null 2>&1 # Remove the redirection of stdout and stderr to debug the communication with the smtp-server. fi ;; rcp) # Produce an empty signal-file to indicate that transfer is in progress. >${REMOTE_SIGNAL} rcp ${REMOTE_SIGNAL} ${dest} rcp ${REMOTE_NAME}${suffix} ${dest} # Replace the empty signal-file to indicate that transfer is complete. echo "done" >${REMOTE_SIGNAL} rcp ${REMOTE_SIGNAL} ${dest} ;; scp) # Produce an empty signal-file to indicate that transfer is in progress. >${REMOTE_SIGNAL} scp -q ${REMOTE_SIGNAL} ${dest} scp -q ${REMOTE_NAME}${suffix} ${dest} # Replace the empty signal-file to indicate that transfer is complete. echo "done" >${REMOTE_SIGNAL} scp -q ${REMOTE_SIGNAL} ${dest} ;; cp) # Produce an empty signal-file to indicate that transfer is in progress. >${dest}/${REMOTE_SIGNAL} # Move the packed files to the destination rm -f ${dest}/${REMOTE_NAME}* mv ${REMOTE_NAME}${suffix} ${dest} # Replace the empty signal-file to indicate that transfer is complete. echo "done" >>${dest}/${REMOTE_SIGNAL} ;; esac fi exit 0 scc/scc-run/opt/scc/bin/scc-collect010050000000000000003000000162540774770012700173070ustar00rootsys00000000000000#!/bin/sh # Shell script to collect configuration data for SCC. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.154 $ ProgName=${0##*/}; export ProgName uid=$(id | sed -e 's/(.*//' -e 's/.*=//') if [ "${uid}" != "0" ] then echo "${ProgName}: only root should run this program" >&2 exit 2 fi SYNTAX="Syntax error, use: ${ProgName} [ -a ] [ -e ] [ -i ]" >&2 args="" interactive=0 modules="" while [ $# -gt 0 ] do case "${1}" in -a) args="${2}" shift 2;; -e) if [ "${2}" ] then modules="${2}" fi shift 2;; -i) interactive=1; shift 1;; *) break;; esac done if [ $# -ne 0 ] then echo "${SYNTAX}" >&2 exit 1 fi if [ ${interactive} -eq 0 ] then if tty -s then echo "${ProgName}: use -i option to run interactive" >&2 exit 2 fi fi export SCC_BIN=/opt/scc/bin export SCC_TOP=/var/opt/scc export SCC_DATA=${SCC_TOP}/data export SCC_TMP=${SCC_TOP}/tmp export SCC_CONF=/etc/opt/scc/conf umask 077 mkdir -p ${SCC_DATA} ${SCC_TMP} 2>/dev/null # Use the following utilities for SunOS. if [ -x /usr/ccs/bin/what ] then alias what=/usr/ccs/bin/what fi if [ -x /usr/xpg4/bin/awk ] then alias awk=/usr/xpg4/bin/awk fi if [ -x /usr/xpg4/bin/grep ] then alias grep=/usr/xpg4/bin/grep fi [[ -x ${SCC_CONF}/scc-localize ]] && . ${SCC_CONF}/scc-localize export TMPDIR=${SCC_TMP} export TMP=${SCC_TMP} export SHELL=/bin/sh export LANG=C cd ${SCC_TMP} PATH=/sbin:/usr/sbin:/usr/bin:/bin:/usr/lib:${SCC_BIN}; export PATH export TMP1_FILE=${SCC_TMP}/scc_collect1_$$ export TMP2_FILE=${SCC_TMP}/scc_collect2_$$ export TMP3_FILE=${SCC_TMP}/scc_collect3_$$ export PROC_FILE=${SCC_TMP}/scc_ps_$$ # Some commands adjust the width of their output according to COLUMNS, unset # this variable to avoid differences in the snapshots. export COLUMNS=300 # always use the same width. unset LINES unset DISPLAY OS_NAME=$(uname -s) hostname=$(hostname) HOSTNAME=${hostname%%.*} export OS_NAME HOSTNAME SCC_KEEP_CONFIG=${SCC_DATA}/scc.${HOSTNAME}.keep SCC_KEEP_NEW=${SCC_TMP}/scc.keep_$$ rm -f ${SCC_KEEP_NEW} touch ${SCC_KEEP_NEW} ${SCC_KEEP_CONFIG} export SCC_KEEP_CONFIG SCC_KEEP_NEW new_keep_version="keep_file_version:1.1" keep_version=$(grep "^${new_keep_version}$" ${SCC_KEEP_CONFIG} 2>/dev/null) if [ "${keep_version}" != "${new_keep_version}" ] then # The version of the keep-file does not match with the version # used by scc-collect. This means that the file has been written # by an incompatible version of scc-collect. Erase the keep-file. >${SCC_KEEP_CONFIG} fi echo "${new_keep_version}" >>${SCC_KEEP_NEW} trap "rm -f ${TMP1_FILE} ${TMP2_FILE} ${TMP3_FILE} ${PROC_FILE} ${SCC_KEEP_NEW}" 0 trap "exit 2" 1 2 3 15 # Store the current processes for later use. # Try to collect the process hierarchy. UNIX95= ps -Hef 2>/dev/null >${PROC_FILE} 2>/dev/null ps -ef >${TMP1_FILE} 2>/dev/null if [ $(wc -l <${PROC_FILE}) -lt $(wc -l <${TMP1_FILE}) ] then mv ${TMP1_FILE} ${PROC_FILE} fi rm -f ${TMP1_FILE} IS_NIS_MASTER=0; export IS_NIS_MASTER NIS_DATA_DIR=""; export NIS_DATA_DIR grep -q ypxfrd ${PROC_FILE} if [ $? -eq 0 ] then IS_NIS_MASTER=1 NIS_DATA_DIR=$(grep "^[ ]*DIR" /var/yp/Makefile 2>/dev/null | tail -1 | sed -e 's/^[ ]*DIR[ ]*=[ ]*//' -e 's/[ ].*//') if [ ! -d "${NIS_DATA_DIR}" ] then NIS_DATA_DIR=/etc fi fi # Not part of scc-utils as it should not be called by the modules. scc_crypt_init() { # Get the crypt-key from the keep-config-file, otherwise initialize. scc_keep_crypt_tag="scc-crypt-key" crypt_key=$(sed -n -e "s@^${scc_keep_crypt_tag}:@@p" ${SCC_KEEP_CONFIG}) if [ ! -n "${crypt_key}" ] then crypt_key="${RANDOM}${RANDOM}" fi echo "${scc_keep_crypt_tag}:${crypt_key}" >>${SCC_KEEP_NEW} return 0; } # To record the timing of separate parts of scc-collect, give SCC_PROFILING a non-empty value. # Usage: [ ${SCC_PROFILING} ] && scc_timing "end of: network" #export SCC_PROFILING="yes" now=$(date '+%M:%S') min=${now%:*} sec=${now#*:} tick_prev=$(( ${sec#0} + ( 60 * ${min#0} ) )) total_time=0 # For several commands we need to know the name of the HP-UX kernel. if [ -x /usr/sbin/kmpath ] then # This is only available for HP-UX 11.* HPUX_KERNEL="$(/usr/sbin/kmpath 2>/dev/null)" fi HPUX_KERNEL=${HPUX_KERNEL:-/stand/vmunix} export HPUX_KERNEL MAX_SYS_ACCOUNT_ID=500 if [ "${OS_NAME}" = "HP-UX" -o "${OS_NAME}" = "SunOS" ] then MAX_SYS_ACCOUNT_ID=100 # check logins(1) fi export MAX_SYS_ACCOUNT_ID scc_crypt_init; ## START: GENERAL [ ${SCC_PROFILING} ] && scc_timing "start of run" ( cd ${SCC_BIN}/scc_modules for module in scc_[0-9][0-9][0-9][0-9]_[su]_* do if [ -x "${module}" ] then rm -f ${TMP1_FILE} ${TMP2_FILE} ${TMP3_FILE} if [ ${interactive} -eq 0 ] then [ ${SCC_PROFILING} ] && scc_timing "start of run: ${module##*_}" fi case "${module}" in scc_[0-9][0-9][0-9][0-9]_s_*) # scc system module if [ ${interactive} -eq 0 ] then ./"${module}" 2>&1 else case "${module}" in *${modules}*) ./"${module}" 2>&1 # run the matching system module esac fi ;; scc_[0-9][0-9][0-9][0-9]_u_*) # scc user module if [ "${modules}" ] then # Check whether the module should be run; # Only user modules can have arguments. case "${module}" in *${modules}*) # run the user module if [ ${interactive} -eq 1 ] then ./"${module}" ${args} 2>&1 else # Surround the data with these tags, when a module # is changed, scc-log detects this and removes the # data of the from the current and new snapshot before # comparing them. This makes it possible to update # modules without changes reported in the logbook. { echo "var:MoDuLe:start::${module}:$(cksum <"${module}")" ./"${module}" ${args} 2>&1 echo "var:MoDuLe:end::${module}:" } >"${SCC_DATA}/plugin_data/${module}" fi ;; esac; fi if [ ${interactive} -eq 0 ] then # Sent the plugin-data of new user-modules only when it exists. if [ -s ${SCC_DATA}/plugin_data/${module} ] then # incorporate the output of the user module cat "${SCC_DATA}/plugin_data/${module}" fi fi ;; esac if [ ${interactive} -eq 0 ] then [ ${SCC_PROFILING} ] && scc_timing "end of run: ${module##*_}" fi else echo "fix:messages::non-executable module: ${module}" fi done ) ## END [ ${SCC_PROFILING} ] && scc_timing "end of run" mv ${SCC_KEEP_NEW} ${SCC_KEEP_CONFIG} exit 0 scc/scc-run/opt/scc/bin/scc-log010050000000000000003000000306300774770012700164350ustar00rootsys00000000000000#!/bin/sh # Shell script to collect and compare configuration data for SCC. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.73 $ ProgName=${0##*/}; export ProgName SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP export SCC_DATA=${SCC_TOP}/data export SCC_TMP=${SCC_TOP}/tmp export SCC_CONF=/etc/opt/scc/conf export TMPDIR=${SCC_TMP} export TMP=${SCC_TMP} export SHELL=/bin/sh export LANG=C umask 077 mkdir -p ${SCC_DATA} ${SCC_TMP} 2>/dev/null cd ${SCC_TMP} PATH=/sbin:/usr/sbin:/usr/bin:/bin:${SCC_BIN}; export PATH # Use the following utilities for SunOS. if [ -x /usr/ccs/bin/what ] then alias what=/usr/ccs/bin/what fi if [ -x /usr/xpg4/bin/awk ] then alias awk=/usr/xpg4/bin/awk fi if [ -x /usr/xpg4/bin/grep ] then alias grep=/usr/xpg4/bin/grep fi d_n=$(date '+%Y-%m-%d') t_n_b=$(date '+%H.%M.%S') s=${t_n_b#*.*.} # seconds s=${s#0} # strip leading "0" h=${t_n_b%.*.*} # hours h=${h#0} # strip leading "0" m=${t_n_b#*.} # minutes and seconds m=${m%.*} # minutes m=${m#0} # strip leading "0" tick_start=$(( ${s} + ( 60 * ${m} ) + ( 3600 * ${h} ) )) name=$(hostname) name=${name%%.*} new_cfg=${SCC_DATA}/scc.${name}.new cur_cfg=${SCC_DATA}/scc.${name}.cur old_cfg=${SCC_DATA}/scc.${name}.old log_cfg=${SCC_DATA}/scc.${name}.log log_html=${SCC_DATA}/scc.${name}.log.html cfg_html=${SCC_DATA}/scc.${name}.html lock_cfg=${SCC_DATA}/scc.${name}.lock index=${SCC_DATA}/index.html keep=${SCC_DATA}/scc.${name}.keep ito_log=cfg.log export TMP1_FILE=${SCC_TMP}/scc_log1_$$ export TMP2_FILE=${SCC_TMP}/scc_log2_$$ export TMP3_FILE=${SCC_TMP}/scc_log3_$$ # File, used in release 1.1.30, no longer needed rm -f ${SCC_DATA}/scc_rpm_keep # Some commands might "hang", use a lock-file to avoid that more and more # invocations of Scc start and swamp the system. if [ -f ${lock_cfg} ] then running=1 pid=$(<${lock_cfg}) if [ -n "${pid}" ] then # Check in a non-destructive way whether the process is still running. kill -0 ${pid} 2>/dev/null if [ $? -ne 0 ] then # Unable to signal the process: it is no longer active. # Maybe hard-killed during a shutdown. running=0 fi fi if [ ${running} -eq 1 ] then echo "${ProgName}: another instance is active, check process ID in ${lock_cfg}" >&2 exit 2 fi rm -f ${lock_cfg} fi # Do not install the traps earlier, as the above exit will remove the # lockfile from the other, running invocation of this program. trap "rm -f ${TMP1_FILE} ${TMP2_FILE} ${TMP3_FILE} ${lock_cfg}" 0 trap "exit 2" 1 2 3 15 # Record our PID in the lock-file echo "$$" > ${lock_cfg} remark="" max_months=0 # No limit mods="" while [ $# -gt 0 ] do case ${1} in -c) remark=$(echo "${2}" | tr -d "\012") # be sure that the remark is single-line shift 2;; -e) mods="${2}"; shift 2;; -m) case "${2}" in [0-9]*) max_months=${2};; *) echo "${ProgName}: non-numeric argument for -m option: ${2}" >&2 exit 1;; esac shift 2;; -r) rm -f ${cur_cfg} shift 1;; -u) rm -f ${new_cfg} ${cur_cfg} ${old_cfg} ${log_cfg} ${log_html} ${cfg_html} ${SCC_DATA}/${ito_log} ${lock_cfg} ${keep} exit 0;; *) echo "Syntax error, use ${ProgName} [ -c ] [ -e ] [ -m ] [ -r | -u ]" >&2 exit 1;; esac done # For some programs that inspect the logbook, "fixed" filenames are easier. # Use a symbolic link to save disk-space. ( cd ${SCC_DATA} rm -f ${ito_log} touch scc.${name}.log ln -s scc.${name}.log ${ito_log} ) # Reduce the logfile to the specified number of months. if [ ${max_months} -gt 0 ] then limit=$(( ( $(date '+%Y') * 12 ) + $(date '+%m') - ${max_months} )) first=$(head -1 ${cfg_log} | awk -F- '{ print ( ( $1 * 12 ) + $2 ) }' ) if [ -n "${first}" -a ${first} -lt ${limit} ] then # Some of the log-entries are too old. awk -F- '{ if ( ( ( $1 * 12 ) + $2 ) >= l ) { print; } }' l="${limit}" ${log_cfg} >${TMP1_FILE} # The html-version of the logfile is generated from scratch out of the shorter logfile. mv ${TMP1_FILE} ${log_cfg} fi fi # Run scc-collect in a "clean" environment. # It needs TZ to use the correct time-settings. # It uses SCC_PROFILING to determine whether to add performance data to the snapshot. # It uses SCC_IGNORE_STM to determine whether to run stm or not. # It uses SCC_INSTALL_PHASE to determine whether SCC is called during installation. env -i TZ="${TZ}" \ SCC_PROFILING="${SCC_PROFILING}" \ SCC_IGNORE_STM="${SCC_IGNORE_STM}" \ SCC_INSTALL_PHASE="${SCC_INSTALL_PHASE}" \ nice ${SCC_BIN}/scc-collect -e "${mods}" ${TMP3_FILE} 2>&1 >${new_cfg} # Check the syntax of the new snapshot: sed -e 's/[ ][ ]*$//' \ -e '/^$/d' ${TMP3_FILE} | awk '/^fix:messages:/ { # When a module signals an error, the syntax is correct msg_ind=1; visited[ "fix:messages::" ] = 1; compare[ ":messages:" ] = 1; } /^fix:|^var:/ { class=$0; sub( "::.*", "::", class ); if ( visited[ class ] ) { # Do not check again. print $0; next; } cnt=split( class, part, ":" ); # line with classification with minimal number of elements: # fix:general:: # cnt is 4 # line with classification with maximal number of elements: # fix:a:b:c:d:e:: # cnt is 8 if ( cnt < 4 ) { msg_ind=1; print "fix:messages::not enough fields in classification:", $0; } else if ( cnt > 8 ) { msg_ind=1; print "fix:messages::too many fields in classification:", $0; } else if ( ( class == $0 ) && ( class !~ "::$" ) ) { msg_ind=1; print "fix:messages::no end of classification:", $0; } else { visited[ class ]=1; sub( "^...", "", class ); # erase fix or var sub( "::$", ":", class ); # map :a:: to :a: to check for :a:b: for ( c in compare ) { if ( c == class ) { break; } if ( index( c, class ) == 1 ) { print "fix:messages::class conflict for \"" class "\" and \"" c "\""; msg_ind=1; break; } if ( index( class, c ) == 1 ) { print "fix:messages::class conflict for \"" c "\" and \"" class "\""; msg_ind=1; break; } } compare[ class ]=1; print $0; } next; } { msg_ind=1; print "fix:messages::unknown prefix:" $0; } END { exit msg_ind }' >${TMP2_FILE} if [ $? -ne 0 ] then echo "fix:messages::inspect ${cur_cfg} to determine cause of messages in scc-collect/plugins" >${new_cfg} fi # Do not change this data nor the location in the snapshot. The scc-srv software uses it. echo "var:general::date:${d_n}" >>${new_cfg} echo "var:general::start time:${t_n_b}" >>${new_cfg} cat ${TMP2_FILE} >>${new_cfg} rm -f ${TMP2_FILE} ${TMP3_FILE} t_n_e=$(date '+%H.%M.%S') s=${t_n_e#*.*.} # seconds s=${s#0} # strip leading "0" h=${t_n_e%.*.*} # hours h=${h#0} # strip leading "0" m=${t_n_e#*.} # minutes and seconds m=${m%.*} # minutes m=${m#0} # strip leading "0" tick_end=$(( ${s} + ( 60 * ${m} ) + ( 3600 * ${h} ) )) if [ ${tick_end} -lt ${tick_start} ] then tick_end=$(( ${tick_end} + ( 24 * 3600 ) )) fi runtime="$(( ${tick_end} - ${tick_start} ))" echo "var:general::runtime:${runtime}" >>${new_cfg} echo "var:general::stop time:${t_n_e}" >>${new_cfg} if [ -f ${cur_cfg} ] then # Compare the new snapshot with the current (previous) one. >${TMP1_FILE} # When a user-module is changed, the output will also be changed. # Therefore we remove the data of a user module when it is changed. # We can detect changes as scc-collect collects the checksums of # all modules in the plugin-data. Limit the grep to the user-modules: _u_ # The following code depends upon the code of scc-collect! # Suppose you run scc daily and the user modules weekly (on sunday). # When you change a user-module on wednesday, the change of the checksum # will be reported on the next run of scc. On the first run of the # changed user-module, the changed checksum in the plugin-data causes # that all changes of that user-module are ignored. # The "proper" procedure to change a user-module is: # - run the user-module: scc -e "" # - change the user-module # - test the user-module: scc-collect -i -e "" # - rerun the user-module: scc -e "" # The last run will signal the change in the checksum of the user-module, # but ignores all changes in the output of the user-module. On the next, # weekly activation of the user-module, all (regular) changes will be # reported. grep "^var:MoDuLe:start::scc_[0-9][0-9][0-9][0-9]_u_" ${cur_cfg} >${TMP2_FILE} grep "^var:MoDuLe:start::scc_[0-9][0-9][0-9][0-9]_u_" ${new_cfg} >${TMP3_FILE} diff ${TMP2_FILE} ${TMP3_FILE} | sed -n -e 's/.*var:MoDuLe:start:://p' | sed -e 's/:.*//' | sort -u | while read module remainder do # This module is reported, erase all the data of this module. echo "/^var:MoDuLe:start::${module}:/,/^var:MoDuLe:end::${module}:/d" >>${TMP1_FILE} done # Sometimes "fixed" lines between "variable" lines are also reported. # Avoid this by limiting the comparison to "fixed" lines. if [ -s ${TMP1_FILE} ] then sed -f ${TMP1_FILE} ${cur_cfg} | grep "^fix:" >${TMP2_FILE} sed -f ${TMP1_FILE} ${new_cfg} | grep "^fix:" >${TMP3_FILE} >${TMP1_FILE} else grep "^fix:" ${cur_cfg} >${TMP2_FILE} grep "^fix:" ${new_cfg} >${TMP3_FILE} fi # During install, the RPM-database is locked and cannot return # the installed rpm's. After the installation, the new snapshot # contains rpm-data, but the old snapshot does not contain # rpm-data. Avoid messages in the logfile, by ignoring all # rpm-data when the old (current) snapshot does not contain # any rpm-data. ignore_rpm="" if [ -x /bin/rpm ] then grep -q "^fix:software:installed-rpms:" ${TMP2_FILE} if [ $? -ne 0 ] then # No rpm-data in current (previous) snapshot. ignore_rpm="-e /^new::software:installed-rpms:/d " fi fi diff ${TMP2_FILE} ${TMP3_FILE} | sed -e "/^[0-9]/d" \ -e "/^--/d" \ -e "s/^< fix:/old::/" \ -e "s/^> fix:/new::/" ${ignore_rpm} >${TMP1_FILE} if [ -s ${TMP1_FILE} ] then # Get the date and time of the old (current) snapshot. d_o=$(head ${cur_cfg} | sed -n -e "s/.*::date://p") t_o=$(head ${cur_cfg} | sed -n -e "s/.*::start time://p" | sed -e 's/:/./g') echo "${d_n}:${t_n_b}:result::different" >>${log_cfg} echo "${d_n}:${t_n_b}:remark::${remark}" >>${log_cfg} echo "${d_n}:${t_n_b}:runtime::${runtime}" >>${log_cfg} echo "${d_n}:${t_n_b}:count::$(wc -l <${TMP1_FILE} | sed -e 's/^ *//')" >>${log_cfg} echo "${d_n}:${t_n_b}:previous date::${d_o}" >>${log_cfg} echo "${d_n}:${t_n_b}:previous time::${t_o}" >>${log_cfg} sed -e "s/^/${d_n}:${t_n_b}:data::/" ${TMP1_FILE} >>${log_cfg} else echo "${d_n}:${t_n_b}:result::identical" >>${log_cfg} echo "${d_n}:${t_n_b}:remark::${remark}" >>${log_cfg} echo "${d_n}:${t_n_b}:runtime::${runtime}" >>${log_cfg} fi rm -f ${TMP1_FILE} rm -f ${old_cfg} mv ${cur_cfg} ${old_cfg} else echo "${d_n}:${t_n_b}:result::(re)start" >>${log_cfg} echo "${d_n}:${t_n_b}:remark::${remark}" >>${log_cfg} echo "${d_n}:${t_n_b}:runtime::${runtime}" >>${log_cfg} fi # Avoid that the html-file is empty during the processing. nice ${SCC_BIN}/scc-log2html ${name} <${log_cfg} >${TMP1_FILE} mv ${TMP1_FILE} ${log_html} mv ${new_cfg} ${cur_cfg} # Avoid that the html-file is empty during the processing. nice ${SCC_BIN}/scc-snap2html ${name} <${cur_cfg} >${TMP1_FILE} mv ${TMP1_FILE} ${cfg_html} # To ease navigation on the server, the html-file of the snapshot contains a reference # to index.html (the main file for a realm). To avoid an 404 error when browsing on the client, # we create a simple index.html on the client. cat <<_X_ >${index} Index for ${name} snapshot of ${name}
logbook of ${name} _X_ exit 0 scc/scc-run/opt/scc/bin/scc-log2html010050000000000000003000000141550774770012700174100ustar00rootsys00000000000000#!/bin/sh # Shell script to convert a SCC logbook to html-format. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.45 $ ProgName=${0##*/}; export ProgName if [ $# -ne 1 ] then echo "Syntax error, use ${ProgName} " >&2 exit 1 fi SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP export SCC_DATA=${SCC_TOP}/data export SCC_TMP=${SCC_TOP}/tmp export SCC_CONF=/etc/opt/scc/conf export TMPDIR=${SCC_TMP} export TMP=${SCC_TMP} export SHELL=/bin/sh export LANG=C umask 077 PATH=/sbin:/usr/sbin:/usr/bin:/bin; export PATH # Use the following utilities for SunOS. if [ -x /usr/ccs/bin/what ] then alias what=/usr/ccs/bin/what fi if [ -x /usr/xpg4/bin/awk ] then alias awk=/usr/xpg4/bin/awk fi if [ -x /usr/xpg4/bin/grep ] then alias grep=/usr/xpg4/bin/grep fi cd ${SCC_TMP} export TMP_FILE=${SCC_TMP}/scc_log_html_$$ trap "rm -f ${TMP_FILE}" 0 trap "exit 2" 1 2 3 15 TABLE_TAG="" TOP_NAME="" TOP_URL="Top    " echo '' echo "" echo "" echo "Logbook: $1" echo "" echo "" echo "${TOP_NAME}" echo "

Logbook: ${1}

" echo "

" echo " Home    " echo " Configuration" echo "

" echo "

Summary of runs of SCC

" # Replace special HTML-characters in input. sed -e 's/&/\&/g' \ -e 's//\>/g' \ -e 's/"/\"/g' >${TMP_FILE} # Build a table with URL's to reported differences in the logbook. # Use the date/time of the run as the ID for HREF and NAME. # Sort the data reverse to show the most recent change at the top of the table. # Check the code in scc-log for the specific layout of the logbook. grep -e ":result::" -e ":remark::" -e ":runtime::" -e ":count::" ${TMP_FILE} | awk -F: '/:result::/ { if ( length( prev_res ) ) { # restart or identical, no number of differences. print prev_res ":" ":" prev_remark ":" prev_runtime; prev_remark=""; prev_runtime=""; } prev_res=$0; } /:remark::/ { prev_remark=$NF; } /:runtime::/ { prev_runtime=$NF; } /:count::/ { # changes detected, report print prev_res ":" $NF ":" prev_remark ":" prev_runtime; prev_res="" prev_remark="" } END { # unreported results? if ( length( prev_res ) ) { print prev_res ":" ":" prev_remark ":" prev_runtime; } }' | sort -r | awk -F":" 'BEGIN { print "'"${TABLE_TAG}"'"; print ""; print " "; print " "; print " "; print " "; print " "; print " "; print ""; } { print ""; print " "; print " "; if ( length( $8 ) > 0 ) { printf( " \n", $8 ); } else { print " "; } if ( $5 == "different" ) { printf( " \n", $1, $2, $5 ); } else { printf( " \n", $5 ); } for ( i = 6; i <= 7; i++ ) { if ( length( $i ) > 0 ) { printf( " \n", $i ); } else { print " "; } } print ""; } END { print "
DateTimeRuntimeResultCountRemark
" $1 "" $2 "%s %s%s%s 
"; }' # Now the table is present, we show the data. # Use the date/time of the run as the ID for HREF and NAME. awk -F: '{ # Sort the logfile, most recent run first, # within the run keep the data in the order of the logfile. log_date=$1; log_time=$2; gsub( "-", "", log_date ); gsub( "\\.", "", log_time ); printf( "%s:%06d:%s:%s\n", log_date, log_time, NR, $0 ); }' ${TMP_FILE} | sort -t: -k 1,1nr -k 2,2nr -k 3,3n | sed -e 's/^[0-9]*:[0-9]*:[0-9]*://' | awk -F":" '/:result::different$/ { if ( show_data ) { print ""; # end of previously showed data } show_data=1; # indicate that we are going to show differences prev_class=""; # reset class-identifier for this run print "
"; printf( "

%sDifferences at: %s %s

\n", u, $1, $2, $1, $2 ); print "
";
			next;
		}
	/:result::identical$|:result::\(re)start$/	{
			if ( show_data )
			{
				print "
"; # end of previously showed data } show_data=0; # the are no differences: do not show data next; } /:data::/ { if ( show_data ) { # Do not show the classification on each line, only once in bold format. change=$5; # old/new # $6 is empty to separate changed data from the classification class=$7; for ( i = 8; length( $i ) > 0; i++ ) { class=sprintf( "%s - %s", class, $i ); } if ( class != prev_class ) { print "
"; print "" class ""; prev_class=class; } printf( "%s: ", change ); for ( i++; i < NF; i++ ) { printf( "%s:", $i ); } print $i; } next; } { # No data, classifications: # possible classifications are: count, remark, previous date and time if ( show_data ) { printf( "%-30.30s: %s\n", $3, $5 ); } next; } END { if ( show_data ) { print ""; # end of previously showed data } }' u="${TOP_URL}" rm -f ${TMP_FILE} echo "

Generated by SCC (© Open Challenge) on $(date)

" echo "" echo "" exit 0 scc/scc-run/opt/scc/bin/scc-plugin010050000000000000003000000052210774770012700171500ustar00rootsys00000000000000#!/bin/sh # Shell script for plugins for SCC. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.35 $ ProgName=${0##*/}; export ProgName # NOTICE # When you use this program to create a user module, copy it to the # directory /opt/scc/bin/scc_modules using the naming format for the # user modules: scc_9999_u_NAME. Where 9999 is a four-digit number used # to order the execution of the modules and NAME is the readable name. SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP . ${SCC_BIN}/scc_modules/scc_utils export SCC_DATA=${SCC_TOP}/data export SCC_TMP=${SCC_TOP}/tmp export SCC_CONF=/etc/opt/scc/conf # Start the code for the plugin. # Notice: # - all output lines should start with "fix:" or "var:" # - the generated classifications can contain at most 5 levels. # - refer to scc_utils for the functions that are provided. # Availabe for use are the following files: # ${SCC_PROC_FILE} all processes at the moment scc-collect started # ${TMP1_FILE} empty, temporary file # ${TMP2_FILE} empty, temporary file # ${TMP3_FILE} empty, temporary file # ${SCC_KEEP_CONFIG} file with data from previous run # ${SCC_KEEP_NEW} file with data to keep for next run # Some scc-data is determined by means of path-names of running # processes. To avoid changes in the logbook when the these processes # are inactive, we store this process data in the keep-file. When the # processes are inactive, we use the data from the keep-file. After using # it, we have to add this data to ${SCC_KEEP_NEW} for the next run of scc. # Availabe for use are the following environment variables: # OS_NAME name of the OS: HP-UX SunOS, Linux, AIX # HOSTNAME hostname (without domain) # IS_NIS_MASTER 0/1 indicator for a NIS master-server # NIS_DATA_DIR source directory for NIS-maps # HPUX_KERNEL path of the HP-UX kernel # MAX_SYS_ACCOUNT_ID max uid for system-users exit 0 scc/scc-run/opt/scc/bin/scc-snap2html010050000000000000003000000330140774770012700175630ustar00rootsys00000000000000#!/bin/sh # Shell script to convert collected configuration data to HTML-format. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # SCC-release: 1.4.28 # file-version: $Revision: 1.46 $ ProgName=${0##*/}; export ProgName if [ $# -ne 1 ] then echo "Syntax error, use ${ProgName} " >&2 exit 1 fi SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP export SCC_DATA=${SCC_TOP}/data export SCC_TMP=${SCC_TOP}/tmp export SCC_CONF=/etc/opt/scc/conf export TMPDIR=${SCC_TMP} export TMP=${SCC_TMP} export SHELL=/bin/sh export LANG=C umask 077 PATH=/sbin:/usr/sbin:/usr/bin:/bin; export PATH # Use the following utilities for SunOS. if [ -x /usr/ccs/bin/what ] then alias what=/usr/ccs/bin/what fi if [ -x /usr/xpg4/bin/awk ] then alias awk=/usr/xpg4/bin/awk fi if [ -x /usr/xpg4/bin/grep ] then alias grep=/usr/xpg4/bin/grep fi cd ${SCC_TMP} export TMP_FILE=${SCC_TMP}/scc_html_$$ export IND_FILE=${SCC_TMP}/scc_ind_$$ export CATEGORIES=${SCC_TMP}/scc_classifications_$$ trap "rm -f ${TMP_FILE} ${IND_FILE} ${CATEGORIES}" 0 trap "exit 2" 1 2 3 15 # Replace special HTML-characters in input. # Anything that does not start with fix: or var: is unexpected. # Remove the special tags used by scc-collect and scc-log to # detect and handle changes in user modules. sed -e '/^var:MoDuLe:start::/d' \ -e '/^var:MoDuLe:end::/d' \ -e 's/&/\&/g' \ -e 's//\>/g' \ -e "s/'/\'/g" \ -e 's/"/\"/g' | awk '/^[fv][ia][xr]:/ { print; next } { print "fix:unexpected data::" $0 }' >${TMP_FILE} TOP_NAME="" TOP_URL="Top    " echo '' echo "" echo "" echo "Configuration: ${1}" echo "" echo "" echo "${TOP_NAME}" echo "

" echo " Configuration: ${1}" echo "

" echo "

" echo " Home    " echo " Logbook" echo "

" # Get all the hierarchical classifications from the snap-shot. # Do not sort, we depend on the order of the collect-script. grep "^[fv][ia][xr]:" ${TMP_FILE} | sed -e 's/^var://' \ -e 's/^fix://' \ -e 's/::.*//' \ -e 's/\\/_/g' | uniq | awk -F: '{ # Because of uniq (instead of sort) we can see the same attribute # another time. In that case we have to ignore it. # Give all classifications their unique ID, use NR for this. if ( visited[ $0 ] ) { next; } # Single-level classifications (highest-level) are done further in the program. # Here we skip them. if ( ( ! visited[ $1 ] ) && ( NF > 1 ) ) { visited[ $1 ] = 1; print $1; } idx=$1; for ( i = 2; i < NF; i++ ) { idx = sprintf( "%s:%s", idx, $i ); if ( ! visited[ idx ] ) { visited[ idx ] = 1; print idx; } } visited[ $0 ] = 1; printf( "%s:SCC_CLASS%d\n", $0, NR ); }' >${CATEGORIES} # Show the level-1 classifications. awk -F: 'BEGIN { sep=""; } { if ( visited[ $1 ] ) { next; # This menu-item already has been processed. } visited[ $1 ] = 1; if ( ( NF == 2 ) && ( $2 ~ "^SCC_CLASS[0-9][0-9]*$" ) ) { sub( "SCC_CLASS", "", $2 ); # This is an end-point for level 1. The number $2 indicates # the ID. Produce a reference to the data. printf( "%s%s\n", sep, $2, $1 ); sep = "
"; } else if ( NF >= 1 ) { # This level-1 item points to a level-2 sub-menu. # Produce a reference to the sub-menu. label=$1; gsub( "[ ]", "_", $1 ); printf( "%s%s\n", sep, $1, label ); sep = "
"; } }' ${CATEGORIES} echo "
" # Show the level-2 classifications. # First get al the level-1 menu items. # Then we process each of them to extract all their corresponding level-2 items. awk -F: '{ # Only print items that have lower level items. if ( ( NF == 1 ) && ( $1 !~ "^SCC_CLASS[0-9][0-9]*$" ) ) { print; } }' ${CATEGORIES} | while read submenu do awk -F: '{ if ( $1 != m ) { next; } if ( ! started ) { # Produce the entry-point for this submenu. ref_1=$1; gsub( "[ ]", "_", ref_1 ); printf( "

%s%s

\n", u, ref_1, $1 ); started = 1; } prefix=sprintf( "%s:%s", $1, $2 ) if ( visited[ prefix ] ) { next; # This sub-menu already has been processed. } visited[ prefix ] = 1; if ( ( NF == 3 ) && ( $3 ~ "^SCC_CLASS[0-9][0-9]*$" ) ) { sub( "SCC_CLASS", "", $3 ); # This is an end-point for level 2. The number $3 indicates # the ID. Produce a reference to the data. printf( " %s
\n", $3, $2 ); } else if ( ( NF == 2 ) && ( $2 !~ "^SCC_CLASS[0-9][0-9]*$" ) ) { # This level-2 item points to a level-3 sub-menu. # Produce a reference to the sub-menu. cl = sprintf( "%s_%s", $1, $2 ); gsub( "[ ]", "_", cl ); printf( " %s
\n", cl, $2 ); } }' m="${submenu}" u="${TOP_URL}" ${CATEGORIES} done echo "
" # Show the level-3 classifications. # First get al the level-2 submenu items. # Then we process each of them to extract all their corresponding level-3 items. awk -F: '{ # Only print items that have lower level items. if ( ( NF == 2 ) && ( $2 !~ "^SCC_CLASS[0-9][0-9]*$" ) ) { print; } }' ${CATEGORIES} | while read submenu do awk -F: '{ prefix = sprintf( "%s:%s", $1, $2 ); if ( prefix != m ) { next; } cl = sprintf( "cfg_%s_%s", $1, $2 ); gsub( "[ ]", "_", cl ); if ( ! started ) { # Produce the entry-point for this submenu. ref_1=$1; gsub( "[ ]", "_", ref_1 ); label_1=sprintf( "%s", ref_1, $1 ); printf( "

%s%s - %s

\n",\ u, cl, label_1, $2 ); started = 1; } if ( ( NF == 4 ) && ( $4 ~ "^SCC_CLASS[0-9][0-9]*$" ) ) { sub( "SCC_CLASS", "", $4 ); # This is an end-point for level 3. The number $4 indicates # the ID. Produce a reference to the data. printf( " %s
\n", $4, $3 ); } else if ( ( NF == 3 ) && ( $3 !~ "^SCC_CLASS[0-9][0-9]*$" ) ) { # This level-3 item points to a level-4 sub-menu. # Produce a reference to the sub-menu. cl = sprintf( "cfg_%s_%s_%s", $1, $2, $3 ); gsub( "[ ]", "_", cl ); printf( " %s
\n", cl, $3 ); } }' m="${submenu}" u="${TOP_URL}" ${CATEGORIES} done echo "
" rm -f ${IND_FILE} # Show the level-4 classifications. # First get al the level-3 submenu items. # Then we process each of them to extract all their corresponding level-4 items. awk -F: '{ # Only print items that have lower level items. if ( ( NF == 3 ) && ( $3 !~ "^SCC_CLASS[0-9][0-9]*$" ) ) { print; } }' ${CATEGORIES} | while read submenu do touch ${IND_FILE} # Indicate that there is a menu-item at this level awk -F: '{ prefix = sprintf( "%s:%s:%s", $1, $2, $3 ); if ( prefix != m ) { next; } cl = sprintf( "cfg_%s_%s_%s", $1, $2, $3 ); gsub( "[ ]", "_", cl ); if ( ! started ) { # Produce the entry-point for this submenu. ref_1=$1; gsub( "[ ]", "_", ref_1 ); label_1=sprintf( "%s", ref_1, $1 ); ref_2 = sprintf( "%s_%s", $1, $2 ); gsub( "[ ]", "_", ref_2 ); label_2=sprintf( "%s", ref_2, $2 ); printf( "

%s%s - %s - %s

\n",\ u, cl, label_1, label_2, $3 ); started = 1; } if ( ( NF == 5 ) && ( $5 ~ "^SCC_CLASS[0-9][0-9]*$" ) ) { sub( "SCC_CLASS", "", $5 ); # This is an end-point for level 4. The number $5 indicates # the ID. Produce a reference to the data. printf( " %s
\n", $5, $4 ); } else if ( ( NF == 4 ) && ( $4 !~ "^SCC_CLASS[0-9][0-9]*$" ) ) { # This level-4 item points to a level-5 sub-menu. # Produce a reference to the sub-menu. cl = sprintf( "cfg_%s_%s_%s_%s", $1, $2, $3, $4 ); gsub( "[ ]", "_", cl ); printf( " %s
\n", cl, $4 ); } }' m="${submenu}" u="${TOP_URL}" ${CATEGORIES} done if [ -f ${IND_FILE} ] then echo "
" # Menu-items produced. fi rm -f ${IND_FILE} # Show the level-5 classifications. # First get al the level-4 submenu items. # Then we process each of them to extract all their corresponding level-5 items. awk -F: '{ # Only print items that have lower level items. if ( ( NF == 4 ) && ( $4 !~ "^SCC_CLASS[0-9][0-9]*$" ) ) { print; } }' ${CATEGORIES} | while read submenu do touch ${IND_FILE} # Indicate that there is a menu-item at this level awk -F: '{ prefix = sprintf( "%s:%s:%s:%s", $1, $2, $3, $4 ); if ( prefix != m ) { next; } cl = sprintf( "cfg_%s_%s_%s_%s", $1, $2, $3, $4 ); gsub( "[ ]", "_", cl ); if ( ! started ) { # Produce the entry-point for this submenu. ref_1=$1; gsub( "[ ]", "_", ref_1 ); label_1=sprintf( "%s", ref_1, $1 ); ref_2 = sprintf( "%s_%s", $1, $2 ); gsub( "[ ]", "_", ref_2 ); label_2=sprintf( "%s", ref_2, $2 ); ref_3 = sprintf( "%s_%s_%s", $1, $2, $3 ); gsub( "[ ]", "_", ref_3 ); label_3=sprintf( "%s", ref_3, $3 ); printf( "

%s%s - %s - %s - %s

\n",\ u, cl, label_1, label_2, label_3, $4 ); started = 1; } if ( ( NF == 6 ) && ( $6 ~ "^SCC_CLASS[0-9][0-9]*$" ) ) { sub( "SCC_CLASS", "", $6 ); # This is an end-point for level 5. The number $6 indicates # the ID. Produce a reference to the data. printf( " %s
\n", $6, $5 ); } # Max. 5 levels, ignore deeper levels. }' m="${submenu}" u="${TOP_URL}" ${CATEGORIES} done if [ -f ${IND_FILE} ] then echo "
" # Menu-items produced. fi # The entire menu-structure has been built. # Show all the data. # To "group" all data per classification, we rewrite the snapshot. # - each "new" snapshot is prefixed by the line: # :0: # - each line of a snapshot is extended with: # :: # By sorting the resulting file, all data with the same classifications are # grouped together, while the order of the lines within a classification # is preserved from the original snapshot. ( sed -e 's/^/class:/' ${CATEGORIES} awk -F":" '{ # Get the classification, ignore the first part: fix/var. class = $2; for ( i = 3; length( $i ) > 0; i++ ) { class = sprintf( "%s - %s", class, $i ); } if ( ! id[ class ] ) { id[ class ] = NR; printf( "%d:0:%s:%s", NR, class, $2 ); for ( i = 3; length( $i ) > 0; i++ ) { printf( ":%s", $i ); } print ""; } printf( "%d:%d:%s\n", id[ class ], NR, $0 ); }' ${TMP_FILE} | sort -t: -n -k 1 -k 2 ) | awk -F":" '/^[0-9]/ { # Here we process the snapshot, prefixed with two numbers to group all data. if ( $2 == 0 ) { # This is the start of a new classification. # Format is: :<0>:
: if ( started ) { print "" general=0; } started = 1; print "
" printf( "

%s", u, id[ $3 ] ); if ( NF > 4 ) { ref=$4; gsub( "[ \\\\]", "_", ref ); printf( "%s", ref, $4 ); } else { printf( "%s", $4 ); } rest=5; if ( NF > 5 ) { rest=6; ref=sprintf( "%s_%s", $4, $5 ); gsub( "[ \\\\]", "_", ref ); printf( " - %s", ref, $5 ); } if ( NF > 6 ) { rest=7; ref=sprintf( "%s_%s_%s", $4, $5, $6 ); gsub( "[ \\\\]", "_", ref ); printf( " - %s", ref, $6 ); } if ( NF > 7 ) { rest=8; ref=sprintf( "%s_%s_%s_%s", $4, $5, $6, $7 ); gsub( "[ \\\\]", "_", ref ); printf( " - %s", ref, $7 ); } for ( i = rest; length( $i ) > 0; i++ ) { printf( " - %s", $i ); } print "

"; print "
"
		if ( $3 == "general" )
		{
			general=1;
		}
		next;
	}

	# Format is: ::::

	# Remove the classification; everything up to the first "::"
	sub( "::", ":DeLeTeToThIsPoInT:" );
	sub( ".*:DeLeTeToThIsPoInT:", "" );

	if ( general )
	{
		gsub( "^[ 	]*", "", $2 );
		printf( "%-25s: %s", $1, $2 );
		for ( i = 3; i <= NF; i++ )
		{
			printf( ":%s", $i );
		}
		print "";
	}
	else
	{
		print;
	}
	next;
}
/^class/	{
		# Here we process the contents of ${CATEGORIES} (with "class" prefixed to each line).
		# Store the ID used with HREF/NAME, format is:
		# class::SCC_CLASS
		class = $2;
		for ( i = 3; i < NF; i++ )
		{
			class = sprintf( "%s - %s", class, $i );
		}
		sub( "SCC_CLASS", "", $NF );
		id[ class ] = $NF;
		next;
	}
END	{
		print "
" }' u="${TOP_URL}" - echo "
" echo "

Generated by SCC (© Open Challenge) on $(date)

" echo "" echo "" exit 0 scc/scc-run/opt/scc/bin/scc_modules/004070000000000000003000000000003777777777700175225ustar00rootsys00000000000000scc/scc-run/opt/scc/bin/scc_modules/scc_0000_s_general010050000000000000003000000162200774770012700226330ustar00rootsys00000000000000#!/bin/sh # Shell script to collect general data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.6 $ . ${SCC_BIN}/scc_modules/scc_utils ## START: GENERAL echo "fix:general::layout-version:1.4.28" echo "fix:general::hostname:${HOSTNAME}" if [ -x /bin/dnsdomainname ] then DOMAIN=$(/bin/dnsdomainname) else DOMAIN=${hostname#*.} if [ "${DOMAIN}" = "${hostname}" -a -f /etc/resolv.conf ] then DOMAIN=$(awk '/^domain/ { print $2 }' /etc/resolv.conf 2>/dev/null | tail -1) fi if [ "${DOMAIN}" = "${hostname}" ] then DOMAIN=$(nslookup ${hostname} 2>/dev/null | sed -n "s/^Name.*${hostname}\.//p") fi fi echo "fix:general::domain:${DOMAIN}" echo "fix:general::OS-name:${OS_NAME}" if [ -x /usr/bin/oslevel ] then release=$(/usr/bin/oslevel) else release=$(uname -r) fi echo "fix:general::OS-release:${release}" echo "fix:general::OS-version-level:$(uname -v)" if [ "${OS_NAME}" = "HP-UX" ] then hpux_trusted=0 if [ -x /usr/lbin/modprpw ] then /usr/lbin/modprpw >/dev/null 2>&1 if [ $? -eq 2 ] then hpux_trusted=1 fi fi echo "fix:general::hpux-trusted:${hpux_trusted}" fi scc_check_file /etc/redhat-release "fix:general::linux-distribution:" "#" scc_check_file /etc/debian_version "fix:general::linux-distribution:" "#" scc_check_file /etc/SuSE-release "fix:general::linux-distribution:" "#" scc_check_file /etc/mandrake-release "fix:general::linux-distribution:" "#" echo "fix:general::nodename:$(uname -n)" echo "fix:general::model-id:$(uname -m)" # RH7.2 installs the MesaDemo in /usr/bin. Program model is part of this demo. if [ -x /usr/bin/model -a "${OS_NAME}" != "Linux" ] then echo "fix:general::model:$(/usr/bin/model)" if [ "${OS_NAME}" = "HP-UX" ] then my_model="$(model | awk -F/ '{ print $NF }')" grep "^${my_model}[ ]*" /usr/sam/lib/mo/sched.models /usr/lib/sched.models 2>/dev/null | head -1 | sed -e 's/^/fix:general::cpu-type:/' fi else if [ "${OS_NAME}" = "SunOS" ] then echo "fix:general::model:$(uname -i | sed -e 's/.*,//')" fi fi if [ -x /usr/bin/hostid ] then # SunOS echo "fix:general::hostid:$(/usr/bin/hostid)" else if [ "${OS_NAME}" != "Linux" ] then echo "fix:general::serial number:$(uname -i 2>/dev/null)" fi fi if [ -x /usr/contrib/bin/machinfo -a "${OS_NAME}" = "HP-UX" ] then /usr/contrib/bin/machinfo | sed -n -e 's/.*machine serial number = /fix:general::Serial Number:/p' fi if [ -x /usr/sbin/bootinfo ] then echo "fix:general::physical key:$(/usr/sbin/bootinfo -k)" echo "fix:general::architecture:$(/usr/sbin/bootinfo -T)" fi echo "fix:general::license:$(uname -l 2>/dev/null)" if [ -x /usr/sbin/psrinfo ] then cpu_cnt=$(/usr/sbin/psrinfo | wc -l) elif [ -x /usr/sbin/lscfg ] then cpu_cnt=$(/usr/sbin/lscfg | grep "^+ proc[0-9]*" | wc -l) elif [ -x /usr/bin/sar ] then cpu_cnt=$(/usr/bin/sar -M 1 1 2>/dev/null | sed -e '1,/idle$/d' -e '/system/d' | wc -l) elif [ -f /proc/interrupts ] then cpu_cnt=$(head -1 /proc/interrupts | wc -w) else cpu_cnt="?" fi echo "fix:general::cpu_cnt:${cpu_cnt##* }" scc_time_zone="" if [ -f /etc/TIMEZONE ] then scc_time_zone=$(sed -n -e 's/^TZ=//p' /etc/TIMEZONE) echo "fix:general::timezone:${scc_time_zone}" elif [ -f /etc/sysconfig/clock ] then sed -e '/^$/d' \ -e 's@^@fix:general::timezone:/etc/sysconfig/clock: @' /etc/sysconfig/clock else date '+%Z' | sed -e 's/^/fix:general::timezone:date:/' fi if [ -x /sbin/runlevel ] then echo "fix:general::runlevel:$(/sbin/runlevel)" elif [ -x /sbin/getrunlvl ] then echo "fix:general::runlevel:$(/sbin/getrunlvl)" else echo "fix:general::runlevel:$(who -r 2>/dev/null | awk '{ print $3 }')" fi if [ -f /tcb/files/auth/system/default ] then # HP-UX trusted system grep ":u_pwd" /tcb/files/auth/r/root elif [ -f /etc/shadow ] then # default shadow password file grep "^root:" /etc/shadow else # old-fashioned password file grep "^root:" /etc/passwd fi | scc_crypt | sed -e 's/^/fix:general::superuser password:/' if [ "${OS_NAME}" = "HP-UX" ] then # /usr/sam/lbin/getmem is not supported and does not work correctly for more than 512MB. pg_size=$(getconf PAGE_SIZE 2>/dev/null) pg_nmbr=$(echo "memory_installed_in_machine/D" | adb ${HPUX_KERNEL} /dev/kmem 2>/dev/null | awk '{ if ( NF == 2 ) print $2 }' ) # pg_nmbr does not include the entries in the Page Deallocation Table. # The shell does not "round" the following calculation, it truncates. # On systems with some pages deallocated, this results in odd memory sizes. # To avoid this, increase the number of "alive" pages with the size of the PDT # (50 on the systems I have seen). # Avoid overflow by dividing $pg_size separately. memory=$(( ( ${pg_nmbr:-0} + 50 ) * ( ${pg_size:-4096} / 1024 ) / 1024 )) echo "fix:general::memory real:${memory} MB" memory=$(dmesg 2>/dev/null | grep '^ *Physical:') if [ "${memory}" ] then # Make this data variable, to avoid that "changes" get logged when # this data disappears from the fixed sized kernel message buffer. echo "var:general::memory real (dmesg):$(echo "${memory}" | awk '{ print $2 }')" echo "var:general::memory lockable (dmesg):$(echo "${memory}" | awk '{ print $5 }')" echo "var:general::memory available (dmesg):$(echo "${memory}" | awk '{ print $8 }')" fi elif [ "${OS_NAME}" = "SunOS" ] then memory="$(dmesg | grep '^mem =' | tail -1)" if [ "${memory}" ] then echo "fix:general::memory real:${memory}" echo "fix:general::memory available:$(dmesg | grep '^avail mem =' | tail -1)" else echo "fix:general::memory real:$(prtconf | sed -n -e 's/^Memory size: //p')" fi elif [ -x /usr/sbin/bootinfo ] then memory=$(( $(/usr/sbin/bootinfo -r) / 1024 )) echo "fix:general::memory real:${memory} MB" elif [ -x /usr/bin/free ] then memory=$(free -b | awk '/^Mem/ { print $2 / ( 1024 * 1024 ) }') echo "fix:general::memory real:${memory} MB" else # Use dd to count the number of 1MB blocks of memory memory=$(dd if=/dev/mem of=/dev/null bs=1024k 2>&1 | sed -n -e 's/+.*records in//p') echo "fix:general::memory real:${memory} MB" fi if [ -x /usr/bin/pagesize ] then echo "fix:general::memory pagesize:$(/usr/bin/pagesize)" fi echo "var:general::uptime:$(uptime | sed -e 's/.* up //' -e 's/,.*//' -e 's/^ *//')" if [ -f /etc/rc.log ] then echo "var:general::rclog:$(ls -l /etc/rc.log)" fi if [ -f /etc/shutdownlog ] then echo "var:general::shutdownlog:$(ls -l /etc/shutdownlog)" fi exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0100_s_boot010050000000000000003000000116500774770012700221640ustar00rootsys00000000000000#!/bin/sh # Shell script to collect boot data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.5 $ . ${SCC_BIN}/scc_modules/scc_utils scc_check_file /etc/bcheckrc "fix:boot:config:/etc/bcheckrc::" "#" scc_check_file /etc/lvmrc "fix:boot:config:/etc/lvmrc::" "#" scc_check_file /etc/pre_init_rc "fix:boot:config:/etc/pre_init_rc::" "#" scc_check_file /etc/rc.config "fix:boot:config:/etc/rc.config::" "#" scc_check_file /etc/rc.d/rc.local "fix:boot:config:/etc/rc.d/rc.local::" "#" scc_check_file /stand/bootconf "fix:boot:config:/stand/bootconf::" "#" scc_check_file /etc/shutdown.allow "fix:boot:config:/etc/shutdown.allow::" "#" scc_check_file /bosinst.data "fix:boot:install:/bostinst.data::" "#" if [ -x /usr/sbin/bootinfo ] then /usr/sbin/bootinfo -b | sed -e 's/^/fix:boot:devices::/' fi if [ -f /etc/lvmtab -a -x /sbin/lvlnboot ] then boot=$(/sbin/lvlnboot -v 2>&1 | awk '/Disk/ { print $1 } ') raw_boot=$(echo "${boot}" | sed -e 's/dsk/rdsk/' -e 's/ .*//') if [ -x /usr/bin/lifcp ] then for b in ${raw_boot} do /usr/bin/lifcp "${b}:AUTO" ${TMP1_FILE} 2>${TMP1_FILE} if [ -f ${TMP1_FILE} ] then tr -d "\000" <${TMP1_FILE} | sed -e "s@^@fix:boot:device:${b}::autoboot: @" fi rm -f ${TMP1_FILE} # Remove the date and time. This reduces the amount of # differences when comparing snapshots of different # systems /usr/bin/lifls -l "${b}" | sed -e 's@../../.. *..:..:.. *$@@' \ -e "s@^@fix:boot:device:${b}::lifls: @" done fi # Sometimes the label 'Boot' is replaced by 'PV Name'. # Replace the latter by the first. # Ignore the messages caused by inactive volume groups in a ServiceGuard environment. /sbin/lvlnboot -v 2>&1 | sed -e 's/^PV Name:/Boot:/' \ -e '/Volume group not activated/d' \ -e '/Cannot display volume group/d' \ -e '/is an alternate link/d' \ -e 's/^/fix:boot:info::lvlnboot: /' fi if [ -x /usr/sbin/dmesg -a "${OS_NAME}" = "SunOS" ] then /usr/sbin/dmesg | grep "^root on" | tail -1 | sed -e 's/^/fix:boot:root-device::/' fi if [ -x "/usr/platform/$(uname -m 2>/dev/null)/sbin/eeprom" ] then /usr/platform/$(uname -m 2>/dev/null)/sbin/eeprom | sed -e 's/^/fix:boot:eeprom::/' fi for file in /etc/rc.config.d/* do fname="${file##*/}" # get file basename if [ -f "${file}" -a "${fname}" != "core" ] then if [ "${OS_NAME}" = "HP-UX" -a "${fname##*[.,~\#]}" != "${fname}" ] then # HPUX is strict on the names of files in this directory, check the code in /etc/rc.config continue fi awk '/^[ ]*$/ { next } /^[ ]*#/ { next } { print p $0; data_shown=1 } END { if ( ! data_shown ) { # Indicate the presence of this file, even if it contains only # blank/comment lines. Add an empty line. print p; } }' p="fix:boot:rc-file:${file}::" "${file}" fi done for file in /etc/sysconfig/* do scc_check_file "${file}" "fix:boot:sysconfig:${file}::" "#" done for file in /etc/default/* do scc_check_file "${file}" "fix:boot:defaults:${file}::" "#" done if [ -x /usr/sbin/prtconf ] then /usr/sbin/prtconf -V | sed -e 's/^/fix:boot:firmware::prtconf: /' fi scc_check_file /etc/inittab "fix:boot:file:/etc/inittab::" "#" scc_check_file /boot/grub/device.map "fix:boot:grub:/boot/grub/device.map::" "#" scc_check_file /boot/grub/menu.lst "fix:boot:grub:/boot/grub/menu.lst::" "#" if [ -x /sbin/lilo ] then /sbin/lilo -q -v 2>/dev/null | sed -e 's/^/fix:boot:lilo::/' fi scc_check_file /proc/cmdline "fix:boot:kernel /proc/cmdline::" "#" for dir in /sbin/rc*.d /etc/rc?.d /etc/rc.d/rc?.d do # On RH7 /etc/rc?.d are symlinks to /etc/rc.d/rc?.d if [ -h "${dir}" -o ! -d "${dir}" ] then continue fi ls -l "${dir}" | awk '{ if ( NF < 8 ) { next; } if ( $(NF-1) == "->" ) { print $(NF-2), $(NF-1), $NF; } else { print $NF; } }' | sed -e "s@^@fix:boot:runlevel:${dir}::@" done if [ -x /usr/sbin/setboot ] then /usr/sbin/setboot >${TMP1_FILE} scc_check_file "${TMP1_FILE}" "fix:boot:stable-storage::" "#" rm -f ${TMP1_FILE} fi exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0200_s_hardware010050000000000000003000000474460774770012700230330ustar00rootsys00000000000000#!/bin/sh # Shell script to collect hardware data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.15 $ . ${SCC_BIN}/scc_modules/scc_utils if [ -x /opt/hparray/bin/arraydsp ] then /opt/hparray/bin/arraydsp -i -S 2>/dev/null | awk -F: '{ # Format of input is: I:::..: # No array: I: for ( i = 2; i <= NF; i++ ) { if ( length( $i ) > 1 ) { print $i; } } }' | while read id remainder do touch ${TMP1_FILE} /opt/hparray/bin/arraydsp -l -S ${id} | sed -e "s/:${id}[:0]*$//" \ -e "s/^/fix:hardware:AutoRAID:${id}:lun::/" /opt/hparray/bin/arraydsp -d -S ${id} | sed -e "s/:${id}[:0]*$//" \ -e "s/^/fix:hardware:AutoRAID:${id}:disk::/" /opt/hparray/bin/arraydsp -c ${id} | sed -e '/^ *$/d' \ -e 's/^ //' \ -e "s/^/fix:hardware:AutoRAID:${id}:controller::/" /opt/hparray/bin/arraydsp -s ${id} | sed -e '/^ *$/d' \ -e 's/^ //' \ -e "s/^/fix:hardware:AutoRAID:${id}:general::/" /opt/hparray/bin/arraydsp -v ${id} | sed -e '/^ *$/d' \ -e 's/^ //' \ -e "s/^/var:hardware:AutoRAID:${id}:capacity::/" /opt/hparray/bin/arraydsp -h ${id} | sed -e '/^ *$/d' \ -e 's/^ //' \ -e "s/^/fix:hardware:AutoRAID:${id}:hardware-status::/" done if [ ! -f ${TMP1_FILE} ] then echo "fix:hardware:AutoRAID:hardware::absent" fi rm -f ${TMP1_FILE} [ ${SCC_PROFILING} ] && scc_timing "end of: hardware: AutoRAID" fi if [ -x /usr/sbin/cfgadm ] then # Replace the value in the "busy" column to avoid differences. cfgadm -lav 2>/dev/null | sed -e 's/ [ny] / - /' \ -e 's/^/fix:hardware:cfgadm::/' fi if [ -x /usr/sbin/psrinfo ] then /usr/sbin/psrinfo -v | sed -e '/^Status/d' \ -e '/since/d' \ -e 's/^/fix:hardware:cpu psrinfo::/' fi scc_check_file /proc/cpuinfo "fix:hardware:cpu /proc/cpuinfo::" "#" | sed -e 's/fix:\(.*:cpu MHz\)/var:\1/' \ -e 's/fix:\(.*:bogomips\)/var:\1/' scc_check_file /proc/dma "fix:hardware:DMA /proc/dma::" "#" if [ -x /opt/hparray/bin/amdsp ] then /opt/hparray/bin/amdsp -i -S 2>/dev/null | awk -F: '{ # Format of input is: I:::::.. # Skip the aliases for ( i = 2; i <= NF; i += 2 ) { if ( length( $i ) > 1 ) { print $i; } } }' | while read id remainder do touch ${TMP1_FILE} /opt/hparray/bin/amdsp -l -S ${id} | sed -e "s/:${id}[:0]*$//" \ -e "s/^/fix:hardware:FC60-array:${id}:lun::/" /opt/hparray/bin/amdsp -d -S ${id} | sed -e "s/:${id}[:0]*$//" \ -e "s/^/fix:hardware:FC60-array:${id}:disk::/" /opt/hparray/bin/amdsp -c ${id} | sed -e '/^ *$/d' \ -e 's/^ //' \ -e '/Controller Date/d' \ -e '/Controller Time/d' \ -e "s/^/fix:hardware:FC60-array:${id}:controller::/" /opt/hparray/bin/amdsp -g ${id} | sed -e '/^ *$/d' \ -e 's/^ //' \ -e "s/^/fix:hardware:FC60-array:${id}:diskgroup::/" /opt/hparray/bin/amdsp -r ${id} | sed -e '/^ *$/d' \ -e 's/^ //' \ -e "s/^/fix:hardware:FC60-array:${id}:rebuild::/" /opt/hparray/bin/amdsp -s ${id} | sed -e '/^ *$/d' \ -e 's/^ //' \ -e "s/^/fix:hardware:FC60-array:${id}:general::/" /opt/hparray/bin/amdsp -h ${id} | sed -e '/^ *$/d' \ -e 's/^ //' \ -e "s/^/fix:hardware:FC60-array:${id}:hardware-status::/" done if [ ! -f ${TMP1_FILE} ] then echo "fix:hardware:FC60-array:hardware::absent" fi rm -f ${TMP1_FILE} [ ${SCC_PROFILING} ] && scc_timing "end of: hardware: FC60-array" fi if [ -x /usr/bin/graphinfo -a -c /dev/crt ] then graphinfo /dev/crt | sed -e '/^$/d' \ -e '/^OS\/SOFTWARE VERSIONS/,$d' \ -e 's/^/fix:hardware:graphics::/' fi scc_check_file /etc/opt/sicl/hwconfig.cf "fix:hardware:HP IO libraries hwconfig.cf::" "#" if [ -x /usr/contrib/bin/machinfo -a "${OS_NAME}" = "HP-UX" ] then /usr/contrib/bin/machinfo | sed -e 's/^/fix:hardware:machinfo::/' fi if [ -x /usr/sbin/parstatus ] then parstatus 2>/dev/null | sed -e 's/^/fix:hardware:partitions::/' fi if [ -x /usr/sbin/vparstatus ] then # TODO: I have not yet tested the output, so all output is var. vparstatus -w 2>/dev/null | sed -e 's/^/var:hardware:Vpartitions::/' # TODO: I have not yet tested the output, so all output is var. vparstatus -v 2>/dev/null | sed -e 's/^/var:hardware:Vpartitions::/' fi ARMDSP=/opt/sanmgr/commandview/client/sbin/armdsp if [ -x ${ARMDSP} ] then rm -f ${TMP1_FILE} ${TMP2_FILE} ${ARMDSP} -i | tee ${TMP1_FILE} | sed -e '/^#/d' \ -e '/^[ ]*$/d' \ -e 's/^/fix:hardware:SAN:devices::/' awk '/Serial Number:/ { print $NF }' ${TMP1_FILE} | sort | while read SN do ${ARMDSP} "${SN}" > ${TMP2_FILE} SNalias="$(awk -F_ '/^Alias:/ { print $NF}' ${TMP2_FILE})" [ -n "${SNalias}" ] && SN="${SNalias}" awk '/Last Event Log/ { printf( "var:hardware:SAN:%s::%s\n", l, $0 ); next } { printf( "fix:hardware:SAN:%s::%s\n", l, $0 ); next }' l="${SN} overview" ${TMP2_FILE} ${ARMDSP} -a "${SN}" | awk 'BEGIN { var = 0 } /Scrub State:/ { var = 1 } /Last Event Log/ || /Voltage/ || /mAh$/ || /Remaining Capacity/ || var == 1 { printf( "var:hardware:SAN:%s::%s\n", l, $0 ); next } { printf( "fix:hardware:SAN:%s::%s\n", l, $0 ); next }' l="${SN} details" done fi rm -f ${TMP1_FILE} ${TMP2_FILE} 2> /dev/null ## Added by Paul te Vaanholt for EMC Symmetrix machines # Edit scc-localize to change the default setting of this variable. SYMCLI=${SYMCLI:-/usr/symcli/bin} if [ -x ${SYMCLI}/symdev ] then ${SYMCLI}/symdev list | sed -e "s/^/fix:hardware:emc symmetrix:devices::/" fi if [ -x ${SYMCLI}/symdg ] then ${SYMCLI}/symdg -v list | sed -e "s/^/fix:hardware:emc symmetrix:device groups::/" fi if [ -x ${SYMCLI}/symdg -a -x ${SYMCLI}/symmir ] then ${SYMCLI}/symdg list | grep -v -e "D E V I C E" -e "Num of" -e "Symmetrix" | awk 'NF > 5 { print $1 }' | while read DG do ${SYMCLI}/symmir -g ${DG} query | sed "s/^/var:hardware:emc symmetrix:mirror state::/" done fi if [ -x /sbin/sysctl ] then sysctl -a | sed -n -e "s/^dev\./fix:hardware:sysctl::dev./p" | sort fi if [ -x /opt/fcms/bin/fcmsutil ] then for dev in /dev/fcms* /dev/td* do if [ -c "${dev}" ] then /opt/fcms/bin/fcmsutil "${dev}" | sed -e '/Number of Assisted IOs/d' \ -e '/Number of Active Login/d' \ -e '/^[ ]*$/d' \ -e "s@^@fix:hardware:TACHYON-interface:${dev}::@" fi done fi if [ -x /usr/sbin/icod_stat ] then /usr/sbin/icod_stat -p 2>/dev/null | sed -e 's/^/fix:hardware:Instant Capacity on Demand::/' fi scc_check_file /proc/scsi/scsi "fix:hardware:scsi:/proc/scsi/scsi::" "#" scc_check_file /proc/scsi/sg/host_strs "fix:hardware:scsi:/proc/scsi/sg/host_strs::" "#" if [ -x /usr/sbin/luxadm ] then # Sun Enterprise Network Array /usr/sbin/luxadm probe 2>/dev/null | sed -e 's/^/fix:hardware:SENA:probe::/' /usr/sbin/luxadm -e port 2>/dev/null | sed -e 's/^/fix:hardware:SENA:port::/' /usr/sbin/luxadm probe 2>/dev/null | sed -n -e 's/^SENA.*Name:\([^ ]*\) .*/\1/p' | sort | while read enclosure remainder do /usr/sbin/luxadm display ${enclosure} | sed -e "/Temperature sensors/,/ temperatures /d" \ -e "/Interconnect assembly/,/Language/d" \ -e "s/^/fix:hardware:SENA:${enclosure}:display::/" done fi scc_check_file /etc/path_to_inst "fix:hardware:devices:/etc/path_to_inst::" "#" scc_check_file /etc/name_to_major "fix:hardware:devices:/etc/name_to_major::" "#" scc_check_file /etc/devlink.tab "fix:hardware:devices:/etc/devlink.tab::" "#" scc_check_file /etc/dacf.conf "fix:hardware:devices:/etc/dacf.conf::" "#" scc_check_file /etc/dgroup.tab "fix:hardware:devices:/etc/dgroup.tab::" "#" # On our RedHat 6.2 system, some 6000 device files are present. # Too much data, ignore for the time being. if [ "${OS_NAME}" != "Linux" ] then { if [ -x /usr/sbin/lsdev -a "${OS_NAME}" = "HP-UX" ] then # Get the major device numbers for the "variable" ownership devices. /usr/sbin/lsdev | sed -n -e 's/^[ ]*//' \ -e 's/ .*pt[ms]$//p' \ -e 's/ .*pty[ms]$//p' \ -e 's/ .*tel[ms]$//p' \ -e 's/ .*tty$//p' fi { # Ignore the file-descriptor devices on SunOS. find /dev -type b -o -type c | fgrep -v "/dev/fd/" if [ -d /devices ] # SunOS then find /devices -type b -o -type c fi } | sort | xargs ls -ld | sed -e 's/,/ /' } | awk '{ if ( NF == 1 ) { # Here we process the list of major device numbers with # "variable" ownership of the device-files. variable[ $1 ] = 1; cnt_variable++; next; } cnt=split( $NF, parts, "/" ); dir="/dev" if ( cnt > 3 ) { dir=sprintf( "/%s/%s", parts[ 2 ], parts[ 3 ] ); } if ( cnt_variable > 0 ) { if ( variable[ $5 ] == 0 ) { # This is fixed. printf( "fix:hardware:device-files:%s::%s: %s %2s %8.8s %8.8s %4s %s\n",\ dir, $NF, $1, $2, $3, $4, $5, $6 ); break; } } # Treat permission, owner and group as variable. # For tty-device files these properties depend on the # current user that is logged in on the device. # Name, link-count, major and minor number are fixed. printf( "fix:hardware:device-files:%s::%s: %2s %4s %s\n",\ dir, $NF, $2, $5, $6 ); # permissions, owner and group are variable. printf( "var:hardware:device-files:%s::%s: %s %8.8s %8.8s\n",\ dir, $NF, $1, $3, $4 ); }' fi if [ -x /usr/bin/raw ] then /usr/bin/raw -qa 2>/dev/null | sed -e 's/^/fix:system:raw device::/' fi scc_check_file /etc/device.tab "fix:hardware:devices:/etc/device.tab::" "#" scc_check_file /var/adm/sbtab "fix:hardware:disk:/var/adm/sbtab::" "#" ls /dev/rdsk 2>/dev/null | grep "0$" | sort | while read disk remainder do if [ -x /usr/sbin/diskinfo ] then /usr/sbin/diskinfo -v /dev/rdsk/${disk} 2>/dev/null | sed -e '/Additional inquiry/d' \ -e "s/^/fix:hardware:disk:${disk}::diskinfo: /" fi if [ -x /usr/sbin/lssf ] then /usr/sbin/lssf /dev/rdsk/${disk} 2>/dev/null | sed -e "s/^/fix:hardware:disk:${disk}::lssf: /" fi if [ -x /usr/sbin/prtvtoc ] then /usr/sbin/prtvtoc /dev/rdsk/${disk} 2>/dev/null | sed -e "s/^/fix:hardware:disk:${disk}::prtvtoc: /" fi if [ -x /usr/sbin/format -a "${OS_NAME}" = "SunOS" ] then # Remove the slice-ID from the device-name dsk=$(echo ${disk} | sed -e 's/s0$//') printf "inquiry\npartition\nprint\nquit\nquit\n" | /usr/sbin/format -d ${dsk} 2>&1 | awk '/^Warning/ { next } /^[ ]*$/ { next } /^format>/ { show = 1; prefix="format: " } /^format> $/ { show = 0 } /^partition> Current / { show = 1; prefix="partition: "; partition = 1 } /^partition> $/ { show = 0 } /^ 2 / { if ( partition ) size=$7 } { if ( show) print "fix:hardware:disk:" d "::" prefix $0 } END { if ( length( size ) > 0 ) print "fix:hardware:disk:" d "::size: " size }' d=${dsk} fi if [ -x /usr/sbin/pvdisplay -o -x /sbin/pvdisplay ] then pvdisplay /dev/dsk/${disk} >/dev/null 2>${TMP1_FILE} if [ -s ${TMP1_FILE} ] then grep -q "find the volume group" ${TMP1_FILE} if [ $? -eq 0 ] then echo "fix:hardware:disk:${disk}::LVM: absent" else echo "fix:hardware:disk:${disk}::LVM: messages:present" fi else echo "fix:hardware:disk:${disk}::LVM: present" fi rm -f ${TMP1_FILE} fi if [ -x /usr/sbin/scsictl ] then /usr/sbin/scsictl -a /dev/rdsk/${disk} 2>/dev/null | sed -e "s/^/fix:hardware:disk:${disk}::scsictl: /" fi done if [ -x /sbin/fdisk ] then df -l | sed -n -e 's@^/dev/\([hs]d.\).*@/dev/\1@p' | sort -u | while read dsk remainder do /sbin/fdisk -l -u ${dsk} 2>/dev/null | sed -e '/^[ ]*$/d' \ -e "s@^@fix:hardware:disk:${dsk##*/}::fdisk: @" done fi for d in /proc/ide/hd* do if [ -d "${d}" ] then disk=$(basename "${d}") scc_check_file "${d}/model" "fix:hardware:disk:${disk}::model: " "#" scc_check_file "${d}/driver" "fix:hardware:disk:${disk}::driver: " "#" scc_check_file "${d}/geometry" "fix:hardware:disk:${disk}::geometry: " "#" scc_check_file "${d}/settings" "fix:hardware:disk:${disk}::settings: " "#" fi done scc_check_file "/proc/ide/drivers" "fix:hardware:disk:/proc/ide/drivers::" "#" if [ -x /sbin/irdiag ] then # I20 internal raid # TODO: I have not yet tested the output, so all output is var. /sbin/irdiag -v 2>&1 | sed -e 's/^/var:hardware:I20 internal raid::/' fi if [ -x /usr/lib/osa/bin/lad -a -x /usr/lib/osa/bin/drivutil ] then /usr/lib/osa/bin/lad 2>/dev/null | sed -e 's/^/fix:hardware:RaidManager:lad::/' /usr/lib/osa/bin/lad 2>/dev/null | sort | while read dev remainder do if [ -z "${dev}" ] then continue; fi /usr/lib/osa/bin/raidutil -c ${dev} -i 2>/dev/null | sed -e '/^[ ]*$/d' \ -e '/succeeded/d' \ -e "s/^/fix:hardware:RaidManager:${dev}:raidutil::/" /usr/lib/osa/bin/drivutil -I ${dev} 2>/dev/null | sed -e '/^[ ]*$/d' \ -e '/succeeded/d' \ -e "s/^/fix:hardware:RaidManager:${dev}:drive group::/" /usr/lib/osa/bin/drivutil -d ${dev} 2>/dev/null | sed -e '/^[ ]*$/d' \ -e '/succeeded/d' \ -e "s/^/fix:hardware:RaidManager:${dev}:drives per group::/" /usr/lib/osa/bin/drivutil -i ${dev} 2>/dev/null | sed -e '/^[ ]*$/d' \ -e '/succeeded/d' \ -e "s/^/fix:hardware:RaidManager:${dev}:drive::/" /usr/lib/osa/bin/drivutil -l ${dev} 2>/dev/null | sed -e '/^[ ]*$/d' \ -e '/succeeded/d' \ -e "s/^/fix:hardware:RaidManager:${dev}:LUN::/" done fi for f in /etc/osa/rmparams /etc/osa/mnf /usr/lib/osa/rdac_address do scc_check_file ${f} "fix:hardware:RaidManager:${f}::" "#" done if [ -x /usr/lib/osa/bin/healthck ] then /usr/lib/osa/bin/healthck -a 2>/dev/null | sed -e '/^[ ]*$/d' \ -e '/succeeded/d' \ -e 's/^/var:hardware:RaidManager:healthck::/' fi scc_check_file "/etc/raid/rmparams" "fix:hardware:RAID manager:/etc/raid/rmparams::" "#" scc_check_file "/etc/raidtab" "fix:hardware:software RAID:/etc/raidtab::" "#" scc_check_file "/proc/mdstat" "var:hardware:software RAID:/proc/mdstat::" "#" [ ${SCC_PROFILING} ] && scc_timing "end of: hardware: disk" # Data Terminal Connectors for dtc in /opt/dtcmgr/sbin/dtclist /opt/rdtcmgr/sbin/rdtclist do if [ ! -x ${dtc} ] then continue fi ${dtc} -c 2>/dev/null | sed -e '/^Error/d' -e '/^[ ]/d' | while read dtc_dev other do ${dtc} -c ${dtc_dev} | tr "\f" " " | sed -e '/^[ ]*$/d' \ -e "s/^/fix:hardware:dtc:${dtc_dev}::/" done done scc_check_file /etc/ddfa/dp "fix:hardware:dtc:/etc/ddfa/dp::" "#" | tee ${TMP1_FILE} if [ -s ${TMP1_FILE} ] then # This file can also contain a message from scc_check_file, select only the contents of the file. # The last field of each line contains the name of a configuration file. sed -n -e 's/[ ]*$//' \ -e 's/^fix:hardware:dtc:.*[ ]//p' ${TMP1_FILE} | while read file do scc_check_file "${file}" "fix:hardware:dtc:${file}::" "#" done fi rm -f ${TMP1_FILE} if [ -f /proc/interrupts ] then awk '{ if ( NR == 1 ) { num_cpu=NF; next; } print $1, $(2+num_cpu), $(3+num_cpu) }' /proc/interrupts | sed -e '/^$/d' \ -e 's@^@fix:hardware:/proc/interrupts::@' fi scc_check_file /proc/ioports "fix:hardware:/proc/ioports::" "#" scc_check_file /etc/kbdlang "fix:hardware:/etc/kbdlang::" "#" if [ -x /usr/bin/getdev ] then /usr/bin/getdev | while read device remainder do devattr -v ${device} | sed -e "s/^/fix:hardware:devattr:${device}::devattr: /" done fi if [ -x /usr/bin/getconf ] then for c in CS_MACHINE_SERIAL CLK_TCK CPU_CHIP_TYPE \ HW_CPU_SUPP_BITS HW_32_64_CAPABLE KERNEL_BITS do echo "fix:hardware:getconf::${c}: $(/usr/bin/getconf ${c} 2>/dev/null)" done fi if [ -x /usr/bin/isalist ] then /usr/bin/isalist | sed -e 's/^/fix:hardware:instruction set:isalist::/' fi if [ -x /usr/bin/isainfo ] then /usr/bin/isainfo -bv | sed -e 's/^/fix:hardware:instruction set bits:isainfo::/' fi if [ -x /usr/sbin/lscfg ] then /usr/sbin/lscfg -v | sed -e '/^[ ]*$/d' \ -e 's/^/fix:hardware:lscfg::/' fi if [ -x /usr/sbin/prtconf ] then /usr/sbin/prtconf -v | sed -e 's/^/fix:hardware:prtconf::/' fi if [ -f /proc/meminfo ] then grep Total /proc/meminfo | sed -e 's@^@fix:hardware:memory /proc/meminfo::@' fi file=/etc/X11/XF86Config if [ /etc/XF86Config -nt ${file} ] then file=/etc/XF86Config fi scc_check_file "${file}" "fix:hardware:monitor:${file}::" "#" if [ -x /usr/sbin/ioscan ] then # On some systems you may want to ignore NO_HW, for example on backup servers in SAN # environments. Depending on IGNORE_NO_HW, the sed params are changed # Edit scc-localize to change the default setting of this variable. IGNORE_NO_HW=${IGNORE_NO_HW:-0} /usr/sbin/ioscan -fn 2>${TMP1_FILE} | if [ ${IGNORE_NO_HW} -eq 1 ] then sed -e 's/^/fix:hardware:ioscan::/' -e 's/NO_HW /CLAIMED/' else sed -e 's/^/fix:hardware:ioscan::/' fi scc_check_file "${TMP1_FILE}" "fix:hardware:ioscan::messages: " "#" rm -f ${TMP1_FILE} [ ${SCC_PROFILING} ] && scc_timing "end of: hardware: ioscan" elif [ -f /etc/sysconfig/hwconf ] then scc_check_file /etc/sysconfig/hwconf "fix:hardware:/etc/sysconfig/hwconf::" "-" fi if [ -x /usr/bin/rad ] then # Online adding and replacement (HP-UX). /usr/bin/rad -q 2>/dev/null | sed -e '/^[ ]*$/d' \ -e 's/^/fix:hardware:OLA:overview::/' ls -l /usr/sbin/olrad.d 2>/dev/null | scc_ls | sed -e '/^total/d' \ -e 's@^@fix:hardware:OLA:/usr/sbin/olrad.d::@' /usr/bin/rad -q 2>/dev/null | grep "^[0-9].*Yes" | while read slot remainder do /usr/bin/rad -c ${slot} 2>/dev/null | sed -e '/^[ ]*$/d' \ -e "s/^/fix:hardware:OLA:${slot}::/" done fi if [ -x /sbin/lspci ] then /sbin/lspci -vv | sed -e 's/^/fix:hardware:pci-devices lspci::/' else scc_check_file /proc/pci "fix:hardware:pci-devices /proc/pci::" "#" fi scc_check_file /etc/power.conf "fix:hardware:power management::/etc/power.conf: " "#" if [ -x "/usr/platform/$(uname -m 2>/dev/null)/sbin/prtdiag" ] then /usr/platform/$(uname -m 2>/dev/null)/sbin/prtdiag -v | sed -e 's/^/var:hardware:prtdiag::/' fi if [ -x /usr/sbin/cstm ] then # When diagmond is not running, cstm will loop. grep -q diagmond ${PROC_FILE} if [ $? -eq 0 ] then # stm often hangs during install. As the stm-data is variable in the snapshot, # it does not matter for the logboook. Skipping stm during installation, will also # speed up the installation. SD-UX uses the variable SW_CONTROL_TAG, check this variable # to find out whether this script is called during installation. # Edit scc-localize to change the default setting of this variable. if [ -z "${SCC_IGNORE_STM}" ] then ( echo "selall" echo "info" echo "wait" echo "infolog" echo "Done" echo "quit" echo "OK" ) | /usr/sbin/cstm 2>/dev/null | awk 'BEGIN { path="intro" } /^-- Information Tool Log for .* on path .*/ { path=$(NF-1); } /^-- Information Tool Log for each selected device --/ { path="trailer"; } /^ *$/ { next } { print "var:hardware:stm:" path "::" $0; }' [ ${SCC_PROFILING} ] && scc_timing "end of: hardware: stm" fi else echo "fix:hardware:stm:general::messages:stm skipped, diagmond is not running" fi fi if [ -x /sbin/lsusb ] then /sbin/lsusb -vv 2>/dev/null | sed -e "s/^/fix:hardware:usb::/" fi exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0300_s_kernel010050000000000000003000000115610774770012700225040ustar00rootsys00000000000000#!/bin/sh # Shell script to collect kernel data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.10 $ . ${SCC_BIN}/scc_modules/scc_utils scc_check_file /etc/system "fix:kernel:/etc/system::" "\*" scc_check_file /stand/kernrel "fix:kernel:/stand/kernrel::" "#" scc_check_file /stand/system "fix:kernel:/stand/system::" "#" for f in ioconfig rootconf vmunix do if [ -f /stand/${f} ] then echo "fix:kernel:/stand/${f}::cksum: $(cksum /stand/${f})" fi done if [ "${OS_NAME}" = "HP-UX" ] then # For HP-UX 10.20 this will not work when we are not # running the default kernel: /stand/vmunix. In that case # other programs like ioscan and lanscan will not work either and the # snapshot will be incomplete. # We do not correct for this particular case. echo 'boot_string/S' | /usr/bin/adb "${HPUX_KERNEL}" /dev/kmem 2>/dev/null | sed -n -e 's/^/fix:kernel:boot-disk::/' \ -e 's@/@/@p' # Ignore header files. On HP-UX 11i, some header files occur very often. /usr/bin/what ${HPUX_KERNEL} | sed -e 's/^[ ]*//' \ -e '/^$/d' \ -e '/\.h[ ]/d' \ -e "s@^@fix:kernel:${HPUX_KERNEL}::@" | sort fi if [ -x /usr/sbin/lsdev ] then options="" if [ "${OS_NAME}" = "AIX" ] then options="-C -H" fi /usr/sbin/lsdev ${options} 2>/dev/null | sed -e 's/^/fix:kernel:lsdev::/' fi if [ -f /stand/system -a -x /usr/lbin/sysadm/system_prep ] then /usr/lbin/sysadm/system_prep -s ${TMP1_FILE} >/dev/null cmp -s ${TMP1_FILE} /stand/system if [ $? -eq 0 ] then echo "fix:kernel:mk_kernel::status: ${HPUX_KERNEL}-/stand/system identical" else echo "fix:kernel:mk_kernel::status: ${HPUX_KERNEL}-/stand/system different" diff ${TMP1_FILE} /stand/system | sed -e '/^[0-9\-]/d' \ -e "s@< @fix:kernel:mk_kernel::/usr/conf/master.d :@" \ -e "s@> @fix:kernel:mk_kernel::/stand/system :@" fi rm -f ${TMP1_FILE} fi if [ -x /usr/sbin/kmadmin ] then /usr/sbin/kmadmin -s | sed -e 's/^/fix:kernel:kmadmin:short::/' /usr/sbin/kmadmin -S | sed -e 's/^/var:kernel:kmadmin:full::/' fi if [ -x /usr/sbin/kmsystem ] then /usr/sbin/kmsystem | sed -e 's/^/fix:kernel:kmsystem::/' fi if [ -x /usr/sbin/kmtune ] then # Dynamic variables can be altered without rebooting. # They are treated as fix as we want to know when they are changed. /usr/sbin/kmtune -l | awk '/^$/ { printf( "fix:kernel:kmtune:%s\n", parms ); parms=""; next } { parms=sprintf( "%s:%s", parms, $2 ); } END { if ( length( parms ) > 0 ) { printf( "fix:kernel:kmtune:%s\n", parms ); } }' fi if [ -x /sbin/ksyms ] then # Remove the offset. /sbin/ksyms -m | sed -e 's/^[^ ][^ ]* *//' \ -e 's/^/var:kernel:modules:ksyms::/' fi if [ -x /usr/sbin/modinfo ] then /usr/sbin/modinfo | sed -e 's/^/var:kernel:modules:modinfo::/' fi if [ -x /sbin/modprobe ] then /sbin/modprobe -c | sed -e 's/^/fix:kernel:modules:modprobe-config::/' /sbin/modprobe -l | sed -e 's/^/fix:kernel:modules:modprobe-list::/' fi scc_check_file /etc/modules.conf "fix:kernel:modules:/etc/modules.conf::" "#" scc_check_file /etc/conf.modules "fix:kernel:modules:/etc/conf.modules::" "#" for f in /kernel/drv/*.conf do scc_check_file "${f}" "fix:kernel:/kernel/drv:$(basename "${f}")::" "#" done if [ -x /usr/sbin/lsattr ] then /usr/sbin/lsattr -E -l sys0 | sed -e 's/^/fix:kernel:parameters::/' fi if [ -x /usr/sbin/sysdef ] then if [ "${OS_NAME}" = "HP-UX" ] then # Use sysdef only for HP-UX 10.20 as it is being replaced by kmtune. if [ ! -x /usr/sbin/kmtune ] then /usr/sbin/sysdef 2>/dev/null | sort | sed -e '/^bufpages/d' \ -e '/^\*/d' \ -e '/^msgmap/d' \ -e '/^nbuf/d' \ -e '/^semmap/d' \ -e 's/^/fix:kernel:sysdef::/' fi else /usr/sbin/sysdef -D 2>/dev/null | sed -e '/^\//d' \ -e 's/^/fix:kernel:sysdef::/' fi fi if [ -x /sbin/sysctl ] then sysctl -a | sed -n -e '/kernel\.random\./d' \ -e '/kernel\.rtsig-nr/d' \ -e "s/^kernel\./fix:kernel:sysctl::kernel./p" | sort fi exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0400_s_vol_mngt010050000000000000003000000655700774770012700230630ustar00rootsys00000000000000#!/bin/sh # Shell script to collect Volume Management data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.15 $ . ${SCC_BIN}/scc_modules/scc_utils # Determine whether Veritas Volume Manager is installed and active. VXVM_ENABLED=0; export VXVM_ACTIVE if [ -x /usr/sbin/vxdg ] then mode=$(/usr/sbin/vxdctl mode 2>/dev/null) if [ "${mode}" = "mode: enabled" ] then VXVM_ENABLED=1 fi fi if [ "${OS_NAME}" = "HP-UX" ] then bdf -i elif [ "${OS_NAME}" = "Linux" ] then df -k df -i elif [ "${OS_NAME}" = "SunOS" ] then df -g else df -k fi | sed -e 's/^/var:Volume Management:filesystems:survey::/' if [ -x /usr/sbin/lsfs ] then /usr/sbin/lsfs | sed -e 's/^/fix:Volume Management:filesystems:lsfs::/' fi # Erase the "handle" that is attached to the options (dev=). mount | sort | sed -e 's@/dev=[0-9a-f][0-9a-f]*@@' \ -e 's/ on [A-Z][a-z][a-z] .*//' | awk '{ prefix="fix:Volume Management:filesystems:mount::" if ( $3 ~ ".*:.*" || $3 ~ "^/vol" || $3 ~ "^/export" ) { prefix="var:Volume Management:filesystems:mount::" } print prefix $0; }' if [ -f /etc/filesystems ] then awk '/^\*/ { next } /^[ ]*$/ { next } /^\// { fs = $1; next } { printf( "fix:Volume Management:filesystems:file:/etc/filesystem::%s%s\n",\ fs, $0 ); }' /etc/filesystems fi scc_check_file /etc/vfs "fix:Volume Management:filesystems:file:/etc/vfs::" "#" if [ -f /etc/fstab ] then scc_check_file /etc/fstab "fix:Volume Management:filesystems:file:/etc/fstab::" "#" | sort elif [ -f /etc/vfstab ] then scc_check_file /etc/vfstab "fix:Volume Management:filesystems:file:/etc/vfstab::" "#" fi scc_check_file /etc/exports "fix:Volume Management:filesystems:file:/etc/exports::" "#" if [ -x /usr/sbin/share ] then /usr/sbin/share | sed -e 's/^/fix:Volume Management:filesystems:share-exports::/' elif [ -x /usr/sbin/exportfs ] then /usr/sbin/exportfs | sed -e 's/^/fix:Volume Management:filesystems:exportfs::/' else scc_check_file /etc/dfs/dfstab "fix:Volume Management:filesystems:file:/etc/dfs/dfstab::" "#" fi scc_check_file /etc/dfs/dfstypes "fix:Volume Management:filesystems:file:/etc/dfs/dfstypes::" "#" scc_check_file /etc/nfs/nfslog.conf "fix:Volume Management:filesystems:file:/etc/nfs/nfslog.conf::" "#" scc_check_file /etc/nfssec.conf "fix:Volume Management:filesystems:file:/etc/nfssec.conf::" "#" # SunOS and Linux have different automounter files. for master in /etc/auto_master /etc/auto.master do if [ ! -f ${master} ] then continue fi # Show the contents of the file. scc_check_file "${master}" "fix:Volume Management:filesystems:automounter:${master}::" "#" # Show the contents of the contained maps or files. sed -e '/^#/d' \ -e '/^[ ]*$/d' \ -e 's/_/./' \ -e 's/^+//' "${master}" | sort | while read nismap file do # We deal with the case of a file, not a NIS-map. case "${nismap}" in /*) scc_check_file "${file}" "fix:Volume Management:filesystems:automounter:${file}::" "#" continue;; esac # Here we deal with the case of a NIS-map. ypcat ${nismap} 2>/dev/null | sed -e "s/^/fix:Volume Management:filesystems:automounter:map ${nismap}::/" # Process the contents of the map. ypcat ${nismap} 2>/dev/null | sed -e '/^#/d' \ -e '/^[ ]*$/d' \ -e '/^\//d' \ -e 's/^+//' | sort | while read submap remainder do # Show the contents of the submap. ypcat ${submap} 2>/dev/null | sed -e "s/^/fix:Volume Management:filesystems:automounter:submap ${submap}::/" done done # On SunOS auto.master was used in previous versions of the automounter. # Do not check auto.master when auto_master has been handled. break done scc_check_file /etc/rmmount.conf "fix:Volume Management:filesystems:file:/etc/rmmount.conf::" "#" scc_check_file /etc/vold.conf "fix:Volume Management:filesystems:file:/etc/vold.conf::" "#" # Show the commandline to recreate the filesystem. if [ "${OS_NAME}" = "HP-UX" -o "${OS_NAME}" = "SunOS" ] then mount | sort | sed -n -e 's@^\([^ ][^ ]*\) on /dev@\1 /dev@p' | while read fs device remainder do mkfs -m ${device} 2>/dev/null | sed -e "s@^@fix:Volume Management:filesystems:${fs}::mkfs: @" if [ "${OS_NAME}" = "SunOS" ] then newfs -Nv ${device} 2>/dev/null | sed -e "s@^@fix:Volume Management:filesystems:${fs}::newfs: @" fi done fi if [ "${OS_NAME}" = "HP-UX" ] then df -ln | sort | while read fs remainder do df -g ${fs} 2>/dev/null | sed -e "s@^@var:Volume Management:filesystems:${fs}::@" done elif [ "${OS_NAME}" = "Linux" ] then df -l | awk '/^\// { print $NF }' | sort | while read fs remainder do { df -lP "${fs}" df -lPi "${fs}" } | sed -e "s@^@var:Volume Management:filesystems:${fs}::@" done elif [ "${OS_NAME}" = "AIX" ] then df | awk '/^\// { print $NF }' | sort | while read fs remainder do df -v "${fs}" | sed -e "s@^@var:Volume Management:filesystems:${fs}::@" done else # This part runs on SunOS. Get the names and types and ignore # most data of "variable" filesystems. /usr/sbin/df -ln | sort | while read fs separator type remainder do if [ "${type}" = lofs ] then continue fi /usr/sbin/df -g ${fs} 2>/dev/null | sed -e "s@^@var:Volume Management:filesystems:${fs}::@" done fi if [ -f /etc/mtab ] then # Format is: device mountpoint type options awk '{ print $1, $2, $3 }' /etc/mtab elif [ -f /etc/mnttab ] then # Format is: device mountpoint type options awk '{ print $1, $2, $3 }' /etc/mnttab fi | sort | while read dev mount type remainder do if [ "${type}" = "reiserfs" -a -x /sbin/dumpreiserfs ] then /sbin/dumpreiserfs -m ${dev} 2>&1 | sed -e "s@^@var:Volume Management:filesystems:${mount}::dumpreiserfs: @" fi if [ "${type}" = "ext2" -a -x /sbin/dumpe2fs ] then /sbin/dumpe2fs -h ${dev} 2>&1 | sed -e "s@^@var:Volume Management:filesystems:${mount}::dumpe2fs: @" fi if [ "${type}" = "hfs" -a -x /usr/sbin/tunefs ] then /usr/sbin/tunefs -v ${dev} 2>/dev/null | sed -e "s@^@var:Volume Management:filesystems:${mount}::tunefs: @" fi if [ "${type}" = "vxfs" -a -x /usr/sbin/fsdb ] then echo "8192B.p S" | /usr/sbin/fsdb -F vxfs ${dev} 2>/dev/null | sed -e "s@^@var:Volume Management:filesystems:${mount}::fsdb: @" fi if [ "${type}" = "vxfs" -a -x /sbin/vxtunefs ] then /sbin/vxtunefs ${dev} 2>/dev/null | sed -e "s@^@fix:Volume Management:filesystems:${mount}::vxtunefs: @" fi done [ ${SCC_PROFILING} ] && scc_timing "end of: Volume Management: filesystems" # Collect all the filesystem devices and the swap devices mount -l 2>/dev/null | awk '{ printf( "%s %s\n", $1, $3 ) }' | while read mountp device remainder do type=$(fstyp -v ${device} 2>/dev/null | awk '/^version:/ { v = $2 } { if ( NR == 1 ) t = $1 } END { print t v }') echo "fs_data ${device} ${mountp} ${type}" done >${TMP3_FILE} if [ -x /usr/sbin/swapinfo ] then /usr/sbin/swapinfo 2>/dev/null else /sbin/swapon -s 2>/dev/null fi | sed -n -e "s@.*/dev/@swap /dev/@p" >>${TMP3_FILE} if [ -f /etc/lvmtab ] then vgdisplay -v 2>/dev/null | awk '/Alternate/ { next } # Ignore alternate links /VG Name/ { vg = $NF; sub( "^/dev/", "", vg ); pv = "total"; next } /PE Size/ { pe_s = $NF; next } /PV Name/ { pv = $NF; next } /Free PE/ { if ( $NF > 0 ) { printf( "free:%-10s %-20s %7d MB\n", vg, pv, pe_s * $NF ); } }' >>${TMP3_FILE} sed -n -e 's/^free:/var:Volume Management:free space::LVM: /p' ${TMP3_FILE} fi if [ ${VXVM_ENABLED} -eq 1 ] then /usr/sbin/vxdg -a free | sed -e 's/^/var:Volume Management:free space::VxVM: /' fi if [ -f /etc/lvmtab ] then vgdisplay 2>${TMP1_FILE} | awk -F/ '/VG Name.*dev/ { print $3 }' | sort -u | while read vg remainder do lv_list=$(vgdisplay -v ${vg} 2>/dev/null | sed -n -e "s@.*LV Name.*/dev/.*/@@p" | sort -k 1.5n) pv_list=$(vgdisplay -v ${vg} 2>/dev/null | grep -v "Alternate" | awk -F/ '/PV Name/ { print $4 }' | sort -u) # Volume Management - - general vgdisplay ${vg} 2>/dev/null | sed -e '/^--/d' \ -e '/^$/d' \ -e "s/^/fix:Volume Management:${vg}:general::/" # Volume Management - vg - free space sed -n -e "s/^free:${vg}.*total/fix:Volume Management:${vg}:free space::total/p" ${TMP3_FILE} sed -n -e "s/^free:${vg} //p" ${TMP3_FILE} | grep -v total | while read pv free MB do pvdisplay -v ${pv} 2>/dev/null | sed -e '1,/Physical extents/d' | awk '/ free / { # The first field is a counter for the PE, this field is # limited to 4 positions (prior to 11i). Use NR to count. if ( ! header_shown ) { printf( "fix:%s:%s:free space::%-20s %7d MB %7s %7s %7s\n",\ l, v, p, f, "Cnt PE", "Start", "End" ); header_shown = 1; } if ( ( cnt > 0 ) && ( end != ( NR - 1 - 1 ) ) ) { printf( "fix:%s:%s:free space::%-20s %7s %7d %7d %7d\n",\ l, v, p, " ", cnt, start, end ); cnt = 0; } if ( cnt == 0 ) { start = NR - 1; } end = NR - 1; cnt++; } END { if ( ! header_shown ) { printf( "fix:%s:%s:free space::%-20s %7d MB %7s %7s %7s\n",\ l, v, p, f, "Cnt PE", "Start", "End" ); } if ( ( cnt > 0 ) && ( end != ( $1 - 1 ) ) ) { printf( "fix:%s:%s:free space::%-20s %7s %7d %7d %7d\n",\ l, v, p, " ", cnt, start, end ); } }' l="Volume Management" v="${vg}" p="${pv}" f="${free}" done # while read pv: Volume Management - vg - free space # Volume Management - - LV usage # Summary per LV with usage. for lv in ${lv_list} do lvdisplay /dev/${vg}/${lv} 2>/dev/null | awk '/Mirror copies/ { mirror = "NO"; if ( $NF > 0 ) { mirror = $NF; } next } /LV Size/ { print "lv_data", l, $NF, mirror; next }' l="/dev/${vg}/${lv}" done | awk '/^fs_data/ { fs[ $2 ] = $3; type[ $2 ] = $4; next } /^swap/ { fs[ $2 ] = "-"; type[ $2 ] = "swap"; next } /^lv_data/ { raw = 0; if ( length( type[ $2 ] ) == 0 ) { fs[ $2 ] = "-"; type[ $2 ] = "raw"; raw = 1; } split( $2, parts, "/" ); if ( prev_vg != parts[ 3 ] ) { printf( "fix:%s:%s:LV usage::%-16s %-8s %7s %7s %s\n",\ l, parts[ 3 ], "LV", "FS-type", "Size", "Mirrors", "Mountpoint" ); prev_vg = parts[ 3 ]; } printf( "fix:%s:%s:LV usage::%-16s %-8s %7d MB %7s %s\n",\ l, parts[ 3 ], parts[ 4 ], type[ $2 ], $3, $4, fs[ $2 ] ); if ( raw ) { printf( "fix:%s:%s:general::raw device: %s\n",\ l, parts[ 3 ], $2 ); } }' l="Volume Management" ${TMP3_FILE} - # Volume Management - - LV layout # Summary per LV with mapping of logical extents to physical extents. header_done=0 for lv in ${lv_list} do striped=$(lvdisplay -v /dev/${vg}/${lv} 2>/dev/null | grep "Schedule.*striped") if [ "${striped}" ] then # Striped logical volumes have their extents "scattered" across # several physical volumes. Showing this scattering is not meaningfull. lvdisplay -v /dev/${vg}/${lv} 2>/dev/null | sed -n -e '/Distribution of logical volume/,/^$/p' | sed -e "s/^[ ]*/fix:Volume Management:${vg}:LV layout::${lv} /" continue fi lvdisplay -v /dev/${vg}/${lv} 2>/dev/null | sed -e '1,/Logical extents/d' | awk '{ if ( NR == 1 ) { label = sprintf( "fix:%s:%s:LV layout", l, v ); if ( ! h ) { printf( "%s::%-16s ", label, "LV" ); printf( "%-8.8s %7.7s %7.7s %7.7s \n",\ "Disk", "Cnt PE", "start", "end" ); } next; } printed = 0; # Layout: # 00000 /dev/dsk/c2t3d0 00156 current for ( i = 2; i <= NF; i += 3 ) { data_shown[ i ] = 0; sub( "/dev/dsk/", "", $i ); nr_f = NF; # Keep for the end-statement if ( ( row[ $i ] > 0 ) && ( row[ $i ] != i ) ) { printf( "fix:messages::%s WARNING for mirroring %s on disk: %s\n", l, $i ); } if ( ( pv[ i ] != $i ) || ( end[ i ] != ( $( i + 1 ) - 1 ) ) ) { if ( ! printed && length( pv[ i ] ) ) { printf( "%s::%-16s ", label, lv ); } # When DSK1 "continues" longer than DSK2, we print white space for # the first column: # LE PE1 DSK1 PE2 DSK2 # 1 1 c0t0d0 1 c0t1d0 # 2 2 c0t0d0 1 c0t2d0 for ( j = 2; j < i; j += 3 ) { if ( ! data_shown[ j ] ) { data_shown[ j ] = 1; printf( "%-8.8s %7.7s %7.7s %7.7s ",\ " ", " ", " ", " " ); } } data_shown[ i ] = 1; if ( length( pv[ i ] ) ) { printed = 1; printf( "%-8.8s %7d %7d %7d ",\ pv[ i ], cnt[ i ], start[ i ], end[ i ] ); } pv[ i ] = $i; cnt[ i ] = 0; start[ i ] = $( i + 1 ); end[ i ] = 0; } cnt[ i ]++; end[ i ] = $( i + 1 ); } if ( printed ) { printf( "\n" ); } } END { if ( length( label ) == 0 ) { # Empty lvol, no data received and processed. label = sprintf( "fix:%s:%s:LV layout", l, v ); if ( ! h ) { printf( "%s::%-16s ", label, "LV" ); printf( "%-8.8s %7.7s %7.7s %7.7s \n",\ "Disk", "Cnt PE", "start", "end" ); } printf( "%s::%-16s ", label, lv ); printf( "%-8.8s %7.7s %7.7s %7.7s \n",\ "-", "-", "-", "-" ); } else { printf( "%s::%-16s ", label, lv ); for ( i = 2; i <= nr_f; i += 3 ) { printf( "%-8.8s %7d %7d %7d ",\ pv[ i ], cnt[ i ], start[ i ], end[ i ] ); } printf( "\n" ); } }' h="${header_done}" l="Volume Management" lv="${lv}" v="${vg}" header_done=1; done # Volume Management - - PV layout # Summary with disks per physical volume group and alternate links vgdisplay -v ${vg} 2>/dev/null | awk '/^VG Name/ { vg = $NF; sub( "/dev/", "", vg ); pvg = ""; next } /PE Size/ { pe_s = $NF; next } /^Total PE/ { v_size = pe_s * $NF; next } /^Free PE/ { printf( "1:vg:%s:%s:%s\n", vg, v_size, pe_s * $NF ); next } /PVG Name/ { pvg = $NF; next } /PV Name/ { if ( length( pvg ) == 0 ) { prev_pv = pv; split( $0, parts, "/" ); if ( parts[ 4 ] ~ "Alternate" ) { sub( "[ ].*", "", parts[ 4 ] ); parts[ 4 ] = sprintf( "%s:%s", prev_pv, parts[ 4 ] ); } else { #sub( "[ ]*", ":", parts[ 4 ] ); parts[ 4 ] = sprintf( "%s:", parts[ 4 ] ); } pv = parts[ 4 ]; } else { sub( "/dev/dsk/", "", $NF ); printf( "2:pvg:%s:%s:%s\n", vg, pvg, $NF ); } next; } /^ Total PE/ { p_size = pe_s * $NF; next } /^ Free PE/ { printf( "3:pv:%s:%s:%s:%s\n",\ vg, pv, p_size, pe_s * $NF ); next }' | sort -t: -k3,3 -k1,1 | awk -F: '/^1/ { # Format of data is: 1:vg::: vg_size = $4; vg_free = $5; next; } /^2/ { # Format of input is: 2:pvg::: pvg[ $5 ] = $4; next; } /^3/ { # Format of input is: 3:pv::::: printf( "%s:%s:%s:%s:%s:%s:%s:%s\n",\ $3, vg_size, vg_free, pvg[ $4 ], $4, $5, $6, $7 ); }' | sort -t: -k1,1 -k4,4 -k 5,5 | awk -F: 'BEGIN { printf( "%7s %7s %10s %10s %10s %7s %7s\n",\ "VGsize", "VGfree", "PVG", "Disk", "Alternate", "Size", "Free" ); } { # Formatting: # - header # - blank vg-data for subsequent lines if ( NR > 1 ) { vg_size = ""; vg_free = ""; label = ""; } else { vg_size = $2; vg_free = $3; label = "MB"; } pvg = ""; if ( $4 != prev_pvg ) { pvg = $4; prev_pvg = $4; } prev_vg = $1; printf( "%7s %2s %7s %2s %10s %10s %10s %7d MB %7d MB\n",\ vg_size, label, vg_free, label, pvg, $5, $6, $7, $8 ); }' | sed -e "s/^/var:Volume Management:${vg}:PV layout::/" ls -l /dev/${vg}/group 2>/dev/null | awk '{ printf( "fix:%s:%s:general::device-file %s %s %s %s %s %s %s\n", \ l, v , $1, $2, $3, $4, $5, $6, $NF ) }' l="Volume Management" v=${vg} - # Volume Management - vg - logical-volume - lv for lv in ${lv_list} do lvdisplay -v /dev/${vg}/${lv} | sed -e '/^--/d' \ -e '/^$/d' \ -e '/^ [0-9][0-9][0-9][0-9]/d' \ -e '/^ --- Logical/d' \ -e '/^ L/d' \ -e 's/^ //' \ -e "s/^/fix:Volume Management:${vg}:logical-volume:${lv}::/" ls -l /dev/${vg}/*${lv} 2>/dev/null | awk '{ printf( "fix:%s:%s:logical-volume:%s::device-file %s %s %s %s %s %s %s\n", \ l, v, lv, $1, $2, $3, $4, $5, $6, $NF ) }' l="Volume Management" v=${vg} lv=${lv} - done # for lv in ${lv_list}: Volume Management - vg - logical-volume - lv # Volume Management - vg - physical-volume - pv for pv in ${pv_list} do pvdisplay /dev/dsk/${pv} >${TMP2_FILE} grep -q "Using Primary Link" ${TMP2_FILE} if [ $? -eq 0 ] then # Do not report the detail for an alternate link. sed -n -e '1,/^PV Name.*Alternate Link/p' ${TMP2_FILE} | sed -e "s/^/fix:Volume Management:${vg}:physical-volume:${pv}::/" else # pvdisplay most of the times reports: 'IO Timeout' as a label, # but sometimes it reports: 'IO Timeout (Seconds)'. # Erase the seconds whenever they appear as the label. pvdisplay -v /dev/dsk/${pv} | sed -e '/^--/d' \ -e '/^$/d' \ -e '/VG Name/d' \ -e '/^ [0-9][0-9][0-9][0-9]/d' \ -e '/^ --- Physical/d' \ -e '/^ P/d' \ -e 's/^ //' \ -e 's/IO Timeout (Seconds)/IO Timeout /' \ -e "s/^/fix:Volume Management:${vg}:physical-volume:${pv}::/" fi done # for pv in ${pv_list}: Volume Management - vg - physical-volume - pv done # while read vg sed -e 's/^/fix:Volume Management:messages::/' ${TMP1_FILE} rm -f ${TMP1_FILE} ${TMP2_FILE} fi if [ ${VXVM_ENABLED} -eq 1 ] then /usr/sbin/vxdg -q list 2>/dev/null | while read dg remainder do /usr/sbin/vxdg list ${dg} | sed -e "s@^@fix:Volume Management:${dg}:general::@" /usr/sbin/vxdisk -g ${dg} list | sed -e "s@^@fix:Volume Management:${dg}:general::@" /usr/sbin/vxinfo -p -g ${dg} | sed -e "s@^@fix:Volume Management:${dg}:general::@" /usr/sbin/vxdg -g ${dg} -a free | sed -e "s@^@fix:Volume Management:${dg}:free space::@" /usr/sbin/vxprint -l -v -g ${dg} | awk '/^Volume:/ { printf( "vol_data /dev/vx/dsk/%s/%s\n", d, $2 ) }' d="${dg}" | awk '/^fs_data/ { fs[ $2 ] = $3; type[ $2 ] = $4; next } /^vol_data/ { raw = 0; if ( length( type[ $2 ] ) == 0 ) { fs[ $2 ] = "-"; type[ $2 ] = "raw"; raw = 1; } split( $2, parts, "/" ); if ( ! header_shown ) { printf( "fix:%s:%s:Volume usage::%-16s %-8s %s\n",\ l, parts[ 5 ], "Volume", "FS-type", "Mountpoint" ); header_shown = 1; } printf( "fix:%s:%s:Volume usage::%-16s %-8s %s\n",\ l, parts[ 5 ], parts[ 6 ], type[ $2 ], fs[ $2 ] ); if ( raw ) { printf( "fix:%s:%s:general::raw device: %s\n",\ l, parts[ 5 ], $2 ); } }' l="Volume Management" ${TMP3_FILE} - vxprint -s -l -g "${dg}" | awk '/^Subdisk:/ { sd = $2; disk = "?"; vol = "?"; plex = "?"; next } /^info:/ { for ( i = 2; ( i <= NF ) && ( $i !~ "disk=" ); i++ ) { } if ( i <= NF ) { split( $i, parts, "=" ) disk = parts[ 2 ]; } for ( i = 2; ( i <= NF ) && ( $i !~ "offset=" ); i++ ) { } if ( i <= NF ) { split( $i, parts, "=" ) offset = parts[ 2 ]; } info = 1; } /^assoc:/ { for ( i = 2; ( i <= NF ) && ( $i !~ "vol=" ); i++ ) { } if ( i <= NF ) { split( $i, parts, "=" ) vol = parts[ 2 ]; } for ( i = 2; ( i <= NF ) && ( $i !~ "plex=" ); i++ ) { } if ( i <= NF ) { split( $i, parts, "=" ) plex = parts[ 2 ]; } info = 1; } { if ( info && disk != "?" && vol != "?" ) { printf( "%s:%s:%s:%s:%s:%s\n",\ d, vol, plex, sd, disk, offset ); } info = 0; }' d="${dg}" >${TMP2_FILE} sort -t: ${TMP2_FILE} | awk -F: '{ if ( NR == 1 ) { printf( "%s::%-20s %-20s %-20s %-20s\n",\ l, "Volume", "Plex", "Subdisk", "Disk" ); } printf( "%s::%-20s %-20s %-20s %-20s\n",\ l, $2, $3, $4, $5 ); }' h="${header_done}" l="fix:Volume Management:${dg}:Diskgroup layout" sort -t: -k 5 -k 6n -k 4 -k 3 -k 2 -k 1 ${TMP2_FILE} | awk -F: '{ if ( NR == 1 ) { printf( "%s::%-20s %-20s %-20s %-20s\n",\ l, "Disk", "Subdisk", "Plex", "Volume" ); } printf( "%s::%-20s %-20s %-20s %-20s\n",\ l, $5, $4, $3, $2 ); }' h="${header_done}" l="fix:Volume Management:${dg}:Disk layout" /usr/sbin/vxprint -l -v -g ${dg} | awk '/^Volume:/ { vol = $2; next } /^$/ { next } { printf( "fix:Volume Management:%s:volume:%s::%s\n", d, vol, $0 ); }' d=${dg} /usr/sbin/vxprint -l -d -g ${dg} | awk '/^Disk:/ { dsk = $2; next } /^$/ { next } { printf( "fix:Volume Management:%s:disk:%s::%s\n", d, dsk, $0 ); }' d=${dg} /usr/sbin/vxprint -l -s -g ${dg} | awk '/^Subdisk:/ { sdsk = $2; next } /^$/ { next } { printf( "fix:Volume Management:%s:subdisk:%s::%s\n", d, sdsk, $0 ); }' d=${dg} | sort /usr/sbin/vxprint -l -p -g ${dg} | awk '/^Plex:/ { plex = $2; next } /^$/ { next } { printf( "fix:Volume Management:%s:plex:%s::%s\n", d, plex, $0 ); }' d=${dg} done # Determine the "raw" volumes (without a filesystem and not being used for swap) ( /usr/sbin/vxdg -q list 2>/dev/null | while read dg remainder do /usr/sbin/vxprint -v -g ${dg} 2>/dev/null | awk '/^v / { print "all", d, "/dev/vx/dsk/" d "/" $2 }' d="${dg}" done | sed -e 's@/rootdg/@/@' mount 2>/dev/null | sed -n -e "s@^[^ ]* on /dev/vx/dsk/\([^ ]*\) .*@mount /dev/vx/dsk/\1@p" | sed -e 's@/rootdg/@/@' /usr/sbin/swap -l 2>/dev/null | sed -n -e "s@^/dev/vx/dsk/\([^ ]*\) .*@swap /dev/vx/dsk/\1@p" | sed -e 's@/rootdg/@/@' ) | awk '/^all / { raw[ $3 ] = 1; dg[ $3 ] = $2; next } /^mount / { raw[ $2 ] = 0; next } /^swap / { raw[ $2 ] = 0; next } END { for ( v in raw ) { if ( raw[ v ] ) { print "fix:Volume Management:" dg[ v ] ":general::raw device: " v; } } }' | sort fi if [ -f /etc/lvmtab ] then strings /dev/null | sed -e 's/^/fix:Volume Management:VxVM general::volboot: /' /usr/sbin/vxiod 2>/dev/null | sed -e 's/^/fix:Volume Management:VxVM general::IO daemons: /' if [ -x /usr/sbin/vxserial ] # Not present on HP-UX then /usr/sbin/vxserial -p | sed -e '/^[ ]*$/d' \ -e 's/\(Expiration.*\) (.*/\1/' \ -e 's/^/fix:Volume Management:VxVM general::vxserial: /' fi if [ -x /sbin/vxlicense ] then /sbin/vxlicense -p 2>/dev/null | awk '/^[ ]*$/ { next } { p="fix" } /Expiration/ { p="var" } { print p ":Volume Management:VxVM general::vxlicense: " $0; }' fi scc_check_file /etc/vx/cntrls.exclude "fix:Volume Management:VxVM general::/etc/vx/cntrls.exclude: " "#" scc_check_file /etc/vx/disks.exclude "fix:Volume Management:VxVM general::/etc/vx/disks.exclude: " "#" if [ -f /etc/vx/array.info ] then strings /etc/vx/array.info | sed -e "s@^@fix:Volume Management:VxVM general::/etc/vx/array.info: @" fi fi rm -f ${TMP1_FILE} ${TMP2_FILE} cur_path="${PATH}" if [ -x /usr/opt/SUNWmd/sbin/metastat ] then PATH=${PATH}:/usr/opt/SUNWmd/sbin # Solaris 7 fi if [ -x /usr/sbin/metastat -o -x /usr/opt/SUNWmd/sbin/metastat ] then metastat 2>&1 | awk '/^[ ]*$/ { next } /^[^ ]/ { cat = $1; } { printf( "fix:Volume Management:%s:metadata::%s\n", cat, $0 ); }' metastat -p 2>&1 | sed -e 's/^/fix:Volume Management:Solstice Disk Suite:recovery::/' metadb 2>&1 | sed -e 's/^/fix:Volume Management:Solstice Disk Suite:database::/' metahs -i 2>&1 | sed -e '/^[ ]*$/d' \ -e 's/^/fix:Volume Management:Solstice Disk Suite:hot spares::/' metaset 2>/dev/null | while read dset do metastat -s "${dset}" 2>&1 | awk '/^[ ]*$/ { next } /^[^ ]/ { cat = $1; } { printf( "%s%s\n", cat, $0 ); }' | sed -e "s/^/fix:Volume Management:Solstice Disk Suite:metadata ${dset}::/" done # Determine the "raw" devices (without a filesystem and not being used for swap or mirroring) ( metastat -p 2>/dev/null | sed -e 's/ .*//' \ -e 's/^/all /' metastat 2>/dev/null | sed -n -e 's/^\([^ ]*\):.*Submirror of.*/mirror \1/p' ) | awk '/^fs_data/ { raw[ $2 ]=0; next } /^swap/ { raw[ $2 ]=0; next } /^all/ { raw[ $2 ]=1; next } /^mirror/ { raw[ $2 ]=0; next } END { for ( v in raw ) { if ( raw[ v ] ) { print "fix:Volume Management:Solstice Disk Suite:raw device:: " v; } } }' ${TMP3_FILE} fi PATH="${cur_path}" rm -f ${TMP3_FILE} if [ -d /etc/lvm ] then for f in devpath md.cf md.ctrlmap md.tab mddb.cf runtime.cf do scc_check_file "/etc/lvm/${f}" "fix:Volume Management:Solstice Disk Suite:/etc/lvm/${f}::" "#" done fi rm -f ${TMP1_FILE} if [ -x /usr/sbin/lsvg ] then /usr/sbin/lsvg 2>/dev/null | while read vg remainder do ( /usr/sbin/lsvg ${vg} 2>${TMP1_FILE}; /usr/sbin/lsvg -p ${vg} 2>/dev/null ) | sed "s/^/fix:Volume Management:${vg}:AIX Volume Manager:general::/" if [ -s ${TMP1_FILE} ] then sed -e "s/^/fix:messages::lsvg ${vg} :/" ${TMP1_FILE} fi /usr/sbin/lsvg -l ${vg} 2>/dev/null | sed -e '1,2d' | while read lv remainder do ( /usr/sbin/lslv ${lv}; lslv -l ${lv} ) | sed "s/^/fix:Volume Management:${vg}:logical volume:${lv}::/" done done /usr/sbin/lspv 2>/dev/null | while read pv remainder do /usr/sbin/lspv -l ${pv} | sed -e "s/^/fix:Volume Management:physical volume:${pv}::/" done fi rm -f ${TMP1_FILE} exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0500_s_network010050000000000000003000000424410774770013000227120ustar00rootsys00000000000000#!/bin/sh # Shell script to collect network data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.6 $ . ${SCC_BIN}/scc_modules/scc_utils if [ -x /usr/bin/what -a -f /usr/conf/lib/liblan.a ] then what /usr/conf/lib/liblan.a | sed -e 's@^@fix:network:Core-lan /usr/conf/lib/liblan.a::@' fi lines=$(grep -c [g]ated ${PROC_FILE}) if [ ${lines} -ge 1 ] then echo "fix:network:gated::status: active" else echo "fix:network:gated::status: inactive" fi scc_check_file /etc/gated.conf "fix:network:gated::/etc/gated.conf: " "#" for file in /etc/bootptab \ /etc/defaultrouter \ /etc/dhcptab \ /etc/ethers \ /etc/gateways \ /etc/hosts \ /etc/host.conf \ /etc/hosts.equiv \ /etc/netconfig \ /etc/netgroup \ /etc/netmasks \ /etc/nettlgen.conf \ /etc/networks \ /etc/nsswitch.conf \ /etc/nscd.conf \ /etc/protocols \ /etc/route.conf \ /etc/rpc \ /etc/rpld.conf \ /etc/rsh.allow \ /etc/sysctl.cfg \ /etc/telnet.conf \ /var/adm/inetd.sec do scc_check_file "${file}" "fix:network:file:${file}::" "#" if [ ${IS_NIS_MASTER} -eq 1 -a "${NIS_DATA_DIR}" != "/etc" ] then nis_file="${NIS_DATA_DIR}/$(basename ${file})" scc_check_file "${nis_file}" "fix:network:file:${nis_file}::" "#" fi done if [ -f /etc/notrouter ] then echo "fix:network:file:/etc/notrouter::1" fi if [ ! -h /etc/hosts ] then scc_check_file /etc/inet/hosts "fix:network:file:/etc/inet/hosts::" "#" fi sun_snmp_file="" if [ "${OS_NAME}" = "SunOS" ] then dir=$(sed -n -e 's/.*snmpdx .*-c *//p' ${PROC_FILE}) dir=${dir%% *} dir=${dir:-/etc/snmp/conf} sun_snmp_file=${dir}/snmpd.conf for f in mibiisa.reg mibiisa.rsrc snmpdx.reg snmpdx.rsrc snmpdx.acl do scc_check_file "${dir}/${f}" "fix:network:file:${dir}/${f}::" "#" done fi # Avoid the clear-text community-names to appear in the snapshots. rm -f ${TMP1_FILE} for file in /etc/snmpd.conf ${sun_snmp_file} \ /etc/snmp/snmpd.conf \ /etc/SnmpAgent.d/snmpd.conf do if [ ! -f ${file} -o -h ${file} ] then continue fi prefix="fix:network:file:${file}::" # Communitynames are sensitive information, therefore we crypt them. sed -e '/^#/d' \ -e 's/[ ]*#.*//' \ -e '/^[ ]*$/d' ${file} | while read key data do case "${key}" in trap-community) echo "${prefix}${key} ${data}";; *community*) if [ -n "${data}" ] then echo "${prefix}${key} $(echo "${key} ${data}" | scc_crypt )" else echo "${prefix}${key} # No access" fi;; *) echo "${prefix}${key} ${data}";; esac done done scc_check_file /etc/services "fix:network:file:/etc/services::" "#" | sort -k 2n if [ ${IS_NIS_MASTER} -eq 1 -a "${NIS_DATA_DIR}" != "/etc" ] then scc_check_file "${NIS_DATA_DIR}/services" "fix:network:file:${NIS_DATA_DIR}/services::" "#" fi for file in /etc/ftp-banner \ /etc/ftpaccess \ /etc/ftpconversions \ /etc/ftpgroups \ /etc/ftphosts \ /etc/ftpusers \ /etc/ftpd/ftpusers \ /etc/proftpd.conf \ /usr/local/etc/proftpd.conf do scc_check_file "${file}" "fix:network:ftp:${file}::" "#" done # Record ports that are listened on. Select only the ports that are # present in the file /etc/services. sed -e '/^[ ]*$/d' \ -e '/^#/d' \ -e 's@/.*@@' /etc/services >${TMP1_FILE} netstat -an | awk '/^tcp.*LISTEN *$/ { i=4; work=1 } /^ .*LISTEN *$/ { i=1; work=1 } { if ( ! work ) { next; } cnt=split( $i, parts, ":" ); if ( cnt == 2 ) { print parts[ 2 ]; } else { cnt=split( $i, parts, "." ); print parts[ 2 ]; } work=0; }' | sort -u | awk '{ if ( NF == 2 ) { service[ $2 ] = $1; } else { if ( length( service[ $1 ] ) > 0 ) { print "fix", service[ $1 ], $1; } else { print "var", $1, $1 } } }' ${TMP1_FILE} - | sort -k 3n | sed -e 's/^fix /fix:network:ports::/' \ -e 's/^var /var:network:ports::/' rm -f ${TMP1_FILE} if [ -x /usr/bin/ipcs ] then # The output of ipcs changes frequently. Treat it as variable. extra_options="" if [ "${OS_NAME}" = "HP-UX" -o "${OS_NAME}" = "SunOS" ] then extra_options="-a" fi ipcs -m ${extra_options} | sed -e '/^ *$/d' \ -e 's/^/var:network:ipcs::shared-memory: /' ipcs -q ${extra_options} | sed -e '/^ *$/d' \ -e 's/^/var:network:ipcs::message-queue: /' ipcs -s ${extra_options} | sed -e '/^ *$/d' \ -e 's/^/var:network:ipcs::semaphores: /' fi nslookup $(hostname) 2>/dev/null | sed -e '/^[ ]*$/d' \ -e 's/^/fix:network:DNS::nslookup: /' # Maarten de Boer and Nico van Royen provided some NIS-background. NIS_DOMAIN="$(domainname 2>/dev/null)" NIS_MASTER="$(ypwhich 2>/dev/null)" echo "fix:network:NIS:general::domain: ${NIS_DOMAIN}" echo "fix:network:NIS:general::binding: ${NIS_MASTER}" is_slave_server=0 is_client=0 if [ ${IS_NIS_MASTER} -eq 0 ] then is_slave_server="$(grep -q ypserv ${PROC_FILE}; echo $(( 1 - $? )) )" if [ "${is_slave_server}" -eq 0 ] then is_client="$(grep -q ypbind ${PROC_FILE}; echo $(( 1 - $? )) )" fi else echo "fix:network:NIS:general::data-directory: ${NIS_DATA_DIR}" fi echo "fix:network:NIS:general::is-master-server: ${IS_NIS_MASTER}" echo "fix:network:NIS:general::is-slave-server: ${is_slave_server}" echo "fix:network:NIS:general::is-client: ${is_client}" scc_check_file "/var/yp/binding/${NIS_DOMAIN}/ypservers" "fix:network:NIS:binding ${NIS_DOMAIN} ypservers::" "#" scc_check_file /etc/yp.conf "fix:network:NIS:binding /etc/yp.conf::" "#" scc_check_file /var/yp/securenets "fix:network:NIS:/var/yp/securenets::" "#" if [ -f /etc/publickey ] then # Ignore comment and blank lines. Also erase the private key. sed -e '/^#/d' \ -e '/^[ ]*$/d' \ -e 's/:.*//' \ -e 's@^@fix:network:NIS:/etc/publickey::@' /etc/publickey fi if [ -x /usr/bin/ypwhich ] then ypwhich -x 2>/dev/null | sed -e 's/^/fix:network:NIS:nicknames::/' ypwhich -m 2>/dev/null | sed -e 's/^/fix:network:NIS:maps::/' fi config="" key="" if [ -f /etc/rc.config.d/netdaemons ] then . /etc/rc.config.d/netdaemons if [ "${XNTPD_ARGS}" != "" ] then config=$(echo "${XNTPD_ARGS}" | sed -e 's/.*-c[ ]*//' -e 's/ .*//') key=$(echo "${XNTPD_ARGS}" | sed -e 's/.*-k[ ]*//' -e 's/ .*//') fi else config="$(sed -n -e 's/.*xntpd.* -c[ ]*//p' ${PROC_FILE})" config="${config% *}" fi if [ ! -f "${config}" ] then if [ -f /etc/ntp.conf ] then config=/etc/ntp.conf elif [ -f /etc/inet/ntp.conf ] then config=/etc/inet/ntp.conf else config="" fi fi if [ "${config}" != "" ] then scc_check_file "${config}" "fix:network:ntp:${config}::" "#" if [ ! -f "${key}" ] then key=$(awk '/^keys/ { print $2 }' ${config}) fi if [ "${key}" ] then scc_check_file "${key}" "fix:network:ntp:${key}::" "#" fi fi if [ -x /usr/sbin/ntpq ] then ntpq -p 2>/dev/null | sed -e 's/^/var:network:ntp:ntpq::/' fi lines=$(grep -c [n]amed ${PROC_FILE}) if [ ${lines} -ge 1 ] then echo "fix:network:named::status: active" else echo "fix:network:named::status: inactive" fi named_exe=$(which named 2>/dev/null) if [ -x "${named_exe}" ] then what "${named_exe}" | grep "named" | sed -e 's/^/fix:network:named::version: /' fi named_cfg=$(sed -n -e 's/.*[n]amed.*-b *//p' ${PROC_FILE} | sed -e 's/ .*//') if [ ! -f "${named_cfg}" ] then named_cfg=/etc/named.boot fi scc_check_file "${named_cfg}" "fix:network:named::${named_cfg}: " "#" if [ -f /etc/resolv.conf ] then awk '/^#/ { next; } /^[ ]*$/ { next; } { printf( "fix:network:file:/etc/resolv.conf::%04d: %s\n",\ ( 1 + i++ ), $0 ); }' /etc/resolv.conf fi if [ -f /etc/inetd.conf ] then # During removal and (re)installation of software, services are # removed from this file and added at the end. To avoid reporting, # we sort the file. Special consideration with continuation lines. sed -e '/^#/d' \ -e '/^[ ]*$/d' /etc/inetd.conf | awk '{ if ( length( prev_service ) > 0 ) { printf( "%s_%08d ", prev_service, counter ); counter++; } print; } /\\$/ { if ( length( prev_service ) == 0 ) { prev_service = $1; } next; } { prev_service = ""; counter = 0; }' | sort | sed -e 's/^[a-zA-Z][a-zA-Z]*_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] //' \ -e 's@^@fix:network:file:/etc/inetd.conf::@' fi if [ -f /etc/xinetd.conf ] then scc_check_file /etc/xinetd.conf "fix:network:file:/etc/xinetd.conf::" "#" dir=$(sed -n -e 's/^includedir *//p' /etc/xinetd.conf) if [ -z "${dir}" ] then dir=/etc/xinetd.d fi for f in ${dir}/* do scc_check_file "${f}" "fix:network:file:xinetd:${f}::" "#" done fi if [ -x /usr/sbin/lanscan ] then /usr/sbin/lanscan -v | sed -e 's/^/fix:network:lan:lanscan::/' # Catch the differences between 10.20 and 11.x /usr/sbin/lanscan | awk '/NameUnit/ { i=7; next } /NamePPA/ { i=6; next } /^[0-9].* ETHER / { sub( "^[^0-9]*", "", $i ); print $5, $i }' | sort | while read lan nmid remainder do ifconfig ${lan} 2>&1 | sed -e "s/ifconfig: no such interface/not configured/" \ -e "s/^/fix:network:lan:${lan}::ifconfig: /" # Show all the IP-addresses of the interface. # Remove the statistics. netstat -in -I ${lan} | sed -e 's/Ipkts.*//' \ -e 's/ *[- 0-9]*$//' \ -e "s/^/fix:network:lan:${lan}::netstat: /" lanadmin -ams ${nmid} | sed -e "s/^/fix:network:lan:${lan}::lanadmin: /" done elif [ -d /etc/sysconfig/network-scripts ] then # Linux for f in /etc/sysconfig/network-scripts/ifcfg-* do if [ ! -f "${f}" ] then break; fi ifc=$(echo ${f} | sed -e 's/.*-//') scc_check_file "${f}" "fix:network:lan:${ifc}::network-script: " "#" # Ignore the statistics ifconfig ${ifc} 2>/dev/null | sed -e '/^ *RX packets:/,$ d' | sed -e "s/^/fix:network:lan:${ifc}::ifconfig: /" if [ -x /sbin/sysctl ] then sysctl -a | grep "^net\..*\.${ifc}\." | sort | sed -e "s/^/fix:network:lan:${ifc}::sysctl: /" fi done elif [ "${OS_NAME}" = "SunOS" ] then # Adjust the output, add the interface name to the classification. ifconfig -a | awk '/^[^ ]/ { ifc = $1; } # this variable ends with a ":" { print "fix:network:lan:" ifc ":" $0; }' all_types="" ifconfig -a | sed -e '/^[ ]/d' \ -e 's/:.*//' | while read ifc do scc_check_file "/etc/hostname.${ifc}" "fix:network:lan:${ifc}::/etc/hostname.${ifc}: " "#" # Extract additional parameters from the interface. if_type=${ifc%%[0-9]*} if_instance=${ifc##*[a-z]} ndd /dev/${if_type} "?" 2>/dev/null | sed -e '/^?/d' \ -e '/write only/d' | sort >${TMP1_FILE} # Check the amount of data in this file, some drivers, like "le", do # not support requesting settings with ndd. if [ $(wc -l <${TMP1_FILE}) -gt 1 ] then # Select the proper instance. ndd -set /dev/${if_type} instance ${if_instance} while read parm remainder do ndd -get /dev/${if_type} ${parm} | sed -e "s/^/fix:network:lan:${ifc}::${parm}: /" done <${TMP1_FILE} fi rm -f ${TMP1_FILE} # Collect all interface types that are in use. all_types="${all_types} ${if_type}" done # Check the system-wide default settings for each type of interface. echo "${all_types}" | tr " " "\012" | sort -u | while read if_type do if [ "${if_type}" ] then config_file="/kernel/drv/${if_type}.conf" scc_check_file "${config_file}" "fix:network:lan:${config_file}::" "#" fi done elif [ "${OS_NAME}" = "AIX" ] then lsdev -C -c if | while read ifc remainder do ifconfig ${ifc} | sed -e "s/^/fix:network:lan:${ifc}::/" done fi rpcinfo -p 2>/dev/null | awk '/^ *[0-9][0-9]*/ { # Ignore the ports without name if ( NF == 4 ) { next } } { print $1, $2, $3, $5; }' | sort -n | sed -e 's/^/fix:network:rpcinfo::/' if [ -x /sbin/sysctl ] then echo "/^net\\.ip.*\\.ip_\\./d" >${TMP1_FILE} echo "/^net\\.ip.*\\.ip_\\./d" >>${TMP1_FILE} echo "/ip_always_defrag/d" >>${TMP1_FILE} if [ -f /proc/net/dev ] then # Determine the interfaces and build an sed-script that removes all the # interface specific output of sysctl. These settings are recorder by ndd. awk -F: '{ if ( NF > 1 ) { sub( " *", "", $1 ) printf( "/^net\\..*\\.%s\\./d\n", $1 ) } }' /proc/net/dev >>${TMP1_FILE} fi sysctl -a | sed -f ${TMP1_FILE} | sed -n -e "s/^net\./fix:network:sysctl::net./p" | sort fi rm -f ${TMP1_FILE} if [ -x /usr/contrib/bin/nettune ] then /usr/contrib/bin/nettune -l 2>/dev/null | sed -e 's/^/fix:network:nettune::/' fi if [ -x /usr/bin/ndd -o -x /usr/sbin/ndd ] then for d in arp icmp icmp6 ip ip6 tcp tcp6 udp udp6 do if [ ! -r /dev/${d} ] then continue fi ndd -get /dev/${d} "?" | sed -e "/write only/d" \ -e "/arp_cache_report/d" \ -e "s/[ (].*//" \ -e "/status/d" \ -e "/stats$/d" \ -e "/hash/d" \ -e "/ip_always_defrag/d" \ -e "/pullups$/d" \ -e "/^?/d" | while read parm remainder do ndd -get /dev/${d} ${parm} 2>&1 | sed -e "s/^/fix:network:ndd:${d}::${parm}: /" done done fi if [ -d /proc/sys/net/ipv4 ] then ( cd /proc/sys/net/ipv4 for p in icmp ip tcp do for f in ${p}* do name=$(basename "${f}") scc_check_file "${f}" "fix:network:${p}::${name}: " "#" | sed -e '/ip_always_defrag/d' done done # We prefer sysctl to obtain the following data. if [ -d conf -a ! -x /sbin/sysctl ] then cd conf for if in */* do interface=$(dirname "${if}") name=$(basename "${if}") scc_check_file "${if}" "fix:network:/proc/sys/net/ipv4:${interface}::${name}: " "#" done fi ) fi if [ "${OS_NAME}" = "SunOS" ] then netstat -rv | awk '/^---/ { next } { # Dynamic routes are treated as variable, not fixed config items p="fix"; if ( NF == 10 ) { if ( $8 ~ "D" ) { p="var"; } printf( "%s:network:netstat-route::%s:%s:%s:%s:%s:%s\n",\ p, $1, $2, $3, $4, $5, $8 ); } else if ( NF == 9 ) { if ( $7 ~ "D" ) { p="var"; } printf( "%s:network:netstat-route::%s:%s:%s:%s:%s\n",\ p, $1, $2, $3, $4, $7 ); } else if ( NF > 0 ) { print "fix:network:netstat-route::" $0; } }' elif [ "${OS_NAME}" = "HP-UX" ] then netstat -rv | awk '/^Routing tables/ { print; next; } /^[ ]/ { if ( NF == 1 ) { # Netmask does not fit: continuation # line with only netmask. printf( "%s ", $0 ); offset++; next; } if ( offset == 1 ) { # Destination was on previous line print $1, $2, $(NF-1), $NF; } else { # Destination and netmask were on # previous line(s) print $1, $(NF-1), $NF; } next; } { if ( NF < 3 ) { # Destination and/or netmask do not # fit into the column. Remainder follows # on next line. printf( "%s ", $0 ); offset=NF; } else { print $1, $2, $3, $(NF-1), $NF; } }' | awk '{ p="fix"; if ( $3 ~ "D" ) { p="var"; } printf( "%s:network:netstat-route::%s:%s:%s:%s\n", p, $1, $2, $3, $4 ); }' else # Linux: tested on RH 6.2 netstat -rv | awk '{ p="fix"; if ( NF < 6 ) { print "fix:network:netstat-route::" $0; } else { if ( $4 ~ "D" ) { p="var"; } printf( "%s:network:netstat-route::%s:%s:%s:%s:%s:%s\n",\ p, $1, $2, $3, $4, $(NF-1), $NF ); } }' fi | tr "A-Z" "a-z" ls /dev/x25* 2>/dev/null | grep x25 >/dev/null 2>&1 if [ -d /etc/x25 -a $? -eq 0 ] then if [ -f /etc/rc.config.d/acc ] then . /etc/rc.config.d/acc if [ "${START_ZCOM}" = 1 ] then echo "fix:network:x25-mux:config::status: active" # The variabele ${X25INIT_FILE} contains the name of the file that # contains the names of the configuration-files with the names of the # device files. Obvious. init_file=$(echo ${X25INIT_FILE}) file=$(awk '/-c/ { print $3 }' ${init_file}) dev=$(awk '/^device/ { print $2 }' ${file}) rm -f ${TMP1_FILE} for d in ${dev} do if [ -n "${d}" ] then if [ ! -f ${TMP1_FILE} ] then /usr/sbin/x25stat -d ${dev} -c 2>&1 | sed -e '/Programatic Access Name/d' \ -e '/^ *$/d' \ -e '/Packet type.*TX.*RX/,/-* X.25 CONFIG -*/d' \ -e 's/^/fix:network:x25-mux:config::/' touch ${TMP1_FILE} fi /usr/sbin/x25stat -d ${dev} -c 2>&1 | sed -n -e '/Programatic Access Name/p' | sed -e 's/.*: //' \ -e "s/^/fix:network:x25-mux:${d}::access: /" fi done else echo "fix:network:x25-mux:config::status: inactive" fi else /usr/sbin/x25stat -c 2>&1 | sed -e 's/^/fix:network:x25:data::/' /usr/sbin/x25stat -a 2>&1 | sed -e 's/^/fix:network:x25:ipmap::/' fi fi exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0600_s_software010050000000000000003000000655030774770013000230600ustar00rootsys00000000000000#!/bin/sh # Shell script to collect data concerning installed software. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.14 $ . ${SCC_BIN}/scc_modules/scc_utils # Apache can be installed in many different places and can be used with # or without the -d and -f option. When the config-file cannot be determined # this way, check the contents of the binary executable for the compiled # location of the root and the name of the config-file. awk '/httpd/ { # show any httpds with init as their parent. if ( $3 == 1 ) { # remove all data in front of the command. for ( i = 1; $i !~ "httpd"; i++ ) { $i = "" } print; } }' ${PROC_FILE} | sed -e 's/^ *//' \ -e 's/-d/-d /g' \ -e 's/-f/-f /g' | awk '{ # complete all lines to format: # :::: if ( $1 ~ "^/" ) { path = $1; sub( "/[^/]*$", "", path ); sub( ".*/", "", $1 ); exe = $1; } else { path = "_"; exe = $1; } c_dir = "_"; c_file = "_"; settings = "_"; for ( i = 2; i <= NF; i++ ) { if ( $i ~ "^-d$" ) { i++; c_dir = $i; } if ( $i ~ "^-f$" ) { i++; c_file = $i; } if ( $i ~ "^-D" ) { setting = sprintf( "%s %s", settings, $i ); } } print path ":" exe ":" c_dir ":" c_file ":" settings; }' | sort -u >${TMP1_FILE} scc_keep_apache_config="software:Apache:config" scc_keep_apache_count="software:Apache:count" if [ -s ${TMP1_FILE} ] then # We collected data from running httpd(s). echo "${scc_keep_apache_count}:1" >>${SCC_KEEP_NEW} cat ${TMP1_FILE} else # Use the data in the keep-file. Use it for max. 5 runs of SCC. cnt=$(sed -n -e "s/^${scc_keep_apache_count}://p" ${SCC_KEEP_CONFIG}) cnt=$(( ${cnt:-0} + 1 )) if [ ${cnt} -le 5 -a ${cnt} -gt 1 ] then echo "${scc_keep_apache_count}:${cnt}" >>${SCC_KEEP_NEW} # Use the config-file from a previous run of SCC. sed -n -e "s/^${scc_keep_apache_config}://p" ${SCC_KEEP_CONFIG} fi fi | sed -e 's/:/ /g' | while read path exe c_dir c_file settings do parms="${path}:${exe}:${c_dir}:${c_file}:${settings}" if [ ! -d ${path} ] then path=""; fi if [ ! -f ${path}/${exe} ] then exe=$(which ${exe} 2>/dev/null) exe=${exe##no *} # erase the message: no httpd in . . exe=${exe:="httpd"} else exe=${path}/${exe} fi # Record the settings for all servers. if [ -x ${exe} ] then # Record the compiled settings only once for each server. # Same server as one of the previous processes? grep -q "${scc_keep_apache_config}:${httpd}:" ${SCC_KEEP_NEW} if [ $? -ne 0 ] then # Do not use: ${exe} -V as an ordinary user might craft his own httpd. # Register the compiled settings in de the executable. strings <${exe} 2>/dev/null | sed -n -e "s@^ -D@fix:software:Apache:${exe}::-D@p" fi # Record the command-line settings for each instance. if [ "${settings}" != "_" ] then echo "${settings}" | tr "," "\012" | sed -e "s@^@fix:software:Apache:${exe}::@" fi fi echo "${scc_keep_apache_config}:${parms}" >>${SCC_KEEP_NEW} # Try to get the full name of the config file. Start with the directory. if [ ! -d "${c_dir}" ] then if [ -x ${exe} ] then # Use the document-root from the executable as the base-directory. c_dir=$(strings <${exe} 2>/dev/null | sed -n -e 's/"//g' \ -e 's/^ -D HTTPD_ROOT=//p') fi if [ ! -d "${c_dir}" ] then # Next guess, the parent of the bin-directory. c_dir=${path%%/bin} fi fi # Nothing so far? Try the compiled settings. if [ ${c_file} = "_" -o ! -f ${c_dir}/${c_file} ] then if [ -x ${exe} ] then # Use the server-config-file from the executable. c_file=$(strings <${exe} 2>/dev/null | sed -n -e 's/"//g' \ -e 's/^ -D SERVER_CONFIG_FILE=//p') fi if [ -z "${c_file}" ] then c_file="conf/httpd.conf" fi fi config="" if [ -f "${c_file}" ] then config=${c_file} # absolute path else if [ -f ${c_dir}/${c_file} ] then config=${c_dir}/${c_file} fi fi scc_check_file "${config}" "fix:software:Apache:${config}::" "#" done rm -f ${TMP1_FILE} scc_check_file /etc/Bastille/config "fix:software:Bastille:/etc/Bastille/config::" "#" case "${OS_NAME}" in HP-UX) if [ -x /bin/cc ] then echo "fix:software:C-compiler::$(what /bin/cc 2>/dev/null | grep HP)" fi ;; SunOS) if [ -d /opt/SUNWspro ] then echo "fix:software:C-compiler::$(what /opt/SUNWspro/bin/cc 2>/dev/null | grep RELEASE)" else echo "fix:software:C-compiler::$(what /usr/ucb/cc 2>/dev/null | grep SMI)" fi ;; esac scc_check_file /etc/opt/cifsclient/cifsclient.cfg "fix:software:cifs:cifsclient.cfg::" "#" for d in /var/adm/cron /etc/cron.d /etc do for file in ${d}/queuedefs ${d}/.proto ${d}/.proto.* do scc_check_file "${file}" "fix:software:cron:configuration::${file}: " "#" done # Sort the following files to make comparing systems easier. for file in ${d}/at.allow ${d}/at.deny ${d}/cron.allow ${d}/cron.deny do scc_check_file "${file}" "fix:software:cron:configuration::${file}: " "#" | sort done done for f in /var/spool/cron/crontabs/* /etc/cron.*/* /etc/crontab /etc/anacrontab /var/spool/cron/* do if [ ! -f "${f}" ] then continue fi job=$(basename ${f}) # NOTE: /etc/cron.d can contain regular cron-files. case ${job} in *.allow) continue;; *.deny) continue;; queuedefs) continue;; .proto*) continue;; esac # Ordinary users are allowed to change their cron-jobs. # Register their jobs as variable parts in the snapshot. # We need the uid of a user to determine whether it is a ordinary or system user. # When id fails, we have a job like: cron.daily which should be "fix" prefix="var" uid=$(id -u ${job} 2>/dev/null) if [ $? -eq 0 ] then if [ ${uid} -lt ${MAX_SYS_ACCOUNT_ID} ] then prefix="fix" fi fi scc_check_file "${f}" "${prefix}:software:cron:${f}::" "#" done if [ -x /usr/sbin/swlist ] then swacl -l host 2>/dev/null | sed -e '1,/^$/d' \ -e "s@^@fix:software:SD-UX:swacl-host::@" swacl -l root 2>/dev/null | sed -e '1,/^$/d' \ -e "s@^@fix:software:SD-UX:swacl-root::@" swacl -l global_soc_template 2>/dev/null | sed -e '1,/^$/d' \ -e "s@^@fix:software:SD-UX:swacl-global_soc_template::@" swlist -l depot 2>/dev/null | sort | sed -e '/^#/d' \ -e 's/^ *//' \ -e '/^ *$/d' >${TMP1_FILE} if [ -s ${TMP1_FILE} ] then while read depot remainder do if [ -d ${depot} ] then swacl -l depot @ ${depot} 2>/dev/null | sed -e '1,/^$/d' \ -e "s@^@fix:software:SD-UX:${depot}::swacl: @" swlist -d -l product @ ${depot} 2>/dev/null | sed -e '1,/^$/d' \ -e "s@^@fix:software:SD-UX:${depot}::product: @" else echo "fix:software:SD-UX:${depot}::status: absent" fi done <${TMP1_FILE} fi rm -f ${TMP1_FILE} fi if [ -x /opt/resmon/bin/resls ] then /opt/resmon/bin/resls / | sed -e '/^$/d' \ -e 's/^/fix:software:EMS-resls::/' fi if [ -x /etc/opt/resmon/lbin/moncheck ] then /etc/opt/resmon/lbin/moncheck | sed -e '/^$/d' \ -e 's/port=[0-9][0-9]*$/port=/' \ -e 's/^/fix:software:EMS-monitors::/' fi [ ${SCC_PROFILING} ] && $scc_timing "end of: software: EMS-monitors" if [ -d /opt/ignite/bin ] then if [ -h /var/opt/ignite/recovery/latest ] then echo "fix:software:Ignite-UX:latest::$(ls -ld /var/opt/ignite/recovery/latest | scc_ls )" elif [ -f /var/opt/ignite/recovery/makrec.last ] then echo "fix:software:Ignite-UX:makrec.last::$(ls -l /var/opt/ignite/recovery/makrec.last | scc_ls )" fi # The output of print_manifest is not easy to process for comparing. # Generate a new manifest-file and process that. /opt/ignite/bin/print_manifest >/dev/null 2>&1 sort -u /var/opt/ignite/local/manifest/manifest.info | sed -e '/^ *$/d' \ -e '/^PERIPHERAL/d' \ -e '/^LVM_DISK/d' \ -e '/^UFS_DISK/d' \ -e '/^UFS_LAYOUT/d' \ -e 's/^/fix:software:Ignite-UX:manifest.info::/' INDEX=/var/opt/ignite/INDEX scc_check_file "${INDEX}" "fix:software:Ignite-UX:${INDEX}::" "#" if [ -f ${INDEX} ] then sed -e 's/^[ ][ ]*"//' \ -e 's/"$//' ${INDEX} | grep "^/" | sort -u | while read file do scc_check_file "${file}" "fix:software:Ignite-UX:${file}::" "#" done fi for f in /var/opt/ignite/scripts/* do scc_check_file "${f}" "fix:software:Ignite-UX:scripts:$(basename ${f})::" "#" done scc_check_file /var/opt/ignite/server/ignite.defs "fix:software:Ignite-UX:/var/opt/ignite/server/ignite.defs::" "#" for f in /var/opt/ignite/clients/* do if [ -h ${f} ] then echo "fix:software:Ignite-UX:clients:$(basename ${f})::$(ls -ld ${f} | awk '{ print $NF }')" fi done scc_check_file /etc/opt/ignite/instl_boottab "fix:software:Ignite-UX:/etc/opt/ignite/instl_boottab::" "#" [ ${SCC_PROFILING} ] && scc_timing "end of: software: ignite" fi scc_check_file /etc/bootparams "fix:software:jumpstart:/etc/bootparams::" "#" if [ -x /usr/sbin/swlist ] then # Show the fileset, ignore the header. /usr/sbin/swlist -l fileset -x one_liner="name revision title" 2>/dev/null | sed -e '1,/^$/d' | sed -e 's/^/fix:software:installed-filesets::/' swlist -l fileset -a state 2>/dev/null | sed -e '/configured[ ]*$/d' \ -e '/transient[ ]*$/d' \ -e '/^#/d' \ -e '/^[ ]*$/d' \ -e 's/^/fix:software:patches:unconfigured::/' fi if [ -x /usr/bin/lslpp ] then /usr/bin/lslpp -a -c -L | sed -e 's/^/fix:software:installed-aix-filesets::/' fi if [ -x /usr/bin/pkginfo ] then /usr/bin/pkginfo -l | awk '/PKGINST:/ { pkg = $2; next; } /NAME:/ { name = $2; next; } /CATEGORY:/ { cat = $2; next; } /VERSION:/ { printf( "fix:software:installed-packages:%s::%s:%s:%s\n", cat, pkg, name, $2 ); pkg = ""; name = ""; cat = ""; next; }' | sed -e 's/:[ ][ ]*/:/' | sort -f -t":" -k 1,8 fi if [ -x /bin/rpm ] then scc_keep_rpm_config="fix:software:installed-rpms" # When this program is called during the pre- and post-install # of SCC, the rpm-database is locked and cannot be queried. # On Mandrake, rpm "hangs" during install. Ignore rpm during installs of SCC. if [ ! "${SCC_INSTALL_PHASE}" ] then /bin/rpm -qa --queryformat "${scc_keep_rpm_config}:%{GROUP}::%{NAME}:%{VERSION}-%{RELEASE}\n" 2>/dev/null | sort -t: -k 1,7 fi >${TMP1_FILE} if [ -s ${TMP1_FILE} ] then # Use the output from RPM. cat ${TMP1_FILE} else # Use the output from a previous run of SCC. grep "${scc_keep_rpm_config}:" ${SCC_KEEP_CONFIG} fi | tee -a ${SCC_KEEP_NEW} # keep the results for a next run. # The use of rpm is a permanent attribute of a system. Do not count the # use of this data in the keep-file. fi if [ -x /sbin/ipchains-save ] then /sbin/ipchains-save 2>&1 | sed -e 's/^/fix:software:ipchains:rules::/' scc_check_file /etc/iptoip.xml "fix:software:ipchains:/etc/iptoip.xml::" "#" fi if [ -x /sbin/iptables-save ] then # Ignore variable data: # - comment lines contain timestamps # - traffic counters are surrounded by '[' and ']' /sbin/iptables-save 2>&1 | sed -e 's/\[.*\]//' \ -e '/^#/d' \ -e 's/^/fix:software:iptables:rules::/' fi scc_check_file /etc/kbr5.conf "fix:software:kerberos:/etc/kbr5.conf::" "#" scc_check_file /etc/kbr5.keytab "fix:software:kerberos:/etc/kbr5.keytab::" "#" scc_check_file /etc/ldap.conf "fix:software:ldap:/etc/ldap.conf::" "#" if [ -f /etc/ldap.secret ] then scc_crypt /dev/null | sed -e 's/^/fix:software:lp:default::/' if [ -h /usr/bin/lpstat ] then # Justprint installed and active scc_check_file /opt/pms/setup/jpsetup.ini "fix:software:lp:justprint::" "#" else lpstat -v 2>/dev/null | sed -e 's/^/fix:software:lp:destinations::/' fi lpstat -r 2>/dev/null | sed -e 's/^/fix:software:lp:scheduler::/' elif [ -x /usr/sbin/lpc ] then lpc status | sed -e '/^[ ]/d' \ -e 's/^/fix:software:lp:destinations::/' fi scc_check_file /etc/hosts.lpd "fix:software:lp:/etc/hosts.lpd::" "#" scc_check_file /etc/rlpd.conf "fix:software:lp:/etc/rlpd.conf::" "#" scc_keep_mail_count="software:mail-server:count" scc_keep_mail_config="software:mail-server:config" version=$( ( echo quit; sleep 1 ) | telnet localhost 25 2>&1 | grep "^220") if [ "${version}" ] then version=$(echo ${version} | sed -e 's/220 //' -e 's/;.*//' -e 's/ready at.*//') cnt=1 else cnt=$(sed -n -e "s/^${scc_keep_mail_count}://p" ${SCC_KEEP_CONFIG}) cnt=$(( ${cnt:-0} + 1 )) version="" if [ ${cnt} -lt 5 -a ${cnt} -gt 1 ] then version=$(sed -n -e "s/^${scc_keep_mail_config}://p" ${SCC_KEEP_CONFIG}) fi fi if [ "${version}" ] then echo "fix:software:mail-server::version: ${version}" echo "${scc_keep_mail_count}:${cnt}" >>${SCC_KEEP_NEW} echo "${scc_keep_mail_config}:${version}" >>${SCC_KEEP_NEW} fi scc_check_file /etc/my.conf "fix:software:MySQL::" "#" scc_check_file /etc/opt/scc/conf/scc-localize "fix:software:scc:/etc/opt/scc/conf/scc-localize::" "#" for module in ${SCC_BIN}/scc_modules/scc_[0-9][0-9][0-9][0-9]_[su]_* do if [ -x "${module}" ] then # We detect changes in the modules. This checksum is also recorded in # the output of a user-module. scc-log ignores changes when the checksum # in the output of the user-module changes (when the user-module has run). echo "fix:software:scc:modules::$(basename "${module}") $(cksum <"${module}")" fi done scc_check_file /var/opt/scc-srv/conf/scc.conf "fix:software:scc-srv:/var/opt/scc-srv/conf/scc.conf::" "#" scc_check_file /var/opt/scc-srv/conf/scc-smt-select "fix:software:scc-srv:/var/opt/scc-srv/conf/scc-smt-select::" "#" for dir in /var/opt/scc-srv/data/www/*/custom do if [ -d "${dir}" ] then realm="$(basename $(dirname "${dir}"))" echo "fix:software:scc-srv:${realm}::permissions: $(ls -ld "${dir}"/.. | awk '{ print $1, $3, $4 }')" scc_check_file "${dir}/scc-realm.conf" "fix:software:scc-srv:${realm}::scc-realm.conf: " "#" scc_check_file "${dir}/scc-smt-select" "fix:software:scc-srv:${realm}::scc-smt-select: " "#" fi done if [ -d /var/opt/scc-srv/data ] then cd /var/opt/scc-srv/data for dir in transfer/* do if [ -d "${dir}" ] then echo "fix:software:scc-srv:${dir}::permissions: $(ls -ld "${dir}"/.. | awk '{ print $1, $3, $4 }')" fi done cd ${SCC_TMP} fi for dir in /etc/ssh /opt/openssh2/etc do if [ ! -d ${dir} ] then continue fi scc_check_file "${dir}/sshd_config" "fix:software:openssh2:sshd_config::" "#" if [ -f ${dir}/ssh_host_key ] then scc_crypt <${dir}/ssh_host_key | sed -e 's/^/fix:software:openssh2:ssh_host_key::/' fi scc_check_file "${dir}/ssh_host_key.pub" "fix:software:openssh2:ssh_host_key.pub::" "#" scc_check_file "${dir}/ssh_known_hosts" "fix:software:openssh2:ssh_known_hosts::" "#" scc_check_file "${dir}/shosts.equiv" "fix:software:openssh2:shosts.equiv::" "#" scc_check_file "${dir}/sshrc" "fix:software:openssh2:sshrc::" "#" break # Do not check other directories done scc_check_file /etc/ssh_known_hosts "fix:software:openssh2:/etc/ssh_known_hosts::" "#" scc_check_file /etc/pam.conf "fix:software:pam:/etc/pam.conf::" "#" scc_check_file /etc/pam_user.conf "fix:software:pam:/etc/pam_user.conf::" "#" for f in /etc/pam.d/* do scc_check_file "${f}" "fix:software:pam:${f}::" "#" done if [ -x /usr/bin/showrev ] then /usr/bin/showrev -p | sed -e 's/^/fix:software:patches:showrev::/' fi if [ -x /usr/contrib/bin/show_patches ] then /usr/contrib/bin/show_patches -s | sed -e 's/^/fix:software:patches:superseded::/' [ ${SCC_PROFILING} ] && scc_timing "end of: software: superseded patches" fi if [ -x /usr/contrib/bin/check_patches ] then /usr/contrib/bin/check_patches -i >/dev/null 2>&1 sed -e '1,/^$/d' \ -e 's/^/fix:software:patches:invalid::/' /dev/null 2>&1 sed -e '1,/^$/d' \ -e 's/^/fix:software:patches:non-configured::/' /dev/null | sed -e 's/^/fix:software:postfix::/' prefix="fix:software:Predictive" if [ -x /opt/pred/bin/psconfig ] then /opt/pred/bin/psconfig print configuration 2>&1 | sed -e '1,/^---/d' | sed -e "s/^/${prefix}:psconfig::config: /" /opt/pred/bin/psconfig print versions 2>&1 | sed -e '1,/^---/d' | sed -e "s/^/${prefix}:psconfig::ruleset: /" scc_check_file /etc/uucp/Devices "${prefix}:/etc/uucp/Devices::" "#" scc_check_file /etc/uucp/Dialers "${prefix}:/etc/uucp/Dialers::" "#" [ ${SCC_PROFILING} ] && scc_timing "end of: software: Predictive" fi prefix="" scc_check_file /etc/prmconf "fix:software:PRM /etc/prmconf::" "#" testparm -s 2>/dev/null | awk '/^\[.*\]$/ { prefix=$1; next; } { if ( NR == 1 ) { prefix="general"; } if ( NF > 0 ) { print prefix "::" $0; } }' | sed -e 's/^\[//' \ -e 's/]::/::/' \ -e 's/^/fix:software:samba:/' # Service Control Manager # Only report SCM when this is a management system, otherwise ignore if [ -x /etc/rc.config.d/ServCtlMgr ] then . /etc/rc.config.d/ServCtlMgr if [ ${SCM_START_CMS} = 1 ] then if [ -x /opt/mx/bin/mxnode ] then /opt/mx/bin/mxauth -lt 2>&1 | sed -e 's/^/fix:software:Service Control Manager:autorisation::/' /opt/mx/bin/mxnode -lt 2>&1 | sed -e 's/^/fix:software:Service Control Manager:nodes::/' /opt/mx/bin/mxngroup -lt 2>&1 | sed -e 's/^/fix:software:Service Control Manager:nodegroup::/' /opt/mx/bin/mxrole -lt 2>&1 | sed -e 's/^/fix:software:Service Control Manager:role::/' /opt/mx/bin/mxuser -lt 2>&1 | sed -e 's/^/fix:software:Service Control Manager:users::/' fi if [ -x /opt/mx/bin/mxtool ] then /opt/mx/bin/mxtool -ld 2>/dev/null | grep "/Category:" | cut -c25- | sort -u | while read cat do /opt/mx/bin/mxtool -ld -c "${cat}" 2>/dev/null | grep "^Tool name:" | cut -c25- | sort -u | while read tool do /opt/mx/bin/mxtool -ld -t "${tool}" 2>&1 | sed -e "s/^/fix:software:SCM:category ${cat}::${tool}: /" done done fi fi fi if [ -x /opt/scr/bin/scrconfig ] then # System Configuration Repository /opt/scr/bin/scrconfig 2>/dev/null | sed -e 's@[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9] ......@MM/DD/YYYY HH:MM ??? @' \ -e 's/^/fix:software:SCR:config::/' /opt/scr/bin/scrfilter 2>/dev/null | while read filter do /opt/scr/bin/scrfilter -l "${filter}" 2>/dev/null | sed -e "s/^/fix:software:SCR:filter ${filter}::/" \ -e 's/ *on$/ on/' \ -e 's/ *off$/ off/' done fi echo "" | sendmail -bt -d 2>/dev/null | sed -e '/^[ ]*$/d' \ -e '/getla/d' \ -e '/assign_queueid/d' \ -e 's/Real.UG.id=[^:]*:[^:]*,//' \ -e 's/^/fix:software:sendmail:options::/' for f in aliases sendmail.cf sendmail.mc service.switch local-host-names trusted-users do for d in /etc/postfix /etc /etc/mail do # Stop when the file is found. scc_check_file "${d}/${f}" "fix:software:sendmail:${d}/${f}::" "#" && break done done ls -l /etc/smrsh/* 2>/dev/null | scc_ls | sed -e 's@^@fix:software:sendmail:/etc/smrsh::@' if [ -x /usr/sbin/cmquerycl ] then grep -q "/usr/lbin/c[m]cld" ${PROC_FILE} if [ $? -eq 0 ] then echo "fix:software:ServiceGuard:general::status: active" /usr/sbin/cmquerycl -v | sed -e 's/^/var:software:ServiceGuard:sw-status::/' /usr/sbin/cmgetconf 2>/dev/null | sed -e '/^#/d' \ -e '/does not have an ID, or a disk label/d' \ -e '/cannot be included in the topology/d' \ -e '/^[Uu]se /d' \ -e 's/^/fix:software:ServiceGuard:cluster::/' | uniq /usr/sbin/cmviewcl -v 2>${TMP1_FILE} | sed -e "s/^/var:software:ServiceGuard:status::/" scc_check_file ${TMP1_FILE} "fix:software:ServiceGuard:messages::" "#" rm -f ${TMP1_FILE} # Get the status of the package. /usr/sbin/cmviewcl -l package 2>/dev/null | sed -e '/^[ ]*$/d' \ -e '/PACKAGE/d' \ -e 's/^[ ]*//' \ -e 's/[ ].*//' | sort | while read pkg remainder do /usr/sbin/cmgetconf -v -p ${pkg} | sed -e '/^#/d' \ -e '/^[ ]*$/d' \ -e "s/^/fix:software:ServiceGuard:${pkg}::/" /usr/sbin/cmgetconf -p ${pkg} | awk '/^RUN_SCRIPT[ ]/ { run = $2; print $2, $1 } /^HALT_SCRIPT[ ]/ { if ( $2 != run ) print $2, $1 }' | while read file category do scc_check_file "${file}" "fix:software:ServiceGuard:${pkg}::${category}: " "#" done done else echo "fix:software:ServiceGuard:general::status: inactive" fi fi grep -q "squid.*-f" ${PROC_FILE} if [ $? -eq 0 ] then grep "squid.*-f" ${PROC_FILE} | sed -e 's/.*squid.*-f *//' \ -e 's/ .*//' else # In order to let the following code work, squid should be located in # one of the directories of PATH. Or a symbolic link to the executable # should be placed in directory ${SCC_BIN}. squid -h 2>&1 | awk '/ *-f file/ { if ( NF > 7 ) { print $8; } else { getline; print $1; } }' fi >${TMP1_FILE} scc_keep_squid_count="software:squid:count" scc_keep_squid_config="software:squid:config" if [ -s ${TMP1_FILE} ] then # We collected a config-file from a running squid. squid_cfg=$(cat ${TMP1_FILE}) squid_cnt=1 else # Use the config-file from a previous run of SCC. # Use this data for max. 5 runs of SCC. squid_cnt=$(sed -n -e "s/^${scc_keep_squid_count}://p" ${SCC_KEEP_CONFIG}) squid_cnt=$(( ${squid_cnt:-0} + 1 )) squid_cfg="" if [ ${squid_cnt} -lt 5 -a ${squid_cnt} -gt 1 ] then squid_cfg=$(sed -n -e "s/^${scc_keep_squid_config}://p" ${SCC_KEEP_CONFIG}) fi fi if [ -n "${squid_cfg}" ] then scc_check_file "${squid_cfg}" "fix:software:squid:${squid_cfg}::" "#" if [ -f "${squid_cfg}" ] then # Keep the name of the config-file in the case that squid # is not running during the next run of SCC. echo "${scc_keep_squid_config}:${squid_cfg}" >>${SCC_KEEP_NEW} echo "${scc_keep_squid_count}:${squid_cnt}" >>${SCC_KEEP_NEW} fi fi rm -f ${TMP1_FILE} sram_dir=/etc/opt/sram sram_cfg=${sram_dir}/user.ini if [ -f ${sram_cfg} ] then include_path=$(sed -n -e 's/^include=//p' ${sram_cfg}) specs=$(sed -n -e 's/^configfile=//p' ${sram_cfg}) # Select the existing directories to speed-up finding the included files. touch ${TMP1_FILE} dir_list=$(for d in $(echo ${sram_dir} ${include_path} | sed -e 's/:/ /g') do if [ -d "${d}" ] then echo "${d}" # Check all include directories in case configfile is a relative path. if [ -f "${d}/${specs}" ] then echo "${d}/${specs}" >${TMP1_FILE} fi fi done) if [ ! -f "${specs}" ] then specs=$(<${TMP1_FILE}) fi rm -f ${TMP1_FILE} scc_check_file ${sram_cfg} "fix:software:SRAM:${sram_cfg}::" "#" # ${TMP1_FILE} holds the hierarchy. # We process the hierarchy to find new includes. # ${TMP2_FILE} holds the hierarchy and its includes. # We loop until there are no new includes. level=0 todo="${specs}" echo "${specs}" >${TMP1_FILE} while [ -n "${todo}" ] do level=$(( ${level} + 1 )) if [ ${level} -gt 20 ] then echo "fix:messages::nesting too deep for SRAM: ${level}" fi todo="" >${TMP2_FILE} while read l f do if [ -n "${f}" ] then # level and file are determined: ready echo "${l} ${f}" >>${TMP2_FILE} continue; fi f="${l}" if [ ! -f "${f}" ] then echo "fix:messages::missing include file for SRAM: ${f}" continue fi echo "${level} ${f}" >>${TMP2_FILE} # Now we are adding the includes of ${f} without a level indicator. # Process these files at the next level (run of the outer loop). sed -n -e 's/^[ ]*include[ ]*"//p' "${f}" | sed -e 's/";.*//' | while read inc remainder do if [ -f "${inc}" ] then todo="${inc}" echo "${inc}" >>${TMP2_FILE} else for d in ${dir_list} do if [ -f "${d}/${inc}" ] then todo="${d}/${inc}" echo "${d}/${inc}" >>${TMP2_FILE} break fi done fi done done <${TMP1_FILE} mv ${TMP2_FILE} ${TMP1_FILE} done # Add the hierarchy to the snapshot awk '{ # Syntax is: printf( "fix:software:SRAM:hierarchy::" ); # Replace the level by indentation. for ( i = 1; i < $1; i++ ) { printf( " " ); } $1 = ""; print; }' ${TMP1_FILE} # Add the config and all included files to the snapshot. sed -e 's/^[0-9][0-9]*.//' ${TMP1_FILE} | sort -u | while read file remainder do sed -e "s@^@fix:software:SRAM:${file}::@" ${file} done rm -f ${TMP1_FILE} ${TMP2_FILE} fi scc_check_file /etc/sudoers "fix:software:sudo::/etc/sudoers " "#" if [ -d ~sybase ] then ( cd ~sybase if [ -h interfaces ] then link=$(ls -l interfaces | awk '{ print $NF }') cd $(dirname ${link}) fi if [ -f interfaces ] then awk '/#/ { next } /^[ ]*$/ { next } /^[^ ]/ { prefix = $1 } { printf( "fix:software:sybase:%s::interface: %s\n", prefix, $0 ) }' interfaces fi for f in init/*/version do scc_check_file "${f}" "fix:software:sybase:version:$(basename ${f})::" "#" done sed -n "s/.*-s//p" install/RUN_* 2>/dev/null | sed -e 's/ .*//' | sort -u | while read dbms do grep -q "${dbms}" ${PROC_FILE} if [ $? -eq 0 ] then scc_check_file "${dbms}.cfg" "fix:software:sybase:${dbms}.cfg::" "#" | grep -v "DEFAULT$" fi done ) fi # Switch-over is replaced after HP-UX 10.20 by MC/ServiceGuard scc_check_file /etc/switch/Switchinfo "fix:software:switchover:/etc/switch/Switchinfo::" "#" scc_check_file /etc/switch/become "fix:software:switchover:/etc/switch/become::" "#" scc_check_file /var/adm/sw/.codewords "fix:software:swinstall /var/adm/sw/.codewords::" "#" syslog_cfg=$(sed -n -e 's/.*[s]yslogd.*-f *//p' ${PROC_FILE} | sed -e 's/ .*//') if [ ! -f "${syslog_cfg}" ] then syslog_cfg=/etc/syslog.conf fi scc_check_file "${syslog_cfg}" "fix:software:syslogd ${syslog_cfg}::" "#" exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0700_s_hp_ov010050000000000000003000000301110774770013000223250ustar00rootsys00000000000000#!/bin/sh # Shell script to collect HP OpenView data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.9 $ . ${SCC_BIN}/scc_modules/scc_utils ############################################################################### # OV Performance ############################################################## ############################################################################### # OV Performance agent ######################################################## fixclass="fix:HP OpenView:Performance agent" if [ -x /opt/perf/bin/agsysdb ] then /opt/perf/bin/agsysdb -l 2>/dev/null | sed -e "s/^/${fixclass}:agsysdb::/" fi scc_check_file /var/opt/perf/parm "${fixclass}:/var/opt/perf/parm::" "#" scc_check_file /var/opt/perf/adviser.syntax "${fixclass}:/var/opt/perf/adviser.syntax::" "#" scc_check_file /var/opt/perf/alarmdef "${fixclass}:/var/opt/perf/alarmdef::" "#" scc_check_file /var/opt/perf/perflbd.rc "${fixclass}:/var/opt/perf/perflbd.rc::" "#" scc_check_file /var/opt/perf/ttd.conf "${fixclass}:/var/opt/perf/ttd.conf::" "#" # OV Performance server ####################################################### fixclass="fix:HP OpenView:Performance manager" if [ -x /opt/perf/bin/pvsysdb ] then # From Paul te Vaanholt: /opt/perf/bin/pvsysdb -ll 2>/dev/null | sed -e 's/: */:/' \ -e 's/ *$//' | awk -v class="${fixclass}" -F: '$1 ~ /System Name/ { groups = ""; sysname = $2; next } $1 ~ /Data comm key/ { dckey = $2; next } $1 ~ /GroupName/ { if ( length( $2 ) ) { groups = sprintf( "%s %s,", groups, $2 ); } next } $1 ~ /Monitor Alarms/ { printf( "%s:database::%s:%s:alarm %s:%s\n",\ class, sysname, dckey, $2, groups ); }' | sort fi scc_check_file /var/opt/perf/pv.hosts "${fixclass}:pv.hosts::" "#" ############################################################################### # OV Network Node Manager ##################################################### ############################################################################### fixclass="fix:HP OpenView:Network Node Manager" varclass="var:HP OpenView:Network Node Manager" export NNM_CONF=/etc/opt/OV/share/conf export NNM_WWW=/etc/opt/OV/share/www scc_check_file "${NNM_CONF}/ov.conf" "${fixclass}:ov.conf::" "#" scc_check_file "${NNM_CONF}/ovsuf" "${fixclass}:ovsuf::" "#" scc_check_file "${NNM_CONF}/polling" "${fixclass}:polling::" "#" scc_check_file "${NNM_CONF}/trustedCmds.conf" "${fixclass}:trustedCmds.conf::" "#" if [ -x /opt/OV/bin/xnmtopoconf ] then /opt/OV/bin/xnmtopoconf -print 2>/dev/null | sed -e "s/^/${fixclass}:collector stations::/" fi if [ -x /opt/OV/bin/snmpwalk ] then /opt/OV/bin/snmpwalk $(hostname) .1.3.6.1.4.1.11.2.17.4.3.1.1.2 2>/dev/null | awk '$0 !~ /^no MIB/ { print $NF }' | sort | sed -e "s/^/${fixclass}:remote managers::/" fi if [ -f ${NNM_CONF}/C/trapd.conf ] then awk -v class="${fixclass}" '/^#/ { next } /^FORMAT/ { next } /^DISPLAY/ { next } { if ( ! event_seen ) { prefix = $1; } } /^EVENT/ { prefix = "EVENT"; event_seen = 1 }; /^EXEC/ { $0 = substr( $0, 1, 60 ) } /^SDESC/ { ignore = 1; next } /^EDESC/ { ignore = 0; next } { if ( ! ignore ) { if ( $1 == prefix ) $1 = " "; print class ":trapd.conf " prefix "::" $0; } }' ${NNM_CONF}/C/trapd.conf fi if [ -f ${NNM_CONF}/C/filters ] then # This file can contain very long lines. Split line after the OR operator (||). sed -e 's/\/\/.*//' \ -e '/^[ ]*$/d' \ -e 's/||[ ]*/||\ /g' ${NNM_CONF}/C/filters | sed -e "s@^@${fixclass}:C/filters::@" fi for f in ${NNM_CONF}/eventFilters/* do scc_check_file "${f}" "${fixclass}:eventFilters/$(basename ${f})::" "#" done scc_check_file "${NNM_CONF}/stacks/pmd/OV_EVENT.cfg" "${fixclass}:stacks/pmd/OV_EVENT.cfg::" "#" if [ -f ${NNM_CONF}/snmpmib ] then grep "^-- START OF MIB" ${NNM_CONF}/snmpmib | sed -e "s/^/${fixclass}:snmpmib::/" fi scc_check_file "${NNM_CONF}/mib.coerce" "${fixclass}:mib.coerce::" "#" if [ -f /etc/opt/OV/share/conf/mibExpr.conf ] then # Ignore the comments in this file. The parts of the expressions are on # separate lines. Join the lines to reduce the size of the snapshot. # This also clarifies detected changes. awk '/^[ ]*#/ { next } /^[ ]*$/ { next } /^"/ { ignore = 1; next } /"[ ]*\\$/ { ignore = 0; next } /\\$/ { # Fold continuation lines on a single line. if ( ! ignore ) { printf( "%s ", $0 ); } next } { # End of continuation reached. if ( ! ignore ) { print } ignore = 0; }' /etc/opt/OV/share/conf/mibExpr.conf | sed -e 's/\\//g' \ -e "s/^/${fixclass}:mibExpr.conf::/" fi scc_check_file "${NNM_CONF}/snmpCol.conf" "${fixclass}:snmpCol.conf::" "#" scc_check_file "${NNM_CONF}/snmpRep.conf" "${fixclass}:snmpRep.conf::" "#" if [ -f ${NNM_CONF}/ovsuf ] then grep "^0:netmon:.*-s" ${NNM_CONF}/ovsuf | sed -e 's/.*-s[ ]*//' \ -e 's/[ ]*:.*//' | while read seedfile do scc_check_file "${seedfile}" "${fixclass}:netmon seed file ${seedfile}::" "#" done fi for f in netmon.equivPorts netmon.cmstr netmon.statusIntervals netmon.snmpStatus netmon.noDiscover do scc_check_file "${NNM_CONF}/${f}" "${fixclass}:${f}::" "#" done scc_check_file "${NNM_CONF}/oid_to_sym" "${fixclass}:oid_to_sym::" "#" scc_check_file "${NNM_CONF}/oid_to_type" "${fixclass}:oid_to_type::" "#" scc_check_file "${NNM_CONF}/HPoid2type" "${fixclass}:HPoid2type::" "#" scc_check_file "${NNM_CONF}/physAddr.conf" "${fixclass}:physAddr.conf::" "#" scc_check_file "${NNM_CONF}/ovdbconf" "${fixclass}:ovdbconf::" "#" scc_check_file "${NNM_CONF}/ovspmd.auth" "${fixclass}:ovspmd.auth::" "#" scc_check_file "${NNM_CONF}/ovw.auth" "${fixclass}:ovw.auth::" "#" scc_check_file "${NNM_CONF}/ovwdb.auth" "${fixclass}:ovwdb.auth::" "#" scc_check_file "${NNM_WWW}/conf/session.conf" "${fixclass}:conf/session.conf::" "#" scc_check_file "${NNM_CONF}/defaultperms.conf" "${fixclass}:defaultperms.conf::" "#" if [ -f ${NNM_WWW}/etc/htpasswd ] then sed -e 's/:.*//' \ -e "s@^@${fixclass}:www/etc/htpasswd::@" ${NNM_WWW}/etc/htpasswd fi scc_check_file "${NNM_WWW}/etc/htgroup" "${fixclass}:www/etc/htgroup::" "#" if [ -x /opt/OV/bin/ovwls ] then /opt/OV/bin/ovwls 2>&1 | sort -k 2 | sed -e "s/^/${varclass}:ovwls::/" fi ############################################################################### # End of OV Network Node Manager ############################################## ############################################################################### ############################################################################### # OV Data Protector ########################################################### ############################################################################### # OV Data Protector agent ##################################################### fixclass="fix:HP OpenView:Data Protector agent" varclass="var:HP OpenView:Data Protector agent" if [ -d /opt/omni/newconfig/etc/opt/omni/customize ] then ( cd /opt/omni/newconfig/etc/opt/omni/customize for f in .Version* do sed -e "s/^/${fixclass}:agent::${f}: /" "${f}" done ) fi scc_check_file /etc/opt/omni/cell/omni_info "${fixclass}:omni_info::" "#" scc_check_file /etc/opt/omni/cell/cell_server "${fixclass}:cell_server::" "#" scc_check_file /opt/omni/.omnirc "${fixclass}:.omnirc::" "#" # OV Data Protector manager ################################################### fixclass="fix:HP OpenView:Data Protector manager" varclass="var:HP OpenView:Data Protector manager" if [ -x /opt/omni/lbin/rds -a -n "$(ps -e | awk '$NF == "rds" { print }')" ] then omni=/etc/opt/omni ### cell information scc_check_file ${omni}/cell/installation_servers "${fixclass}:cell:installation_servers::" "#" scc_check_file ${omni}/cell/CellServers "${fixclass}:cell:CellServers::" "#" scc_check_file ${omni}/cell/cell_info "${fixclass}:cell:cell_info::" "#" | sort scc_check_file "${omni}/options/global" "${fixclass}:cell:parameters::" "#" /opt/omni/bin/omnicc -query | sed -e "s/^/${fixclass}:cell:license::/" scc_check_file "${omni}/Version" "${fixclass}:cell:initial version::" "#" scc_check_file "/opt/omni/newconfig/${omni}/Version" "${fixclass}:cell:current version::" "#" ### user information scc_check_file ${omni}/users/ClassSpec "${fixclass}:cell:group permissions::" "#" scc_check_file ${omni}/users/UserList "${fixclass}:cell:users::" "#" ### device information /opt/omni/bin/omnidownload -list_libraries -detail | sed -e "s/^/${fixclass}:devices and media:library details::/" /opt/omni/bin/omnidownload -list_devices | sed -e "s/^/${fixclass}:devices and media:device overview::/" /opt/omni/bin/omnidownload -list_devices -detail | sed -e "s/^/${fixclass}:devices and media:device details::/" # erase the free-column. /opt/omni/bin/omnicellinfo -mm | sed -e 's/ *[0-9][0-9]*$//' \ -e "s/^/${fixclass}:devices and media:media pools::/" ### datalist information /opt/omni/bin/omnicellinfo -group 2>/dev/null | sed -e "s/^/${fixclass}:datalists:datalist groups::/" ls ${omni}/schedules 2>/dev/null | grep -v "core$" | while read sched do sys="$(basename "${sched}")" scc_check_file "${omni}/datalists/${sys}" "${fixclass}:datalists:(filesystem) ${sys}::" "#" scc_check_file "${omni}/schedules/${sys}" "${fixclass}:datalists:(filesystem) ${sys} - schedule::" "#" done ls ${omni}/barschedules/oracle 2>/dev/null | grep -v "core$" | while read sched do sys="$(basename "${sched}")" scc_check_file "${omni}/barlists/oracle/${sys}" "${fixclass}:datalists:(oracle) ${sys}::" "#" scc_check_file "${omni}/barschedules/oracle/${sys}" "${fixclass}:datalists:(oracle) ${sys} - schedule::" "#" done ### Database information scc_check_file "${omni}/purge_schedule" "${fixclass}:database:purge_schedule::" "#" /opt/omni/sbin/omnidbutil -list_dcdirs 2>/dev/null | sed -e "s/^/${fixclass}:database:dc directories::/" /opt/omni/sbin/omnidbutil -info 2>/dev/null | sed -e "s/^/${varclass}:database:usage::/" fi ############################################################################### # End of OV Data Protector #################################################### ############################################################################### ############################################################################### # OV Operations agent ######################################################### ############################################################################### fixclass="fix:HP OpenView:Operations agent" scc_check_file /var/opt/OV/conf/OpC/nodeinfo "${fixclass}:/var/opt/OV/conf/OpC/nodeinfo::" "#" scc_check_file /var/opt/OV/conf/OpC/opcnetls "${fixclass}:/var/opt/OV/conf/OpC/opcnetls::" "#" scc_check_file /opt/OV/bin/OpC/install/opcinfo "${fixclass}:/opt/OV/bin/OpC/install/opcinfo::" "#" if [ -x /opt/OV/bin/OpC/opctemplate ] then # OPC version 6 /opt/OV/bin/OpC/opctemplate 2>/dev/null | sed -e '1,3d' | sort -i | sed -e '/^[ ]*$/d' \ -e "s/^/${fixclass}:opctemplate::/" fi ############################################################################### # End of OV Operations ######################################################## ############################################################################### exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0700_u_hp_ovou_srv010050000000000000003000002365320774770013000236040ustar00rootsys00000000000000#!/bin/sh # Shell script for HP OpenView OV Operations module for SCC. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This module has been developed and contributed by: Paul te Vaanholt # SCC-release: 1.4.28 # file-version: $Revision: 1.5 $ . ${SCC_BIN}/scc_modules/scc_utils # Logic of opccfgdwn data processing: # # - If needed ($OPCDWN = 1), a download is created (in $OPCDWN_DIR) # # - The download data is split into separate files (in $SPLIT_DIR) # # - The template group file is split to: # + tgd_*: template group details, including members of the template group # + tgm_*: template group members, used for removing template group # nesting # + tmotg_*: template is member of template groups, used for template # reporting # + tgmotg_*: template group is member of template groups, used for template # group reporting # # - The template files are split to: # + td_*: template details # # - The node group file is split to: # + ngd_*: node group details, including node members and template (group) # assignments # + ngm_*: node group members (both node and template (group)), used for # removing template group nesting # + nmong_*: node is member of node group, used for node reporting # + tatng_*: template is assigned to node group, used for template reporting # + tgatng_*: template group is assigned to node group, used for template # group reporting and removing nesting # # - The node file is split to: # + nd_*: node details, including template (group) assignments # + nm_*: node members (template (group)), used for removing template # group nesting # + tatn_*: template is assigned to node, used for template reporting # + tgatn_*: template group is assigned to node, used for template group # reporting and removing nesting # # - The node hierarchy file is split to: # + nhd_*: node hierarchy details # + nh_*: node hierarchy components # # - User file (containing operators, template administrators and profiles) is # split to: # + u_op_*: operator details # + u_ta_*: template administrator details # + u_pr_*: user profile details # + u_uk_*: unknown user type files (these files should not show up) # + aatop_*: application is assigned to operator # + aatpr_*: application is assigned to user profile # + agatop_*: application group is assigned to operator # + agatpr_*: application group is assigned to user profile # # - Application file (containing both applications and application groups) is # split to: # + ad_*: application details # + amoag_*: application is member of application group # + agd_*: application group details, including members (applications and # sub application groups) # + agm_*: application group members, used for removing nesting # # - Instruction text interface file is split to: # + ii_*: instruction text interface details # # - Template group nesting is removed from: # + tgm_*: template group members # + ngm_*: node group members # + nm_*: node members # # - Application group nesting is removed from: # + agm_*: application group members # # - Node group members: template (group) are added to node member files: # + nm_*: node members # # - Template active on node information is extracted from nm_* into: # + taon_*: template active on node # # - Responsibility data is reformatted in: # + u_pr_*: user profiles # + u_op_*: operators # # - Template data is reported from: # + td_*: template details # + tmotg_*: template member of template groups # + tatn_*: template is assigned to nodes # + tatng_*: template is assigned to node groups # + taon_*: template is active on nodes (nesting removed, treated as var # to prevent unnecessary difference messages) # # - Template group data is reported from: # + tgd_*: template group details # + tgmotg_*: template group is member of template groups # + tgatn_*: template group is assigned to nodes # + tgatng_*: template group is assigned to node groups # + tgm_*: template group members (nesting removed, treated as var to # prevent unnecessary difference messages) # # - Template usage data is reported from: # + nm_*: node member files (nesting removed, contains templates on # node) # # - Message group data is reported from # + download file # # - Node data is reported from: # + nd_*: node details # + nmong_*: node member of node groups # + nm_*: node members (templates active on that node) (nesting removed, # treated as var to prevent unnecessary difference messages) # # - Node group data is reported from: # + ngd_*: node group details # + ngm_*: node group members, only templates (nesting removed, treated # as var to prevent unnecessary difference messages) # # - Node hierarchy data is reported from: # + nhd_*: node hierarchy details # + nhm_*: node hierarchy members # # - Application data is reported from: # + ad_*: application details # + amoag_*: application is member of application groups # + aatop_*: application is assigned to operators # + aatpr_*: application is assigned to user profiles # # - Appliaction group data is reported from: # + agd_*: application group details # + agmoag_*: application group is member of application group # + agatop_*: application group is assigned to operators # + agotpr_*: application group is assigned to user profiles # # - User profile data is reported from: # + u_pr_*: user profiles # # - Operator data is reported from: # + u_op_*: operators # # - Template administrator data is reported from: # + u_ta_*: template administrators fixclass="fix:HP OpenView:Operations manager" varclass="var:HP OpenView:Operations manager" msgclass="fix:messages::HP OpenView:Operations manager" OV_CONF=/etc/opt/OV/share/conf OV_BIN=/opt/OV/bin # First check whether this host runs OpenView Operations for Unix. if [[ ! -x ${OV_BIN}/OpC/opcsv || $(${OV_BIN}/OpC/opcsv 2>/dev/null | grep opcctlm | grep -c "is running") -ne 1 ]] then # it seems either opcsv does not exist or opcctlm is not running # no further checks needed exit 0 fi OPCDWN=${OPCDWN:-1} OPCDWN_DIR=${OPCDWN_DIR:-${SCC_TMP}/opcdwn} SPLIT_DIR=${SCC_TMP}/opcsplit TGROUP=${OPCDWN_DIR}/C/TEMPLATES/TEMPLGROUP/templgroup.dat NGROUP=${OPCDWN_DIR}/C/NODEGROUPS/nodegroups.dat NODES=${OPCDWN_DIR}/C/NODES/nodes.dat LE_TEMPL=${OPCDWN_DIR}/C/TEMPLATES/LOGFILE/logfile.dat MI_TEMPL=${OPCDWN_DIR}/C/TEMPLATES/INTERFACE/interface.dat M_TEMPL=${OPCDWN_DIR}/C/TEMPLATES/MONITOR/monitor.dat TI_TEMPL=${OPCDWN_DIR}/C/TEMPLATES/TRAP/trap.dat CM_TEMPL=${OPCDWN_DIR}/C/TEMPLATES/CONSOLE/console.dat SA_TEMPL=${OPCDWN_DIR}/C/TEMPLATES/SCHEDULE/schedule.dat EC_TEMPL=${OPCDWN_DIR}/C/TEMPLATES/EC/ec.dat OPERS=${OPCDWN_DIR}/C/OPERATORS/operators.dat MSGGRPS=${OPCDWN_DIR}/C/MSGGROUPS/msggroups.dat NODEHIER=${OPCDWN_DIR}/C/NODEHIER/nodehier.dat APPS=${OPCDWN_DIR}/C/APPLICATIONS/applications.dat DBMAINT=${OPCDWN_DIR}/C/OTHER/DBMAINT/dbmaint.dat INSTR_INTERF=${OPCDWN_DIR}/C/OTHER/INSTINTF/instintf.dat SVRCFG=${OPCDWN_DIR}/C/OTHER/MGMTSV/mgmtsv.dat TROUBLET=${OPCDWN_DIR}/C/OTHER/TROUBLET/troublet.dat OV_CUST=/var/opt/OV/share/databases/OpC/mgd_node/customer ############################################################################### # Clear split directory ####################################################### ############################################################################### clear_split () { [[ -d ${SPLIT_DIR} ]] && rm -Rf ${SPLIT_DIR} mkdir -p ${SPLIT_DIR} } ############################################################################### # Remove tmp directories ###################################################### ############################################################################### remove_tmp_dirs () { [[ -d ${SPLIT_DIR} ]] && rm -Rf ${SPLIT_DIR} [[ -d ${SCC_TMP}/opcdwn ]] && rm -Rf ${SCC_TMP}/opcdwn # default download dir } ############################################################################### # AWK functions in variables ################################################## ############################################################################### AWK_LIB=' function w_out (w_text, w_file) { if (w_file == detailfile) printf ("%s", SCC_CLASS) > w_file print w_text > w_file } function w_outf (w_text1, w_text2, w_file) { sub (/^[ ]*/, "", w_text2) sub (/[ ]*$/, "", w_text2) if ( w_text2 != "" && w_text2 != "\"\"" ) { if (w_file == detailfile) printf ("%s", SCC_CLASS) > w_file print w_text1 w_text2 > w_file } } function clean (w_text) { gsub (/_/, "_0_", w_text) gsub (/\//, "_1_", w_text) gsub (/\"/, "_2_", w_text) gsub (/'"\'"'/, "_3_", w_text) gsub (/\(/, "_4_", w_text) gsub (/\)/, "_5_", w_text) gsub (/\|/, "_6_", w_text) gsub (/\?/, "_7_", w_text) gsub (/\*/, "_8_", w_text) gsub (/ /, "_9_", w_text) gsub (/ /, "_10_", w_text) gsub (/&/, "_11_", w_text) gsub (/\[/, "_12_", w_text) gsub (/\]/, "_13_", w_text) gsub (/\/, "_15_", w_text) gsub (/#/, "_16_", w_text) return w_text } function scc_clean (w_text) { gsub (/:/, "..", w_text) return w_text } function get_value () { w_text = substr ($0, index ($0, $2)) sub ("^\"", "", w_text) sub ("\"$", "", w_text) gsub ("\\\"", "\"", w_text) gsub ("\\\\", "\\", w_text) return w_text } function get_qvalue () { w_text = substr ($0, index ($0, "\"")) sub ("^\"", "", w_text) sub ("\"$", "", w_text) gsub ("\\\"", "\"", w_text) gsub ("\\\\", "\\", w_text) return w_text }' AWK_MEMBER_TEMPLATE=' $1 == "MEMBER_LOGFILE" { member = get_value() w_out("logfile " member, filename) memfile = "t" fileprefix clean(member) print " " parent >> memfile close (memfile) } $1 == "MEMBER_MONITOR" { member = get_value() w_out("monitor " member, filename) memfile = "t" fileprefix clean(member) print " " parent >> memfile close (memfile) } $1 == "MEMBER_OPCMSG" { member = get_value() w_out("opcmsg " member, filename) memfile = "t" fileprefix clean(member) print " " parent >> memfile close (memfile) } $1 == "MEMBER_SNMP" { member = get_value() w_out("snmp " member, filename) memfile = "t" fileprefix clean(member) print " " parent >> memfile close (memfile) } $1 == "MEMBER_ECS" { member = get_value() w_out("ecs " member, filename) memfile = "t" fileprefix clean(member) print " " parent >> memfile close (memfile) } $1 == "MEMBER_SCHED" { member = get_value() w_out("sched. " member, filename) memfile = "t" fileprefix clean(member) print " " parent >> memfile close (memfile) } $1 == "MEMBER_CONSOLE" { member = get_value() w_out("console " member, filename) memfile = "t" fileprefix clean(member) print " " parent >> memfile close (memfile) } $1 == "MEMBER_TEMPLATE_GROUP" { member = get_value() w_out("group " member, filename) memfile = "tg" fileprefix clean(member) print " " parent >> memfile close (memfile) }' AWK_TEMPL_OPTS=' function clr_opts () { T_DESCRIPTION = "" T_LOGPATH = "" T_EXEFILE = "" T_READFILE = "" T_INTERVAL = "" T_MONPROG = "" T_MIB = "" T_TRESTYPE = "" T_MSGGEN = "" T_CHSET = "" T_SEPARATORS = "" T_NO_LOGFILE_MSG = "" T_ICASE = "yes" T_SCANMODE = "" T_FORWARD = "" T_DEF_NODE = "" T_DEF_SEV = "" T_DEF_APP = "" T_DEF_MSGGRP = "" T_DEF_OBJECT = "" T_DEF_MAPCOLOR = "" T_DEF_MSGKEY = "" T_DEF_SERV_NAME = "" T_SUPPMODE = "" T_MPI_SV = "" T_MPI_AGT = "" DATA_PRINTED = 0 MSGNR = 1 } function print_templ_opts () { w_outf("Scan mode : ", T_SCANMODE, detailfile) w_outf("", T_FORWARD, detailfile) if (T_LOGPATH != "") { if (T_NO_LOGFILE_MSG == "yes") w_out("Logfile : " T_LOGPATH ", message on no logfile", detailfile) else w_out("Logfile : " T_LOGPATH, detailfile) } if (length (T_EXEFILE) + length (T_READFILE) > 0) { w_out("File to be executed : " T_EXEFILE, detailfile) w_out("File to be read : " T_READFILE, detailfile) } w_outf("Polling interval : ", T_INTERVAL, detailfile) if (length (T_SEPARATORS) > 0) w_out("Fieldseparators : " T_SEPARATORS, detailfile) else w_out("Fieldseparators : default", detailfile) w_out("Case sensitivity : " T_ICASE, detailfile) if (length (T_CHSET) > 0) w_out("Character set : " T_CHSET, detailfile) if ((length (T_SUPPMODE) + length (T_DEF_MSGKEY) + length (T_DEF_NODE) + length (T_DEF_APP) + length (T_DEF_MSGGRP) + length (T_OBJECT) + length (T_DEF_MAPCOLOR) + length (T_DEF_SERV_NAME) + length (T_MPI_SV) + length (T_MPI_AGT) > 0) || !((length (T_DEF_SEV) == 0) || (T_DEF_SEV == "Unknown"))) { w_out("Condition defaults:", detailfile) w_outf(" ", T_SUPPMODE, detailfile) w_outf(" Message key : ", T_DEF_MSGKEY, detailfile) if ((length (T_DEF_SEV) > 0) && (T_DEF_SEV != "Unknown")) { w_out(" Set severity to : " T_DEF_SEV, detailfile) } w_outf(" Set node to : ", T_DEF_NODE, detailfile) w_outf(" Set application to : ", T_DEF_APP, detailfile) w_outf(" Set message group to : ", T_DEF_MSGGRP, detailfile) w_outf(" Set object to : ", T_DEF_OBJECT, detailfile) w_outf(" Set map color to : ", T_DEF_MAPCOLOR, detailfile) w_outf(" Service name : ", T_DEF_SERV_NAME, detailfile) w_outf(" ", T_MPI_AGT, detailfile) w_outf(" ", T_MPI_SV, detailfile) } w_out("Conditions:", detailfile) } /^ DESCRIPTION/ { T_DESCRIPTION = get_value() } /^ LOGPATH / { T_LOGPATH = get_value() } /^ EXEFILE / { T_EXEFILE = get_value() } /^ READFILE / { T_READFILE = get_value() } /^ INTERVAL / { T_INTERVAL = get_value() } /^ MONPROG / { T_MONPROG = get_value() } /^ MIB / { T_MIB = get_value() gsub (/ * MAXTHRESHOLD/, "", T_MIB) gsub (/ * MINTHRESHOLD/, "", T_MIB) sub (/" NODE /, "\", on node ", T_MIB) } /^ EXTERNAL/ { T_MONPROG = "external" } /MAXTHRESHOLD$/ { T_TRESTYPE = "Treshold type : maximum" } /MINTHRESHOLD$/ { T_TRESTYPE = "Treshold type : minimum" } /^ GEN_BELOW_RESET/ { T_MSGGEN = "; message generation: with reset" } /^ GEN_BELOW_THRESHOLD/ { T_MSGGEN = "; message generation: without reset" } /^ GEN_ALWAYS/ { T_MSGGEN = ", message generation: continuous" } /^ CHSET / { T_CHSET = get_value() } /^ SEPARATORS / { T_SEPARATORS = substr ($0, index ($0, "\"")) } /^ ICASE / { T_ICASE = "no" } /^ NO_LOGFILE_MSG/ { T_NO_LOGFILE_MSG = "yes" } /^ FROM_LAST_POS/ { T_SCANMODE = "scan from last position" } /^ ALWAYS_FROM_BEGIN/ { T_SCANMODE = "always scan from begin of file" } /^ FIRST_FROM_BEGIN/ { T_SCANMODE = "scan from begin of file first time" } /^ CLOSE_AFTER_READ/ { T_SCANMODE = T_SCANMODE "; close after read" } /^ FORWARD_UNMATCHED/ { T_FORWARD = "Forward unmatched messages" } /^ SEVERITY / { T_DEF_SEV = get_value() } /^ NODE / { T_DEF_NODE = get_qvalue() } /^ APPLICATION / { T_DEF_APP = get_value() } /^ MSGGRP / { T_DEF_MSGGRP = get_value() } /^ OBJECT / { T_DEF_OBJECT = get_value() } /^ MAP_COLORING / { T_DEF_MAPCOLOR = get_value() } /^ MSGKEY / { T_DEF_MSGKEY = get_value() } /^ SERVICE_NAME / { T_DEF_SERV_NAME = get_value() } /^ MSGCONDITIONS/ { MSGTYPE = "+" } /^ SUPPRESSCONDITIONS/ { MSGTYPE = "-" } /^ SUPP_UNM_CONDITIONS/ { MSGTYPE = "=" } /^ SUPP_DUPL_IDENT/ || /^ SUPP_DUPL_COND/ { if ($1 == "SUPP_DUPL_IDENT") T_SUPPMODE = "Suppress identical input messages : " else if ($1 == "SUPP_DUPL_IDENT_OUTPUT_MSG") T_SUPPMODE = "Suppress identical output messages : " else T_SUPPMODE = "Suppress messages matching condition : " getline if ($1 != "COUNTER_THRESHOLD") { INTERVAL = get_qvalue() gsub (/"/, "", INTERVAL) sub (/ RESEND /, ", resend after ", INTERVAL) T_SUPPMODE = T_SUPPMODE "for " INTERVAL " " } } /^ COUNTER_THRESHOLD/ { T_SUPPMODE = T_SUPPMODE "counter threshold: " $2 if (NF > 2) { INTERVAL = $4 gsub (/"/, "", INTERVAL) T_SUPPMODE = T_SUPPMODE ", reset counter after " INTERVAL } } /^ MPI_SV_DIVERT_MSG$/ { T_MPI_SV = "Server MSI : divert messages" } /^ MPI_SV_COPY_MSG$/ { T_MPI_SV = "Server MSI : copy messages" } /^ MPI_AGT_DIVERT_MSG$/ { T_MPI_AGT = "Agent MSI : divert messages" } /^ MPI_AGT_COPY_MSG$/ { T_MPI_AGT = "Agent MSI : copy messages" } /^ MPI_IMMEDIATE_LOCAL_ACTIONS$/ { T_MPI_SV = T_MPI_SV ", immediate local automatic actions" } ' AWK_NEW_TEMPL=' /^LOGFILE "/ || /^OPCMSG "/ || /^MONITOR "/ || /^SNMP "/ || /^CONSOLE "/ { close (detailfile) templname = get_value() detailfile = "td_" clean(templname) SCC_CLASS = BASE_CLASS scc_clean(templname) "::" # w_out(templname, detailfile) printf("%-8s%s\n", tolower($1), templname) >> alltemplates clr_opts() } ' AWK_COND_OPTS=' /^ CONDITION/ { OPTSTYPE = "condition" } /^ DESCRIPTION / { STORE_SCC_CLASS = SCC_CLASS sub(/^fix/, "var", SCC_CLASS) w_out(sprintf ("%5d Condition nr %d", MSGNR, MSGNR), detailfile) SCC_CLASS = STORE_SCC_CLASS w_outf(sprintf (" %s ", MSGTYPE), get_value(), detailfile) MSGNR += 1 } /^ SET/ { OPTSTYPE = "set" } /^ SEVERITY / { T_DEF_SEV = get_value() } /^ SEVERITY/ { if (OPTSTYPE == "condition") w_outf(" Check on severity : ", get_value(), detailfile) else w_outf(" Set severity to : ", get_value(), detailfile) } /^ APPLICATION/ { if (OPTSTYPE == "condition") w_outf(" Check on application : ", get_value(), detailfile) else w_outf(" Set application to : ", get_value(), detailfile) } /^ MSGGRP/ { if (OPTSTYPE == "condition") w_outf(" Check on group : ", get_value(), detailfile) else w_outf(" Set message group to : ", get_value(), detailfile) } /^ OBJECT/ { OBJ = get_value() sub (/" SEPARATORS "/, "\", fieldseparators: \"", OBJ) if (OPTSTYPE == "condition") w_outf(" Check on object : ", OBJ, detailfile) else w_outf(" Set object to : ", OBJ, detailfile) } /^ MSGKEY / { w_out(" Message key : " get_value(), detailfile) } /^ MSGKEYRELATION / { w_outf(" Acknowledge messages with key pattern : ", get_qvalue(), detailfile) } /^ TEXT / { COND_TEXT = get_value() if (OPTSTYPE == "condition") { sub (/" SEPARATORS "/, "\", fieldseparators: \"", COND_TEXT) if ($NF == "ICASE") sub (/ ICASE$/, ", case insensitive check", COND_TEXT) else COND_TEXT = COND_TEXT ", case sensitive check" w_out(" Check on message : " COND_TEXT, detailfile) } else w_out(" Set message text to : " COND_TEXT, detailfile) } /^ NODE / { if (OPTSTYPE == "condition") w_out(" Check on node : " get_value(), detailfile) else w_out(" Set node to : " get_value(), detailfile) } /^ SUPP_DUPL_IDENT/ || /^ SUPP_DUPL_COND/ { if ($1 == "SUPP_DUPL_IDENT") SUPPOPTS = "Suppress identical input messages : " else if ($1 == "SUPP_DUPL_IDENT_OUTPUT_MSG") SUPPOPTS = "Suppress identical output messages : " else SUPPOPTS = "Suppress messages matching condition : " getline if ($1 != "COUNTER_THRESHOLD") { INTERVAL = get_qvalue() gsub (/"/, "", INTERVAL) sub (/ RESEND /, ", resend after ", INTERVAL) SUPPOPTS = SUPPOPTS "for " INTERVAL " " } } /^ COUNTER_THRESHOLD/ { SUPPOPTS = SUPPOPTS "counter threshold: " $2 if (NF > 2) { INTERVAL = $4 gsub (/"/, "", INTERVAL) SUPPOPTS = SUPPOPTS ", reset counter after " INTERVAL } } /^ CONDITION$/ && length (SUPPOPTS) > 0 { w_out(" " SUPPOPTS, detailfile) ; SUPPOPTS = "" } /^ MSGTYPE/ { w_out(" Set message type to : " get_value(), detailfile) } /^ MAP_COLORING/ { w_out(" Set map coloring to : " get_value(), detailfile) } /^ SERVERLOGONLY/ { w_out(" On server log only (put directly in History Log)", detailfile) } /^ AUTOACTION / || /^ OPACTION / { ACTION = get_value() NODEIND = index (ACTION, "\" ACTIONNODE ") if (NODEIND > 0) { NODE = substr (ACTION, NODEIND + 3) NODE = substr (NODE, index (NODE, "\"") + 1) ACTION = substr (ACTION, 1, NODEIND - 1) ", on node " NODE } sub (/"* ANNOTATE ACK$/, ", always annotate, auto acknowledge", ACTION) sub (/"* ANNOTATE$/, ", always annotate", ACTION) sub (/"* ACK$/, ", auto acknowledge", ACTION) if ($1 == "AUTOACTION") w_out(" Automatic action : " ACTION, detailfile) else w_out(" Operator initiated action : " ACTION, detailfile) } /^ TROUBLETICKET/ { if ($2 == "ACK") w_out(" Create trouble ticket, auto acknowledge", detailfile) else w_out(" Create trouble ticket", detailfile) } /^ NOTIFICATION/ { w_out(" Send notification", detailfile) } /^ SEND_MSG_AFTER_LOC_AA/ { w_out(" Send message with local automatic actions:", detailfile) if (index ($0, "SEND_OK_MSG") > 0) { if (index ($0, "LOGONLY") > 0) w_out(" If the action completes successfully, as log only message", detailfile) else w_out(" If the action completes successfully", detailfile) } if (index ($0, "SEND_FAILED_MSG") > 0) w_out(" If the action fails", detailfile) } /^ THRESHOLD / { TVALUE = $2 sub (/0*$/, "", TVALUE) sub (/\.$/, "", TVALUE) if (NF > 2) TVALUE = TVALUE ", duration: " $4 w_out(" Treshold: " TVALUE, detailfile) } /^ RESET / { RVALUE = $2 sub (/0*$/, "", RVALUE) sub (/\.$/, "", RVALUE) w_out(" Reset: " RVALUE, detailfile) } /^ \$e / { w_out(" Check on enterprise ID : " get_value(), detailfile) } /^ \$G / { if ($2 == 0) { w_out(" Check on generic trap : (0) cold start", detailfile) } if ($2 == 1) { w_out(" Check on generic trap : (1) warm start", detailfile) } if ($2 == 2) { w_out(" Check on generic trap : (2) link down", detailfile) } if ($2 == 3) { w_out(" Check on generic trap : (3) link up", detailfile) } if ($2 == 4) { w_out(" Check on generic trap : (4) authentification", detailfile) } if ($2 == 5) { w_out(" Check on generic trap : (5) EGP neighbor loss", detailfile) } } /^ \$S / { w_out(" Check on specific trap : " get_value(), detailfile) } /^ \$/ { VARNUM = substr ($1, 2) TESTNUM = VARNUM gsub (/[0123456789]/, "", TESTNUM) if ((VARNUM != TESTNUM) && (TESTNUM == "")) w_out(" Variable match : $" VARNUM ": " get_value(), detailfile) } ' ############################################################################### # convert member tags ######################################################### ############################################################################### convert_member_tags () { FILEMASK="$1" SPACES=$2 ls | grep "^${FILEMASK}" | while read C_FILE do awk -v SPACES=${SPACES} ' BEGIN { SPACESTR = substr (" ", 1, SPACES) } /^console / { print SPACESTR "(MPE console messages) " substr ($0, 9) next } /^ecs / { print SPACESTR "(event correlation) " substr ($0, 9) next } /^group / { print SPACESTR "(template group) " substr ($0, 9) next } /^logfile / { print SPACESTR "(logfile encapsulator) " substr ($0, 9) next } /^monitor / { print SPACESTR "(monitor) " substr ($0, 9) next } /^opcmsg / { print SPACESTR "(message interface) " substr ($0, 9) next } /^snmp / { print SPACESTR "(trap interceptor) " substr ($0, 9) next } /^sched. / { print SPACESTR "(scheduled action) " substr ($0, 9) next } { print }' ${C_FILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${C_FILE} done } ############################################################################### # convert member tags in stream ############################################### ############################################################################### conv_member_tags () { awk -v SPACES=${1} -v CLASS="${2:-}" ' BEGIN { SPACESTR = substr (" ", 1, SPACES) } /^console / { print CLASS SPACESTR "(MPE console messages) " substr ($0, 9) next } /^ecs / { print CLASS SPACESTR "(event correlation) " substr ($0, 9) next } /^group / { print CLASS SPACESTR "(template group) " substr ($0, 9) next } /^logfile / { print CLASS SPACESTR "(logfile encapsulator) " substr ($0, 9) next } /^monitor / { print CLASS SPACESTR "(monitor) " substr ($0, 9) next } /^opcmsg / { print CLASS SPACESTR "(message interface) " substr ($0, 9) next } /^snmp / { print CLASS SPACESTR "(trap interceptor) " substr ($0, 9) next } /^sched. / { print CLASS SPACESTR "(scheduled action) " substr ($0, 9) next } { print CLASS $0 }' } ############################################################################### # Report basic configuration files ############################################ ############################################################################### config_files () { scc_check_file ${OV_BIN}/OpC/install/opcsvinfo "${fixclass}:config files:opcsvinfo::" "#" scc_check_file ${OV_CONF}/OpC/mgmt_sv/opcsginfo "${fixclass}:config files:opcsginfo::" "#" scc_check_file ${OV_CONF}/ovdbconf "${fixclass}:config files:ovdbconf::" "#" scc_check_file ${OV_CONF}/OpC/mgmt_sv/oracle_dbf.cfg "${fixclass}:config files:oracle_dbf.cfg::" "#" scc_check_file ${OV_CONF}/OpC/mgmt_sv/oracle_sizing.cfg "${fixclass}:config files:oracle_sizing.cfg::" "nocomment" } ############################################################################### # Create OpC configuration download ########################################### ############################################################################### create_download () { if [[ ${OPCDWN} = 1 ]] then mkdir -p ${OPCDWN_DIR} echo "* ;" > ${OPCDWN_DIR}/download.dsf ${OV_BIN}/OpC/opccfgdwn -force -silent ${OPCDWN_DIR}/download.dsf ${OPCDWN_DIR} 2>&1 | awk ' BEGIN { db_inc_detect = 0 opc50_1 = 0 print_errors = 0 } /^Database inconsistency detected \(opc_snmp_variables\)/ { db_inc_detect++ print_errors = 1 next } /\(OpC50-1\)/ { opc50_1++ print_errors = 1 next } { print } END { if ( print_errors = 1 ) { if ( db_inc_detect > 0 ) print db_inc_detect " times Database inconsistency detected (opc_snmp_variables)." if ( opc50_1 > 0 ) print opc50_1 " times The entries in the two tables belong together. But actually there is only an entry in one table. (OpC50-1)" } }' | sed "s/^/fix:messages:opccfgdwn/" fi } ############################################################################### # Split template groups ####################################################### ############################################################################### split_tgroup () { # split template group file cd ${SPLIT_DIR} awk -v BASE_CLASS="${fixclass}:template groups:" "${AWK_LIB}"' BEGIN { filename = "" detailfile = "" fileprefix = "motg_" } /^TEMPLATE_GROUP / { close (filename) close (detailfile) groupname = get_value() parent = groupname filename = "tgm_" clean(groupname) detailfile = "tgd_" clean(groupname) SCC_CLASS = "" w_out(groupname, detailfile) SCC_CLASS = BASE_CLASS scc_clean(groupname) "::" } /^ DESCRIPTION / { w_out("Description: " get_value(), detailfile) w_out("Members:", detailfile) } '"${AWK_MEMBER_TEMPLATE}" ${TGROUP} # add members to tgd files ls | grep "^tgm_" | while read TGM_FILE do TGD_FILE="$(echo "${TGM_FILE}" | sed 's/^tgm_/tgd_/')" sort ${TGM_FILE} | conv_member_tags 2 "$(awk -F:: 'NR == 2 { print $1 "::" }' ${TGD_FILE})" >> ${TGD_FILE} done } ############################################################################### # Split logfile templates ##################################################### ############################################################################### split_logfile () { cd ${SPLIT_DIR} awk -v BASE_CLASS="${fixclass}:templates:" "${AWK_LIB}"' BEGIN { detailfile = "" alltemplates = "all_templates" }'"${AWK_TEMPL_OPTS}${AWK_COND_OPTS}"' (($1 == "MSGCONDITIONS") || ($1 == "SUPPRESSCONDITIONS") || ($1 == "SUPP_UNM_CONDITIONS") || (/^LOGFILE "/ && detailfile != "")) && (DATA_PRINTED == 0) { DATA_PRINTED = 1 w_out("Description : " T_DESCRIPTION, detailfile) w_out("Template type : logfile encapsulator", detailfile) print_templ_opts() } '"${AWK_NEW_TEMPL}" ${LE_TEMPL} } ############################################################################### # Split message templates ##################################################### ############################################################################### split_message () { cd ${SPLIT_DIR} awk -v BASE_CLASS="${fixclass}:templates:" "${AWK_LIB}"' BEGIN { detailfile = "" alltemplates = "all_templates" }'"${AWK_TEMPL_OPTS}${AWK_COND_OPTS}"' (($1 == "MSGCONDITIONS") || ($1 == "SUPPRESSCONDITIONS") || ($1 == "SUPP_UNM_CONDITIONS") || (/^OPCMSG "/ && detailfile != "")) && (DATA_PRINTED == 0) { DATA_PRINTED = 1 w_outf("Scan mode : ", T_SCANMODE, detailfile) w_out("Description : " T_DESCRIPTION, detailfile) w_out("Template type : message interface (opcmsg)", detailfile) print_templ_opts() } '"${AWK_NEW_TEMPL}" ${MI_TEMPL} } ############################################################################### # Split monitor templates ##################################################### ############################################################################### split_monitor () { cd ${SPLIT_DIR} awk -v BASE_CLASS="${fixclass}:templates:" "${AWK_LIB}"' BEGIN { detailfile = "" alltemplates = "all_templates" }'"${AWK_TEMPL_OPTS}${AWK_COND_OPTS}"' (($1 == "MSGCONDITIONS") || ($1 == "SUPPRESSCONDITIONS") || ($1 == "SUPP_UNM_CONDITIONS") || (/^MONITOR "/ && detailfile != "")) && (DATA_PRINTED == 0) { DATA_PRINTED = 1 w_outf("Description : ", T_DESCRIPTION, detailfile) w_out("Template type : monitor template", detailfile) w_outf("Monitor program : ", T_MONPROG, detailfile) w_outf("MIB object : ", T_MIB, detailfile) w_out(T_TRESTYPE T_MSGGEN, detailfile) print_templ_opts() } '"${AWK_NEW_TEMPL}" ${M_TEMPL} } ############################################################################### # Split trap templates ######################################################## ############################################################################### split_trap () { cd ${SPLIT_DIR} awk -v BASE_CLASS="${fixclass}:templates:" "${AWK_LIB}"' BEGIN { detailfile = "" alltemplates = "all_templates" }'"${AWK_TEMPL_OPTS}${AWK_COND_OPTS}"' (($1 == "MSGCONDITIONS") || ($1 == "SUPPRESSCONDITIONS") || ($1 == "SUPP_UNM_CONDITIONS") || (/^SNMP "/ && detailfile != "")) && (DATA_PRINTED == 0) { DATA_PRINTED = 1 w_outf("Description : ", T_DESCRIPTION, detailfile) w_out("Template type : trap interceptor", detailfile) print_templ_opts() } '"${AWK_NEW_TEMPL}" ${TI_TEMPL} } ############################################################################### # Split console message templates ############################################# ############################################################################### split_console () { cd ${SPLIT_DIR} awk -v BASE_CLASS="${fixclass}:templates:" "${AWK_LIB}"' BEGIN { detailfile = "" alltemplates = "all_templates" }'"${AWK_TEMPL_OPTS}${AWK_COND_OPTS}"' (($1 == "MSGCONDITIONS") || ($1 == "SUPPRESSCONDITIONS") || ($1 == "SUPP_UNM_CONDITIONS")) && (DATA_PRINTED == 0) { DATA_PRINTED = 1 w_outf("Description : ", T_DESCRIPTION, detailfile) w_out("Template type : MPE/iX console messages interceptor", detailfile) print_templ_opts() } '"${AWK_NEW_TEMPL}" ${CM_TEMPL} } ############################################################################### # Split scheduled action templates ############################################ ############################################################################### split_schedule () { cd ${SPLIT_DIR} if [[ -f ${SA_TEMPL} ]] then awk -v BASE_CLASS="${fixclass}:templates:" "${AWK_LIB}"' BEGIN { detailfile = "" alltemplates = "all_templates" }'"${AWK_COND_OPTS}"' /^SCHEDULE "/ { close (detailfile) templname = get_value() detailfile = "td_" clean(templname) SCC_CLASS = BASE_CLASS scc_clean(templname) "::" printf("%-8s%s\n", "sched.", templname) >> alltemplates PRINT_TC=1 } /^ DESCRIPTION "/ { w_outf("Description : ", get_value(), detailfile) w_out("Template type : Scheduled action template", detailfile) } /^ MINUTE/ { if (PRINT_TC == 1) { w_out("Time constraints:", detailfile); PRINT_TC = 0 } w_out(" Minute : " get_value(), detailfile) } /^ HOUR/ { if (PRINT_TC == 1) { w_out("Time constraints:", detailfile); PRINT_TC = 0 } w_out(" Hour : " get_value(), detailfile) } /^ MONTHDAY/ { if (PRINT_TC == 1) { w_out("Time constraints:", detailfile); PRINT_TC = 0 } w_out(" Day of the month : " get_value(), detailfile) } /^ MONTH/ { if (PRINT_TC == 1) { w_out("Time constraints:", detailfile); PRINT_TC = 0 } w_out(" Month : " get_value(), detailfile) } /^ YEAR/ { if (PRINT_TC == 1) { w_out("Time constraints:", detailfile); PRINT_TC = 0 } w_out(" Year : " get_value(), detailfile) } /^ WEEKDAY/ { if (PRINT_TC == 1) { w_out("Time constraints:", detailfile); PRINT_TC = 0 } w_out(" Day of the week : " get_value(), detailfile) } /^ SCHEDPROG/ { w_out("Command to execute : " get_value(), detailfile) } /^ USER/ { w_out("Execute as user : " get_value(), detailfile) } /^ SEND_OUTPUT/ { w_out("Send output of Action to annotations", detailfile) } /^ BEFORE/ { w_out("Send message before start of action", detailfile) } /^ SUCCESS/ { w_out("Send message if action completed successfully", detailfile) } /^ FAILURE/ { w_out("Send message if action failed", detailfile) } ' ${SA_TEMPL} fi } ############################################################################### # Split event correlation templates ########################################### ############################################################################### split_ec () { cd ${SPLIT_DIR} if [[ -f ${EC_TEMPL} ]] then awk -v BASE_CLASS="${fixclass}:templates:" "${AWK_LIB}"' BEGIN { detailfile = "" alltemplates = "all_templates" } /^ECS "/ { close (detailfile) templname = get_value() SCC_CLASS = BASE_CLASS scc_clean(templname) "::" detailfile = "td_" clean(templname) printf("%-8s%s\n", "ecs", templname) >> alltemplates } /^ DESCRIPTION "/ { w_outf("Description : ", get_value(), detailfile) w_out("Template type : Event correlation template", detailfile) } /^ CIRCUIT_FILE "/ { w_out("Circuit file : " get_value(), detailfile) } ' ${EC_TEMPL} fi } ############################################################################### # Split node groups ########################################################### ############################################################################### split_node_group () { cd ${SPLIT_DIR} awk -v BASE_CLASS="${fixclass}:node groups:" "${AWK_LIB}"' BEGIN { filename = "" capture_nodes = 0 fileprefix = "atng_" } /^NODE_GROUP / { close (filename) close (detailfile) groupname = get_value() parent = groupname filename = "ngm_" clean(groupname) detailfile = "ngd_" clean(groupname) SCC_CLASS = "" w_out(groupname, detailfile) SCC_CLASS = BASE_CLASS scc_clean(groupname) "::" } /^ LABEL "/ { w_outf("Label : ", get_value(), detailfile) } /^ DESCRIPTION "/ { w_outf("Description : ", get_value(), detailfile) } /^ SUBENTITIES NODE$/ { capture_nodes = 1 next } /^ \{/ { next } /^ \}/ { capture_nodes = 0 } capture_nodes == 1 { nodename = $NF sub ("^\"", "", nodename) sub ("\"$", "", nodename) w_out("node " nodename, filename) memfile = "nmong_" clean(nodename) print " " parent >> memfile close (memfile) } '"${AWK_MEMBER_TEMPLATE}" ${NGROUP} # Add node members to ngd_ files # Add template and template group assigments to ngd_ files ls | grep "^ngm_" | while read NGM_FILE do NGD_FILE="$(echo "${NGM_FILE}" | sed 's/^ngm_/ngd_/')" CLASS="${fixclass}:node groups:$(awk "${AWK_LIB}"'NR == 1 { print scc_clean($0) }' ${NGD_FILE})::" { # Add node members to ngd_ files if [[ -n "$(grep -l "^node" ${NGM_FILE})" ]] then echo "${CLASS}Nodes in this node group:" sort ${NGM_FILE} | awk -v CLASS="${CLASS}" '/^node/ { print CLASS " " substr ($0, 9) }' fi # Add template and template group assigments to ngd_ files if [[ -n "$(grep -v -l "^node" ${NGM_FILE})" ]] then echo "${CLASS}Templates and template groups assigned to this node group:" sort ${NGM_FILE} | grep -v "^node" | conv_member_tags 2 "${CLASS}" fi } >> ${NGD_FILE} done } ############################################################################### # Split nodes ################################################################# ############################################################################### split_nodes () { cd ${SPLIT_DIR} awk -v BASE_CLASS="${fixclass}:nodes:" "${AWK_LIB}"' BEGIN { filename = "" NSTARTED = 0 NTYPESTR[0] = "not in realm" NTYPESTR[1] = "unmanaged" NTYPESTR[2] = "controlled" NTYPESTR[3] = "monitored" NTYPESTR[4] = "message allowed" CTYPESTR[0] = "Unspecified" CTYPESTR[1] = "NCS" CTYPESTR[2] = "DCE TCP" CTYPESTR[3] = "DCE UDP" CTYPESTR[4] = "Sun RPC TCP" CTYPESTR[5] = "Sun RPC UDP" CTYPESTR[6] = "TCP Socket" CTYPESTR[7] = "UDP Socket" CTYPESTR[8] = "OPC Interface" CTYPESTR[9] = "RPC Local" fileprefix = "atn_" } /^ NODE / { close (filename) close (detailfile) fieldnum = NF - 1 filename = $fieldnum sub ("^\"", "", filename) sub ("\"$", "", filename) parent = filename detailfile = "nd_" clean(filename) SCC_CLASS = "" w_out(filename, detailfile) SCC_CLASS = BASE_CLASS scc_clean(filename) "::" filename = "nm_" clean(filename) if ($3 == "IP") IPADDR = $4 else IPADDR = "" NSTARTED = 1 COMMTYPE = "" } $1 == "LABEL" && NSTARTED == 1 { NLABEL = get_value() } /^ MACHINE_TYPE / { MTYPE = $NF } /^ NODE_TYPE / { NTYPE = $NF if ( NTYPE <= 4 ) NTYPE = NTYPESTR[NTYPE] else NTYPE = "unknown" } /^ COMM_TYPE / { CTYPE = $NF if ( CTYPE <= 9 ) CTYPE = CTYPESTR[CTYPE] else CTYPE = "unknown" } /^ HEARTBEAT_FLAG / { HBFLAG = $NF } /^ HEARTBEAT_TYPE / { THBTYPE = $NF % 4 if (THBTYPE == 0) { HBTYPE = "none" } else if (THBTYPE == 1) { HBTYPE = "RPC" } else if (THBTYPE == 2) { HBTYPE = "Ping" } else if (THBTYPE == 3) { HBTYPE = "normal" } THBTYPE = $NF if (THBTYPE > 3) { HBTYPE = HBTYPE ", send from agent" } } /^ HEARTBEAT_INTERVAL / { HBIVAL = $NF gsub (/"/, "", HBIVAL) } /^ } ;$/ || /^ ;$/ { if (NSTARTED == 1) { if (IPADDR == "") { w_outf("Label : ", NLABEL, detailfile) } else { w_out("Label : " NLABEL ", IP address: " IPADDR, detailfile) } w_out("Machine type : " MTYPE ", " NTYPE, detailfile) if (NTYPE == "controlled" || NTYPE == "monitored") { if (HBFLAG = "TRUE") { w_out("Heartbeat type : " HBTYPE ", interval = " HBIVAL, detailfile) } else { w_out("No heartbeat", detailfile) } if (CTYPE != "") { w_out("Communication type : " CTYPE, detailfile) } } } NSTARTED = 0 } '"${AWK_MEMBER_TEMPLATE}" ${NODES} # Add template and template group assigments to nd_ files ls | grep "^nm_" | while read NM_FILE do # Add template and template group assigments to nd_ files ND_FILE="$(echo "${NM_FILE}" | sed 's/^nm_/nd_/')" CLASS="$(awk -F:: 'NR == 2 { print $1 }' ${ND_FILE})::" if [[ -s ${NM_FILE} ]] then echo "${CLASS}Templates and template groups assigned to this node:" conv_member_tags 2 "${CLASS}" < ${NM_FILE} fi >> ${ND_FILE} done } ############################################################################### # Split node hierarchies ###################################################### ############################################################################### split_hierarchy () { cd ${SPLIT_DIR} if [[ -f ${NODEHIER} ]] then awk -v BASE_CLASS="${fixclass}:node hierarchies:" "${AWK_LIB}"' BEGIN { filename = "" } /^NODE_HIERARCHY/ { NH_NAME = get_value() close (filename) detailfile = "nhd_" clean(NH_NAME) filename = "nh_" clean(NH_NAME) SCC_CLASS = BASE_CLASS scc_clean(NH_NAME) "::" } /^ SYMBOL/ { SYMBOL = get_value() } /^ LABEL/ { LABEL = get_value() if (LABEL != NH_NAME) w_outf("Label : ", LABEL, detailfile) } /^ DESCRIPTION/ { w_outf("Description : ", get_value(), detailfile) w_outf("Symbol : ", SYMBOL, detailfile) } /^ LAYOUT_GROUP/ { THING = "group:" OBJECT = get_value() } /^ NODE/ { THING = "node :" if (substr ($0, 9) == "_OPC_MGMTSV_") OBJECT = "_OPC_MGMTSV_" else OBJECT = get_qvalue() } /^ LAYOUT_ID/ || /^ PARENT_/ { THING = THING get_value() ":" } /^ LABEL/ { LABEL = get_value() THING = THING OBJECT if (LABEL != OBJECT && LABEL != "") THING = THING ", label: " LABEL w_out(THING, filename) } ' ${NODEHIER} fi } ############################################################################### # Split users (operators, template administrators and profiles) ############### ############################################################################### split_users () { cd ${SPLIT_DIR} awk -v BASE_CLASS="${fixclass}:" "${AWK_LIB}"' BEGIN { detailfile = "" } /^OPERATOR "/ { LOGINNAME = get_value() } /^ REALNAME "/ { REALNAME = get_value() } /^ DESCRIPTION "/ { DESCRIPTION = get_value() } /^ USER_ROLE/ { fileprefix = "u_uk_" ; atprefix = "uk_" ; SUBCLASS = "unknown type of user:" } /^ USER_ROLE 0/ { fileprefix = "u_op_" ; atprefix = "op_" ; SUBCLASS = "operators:" } /^ USER_ROLE 3/ { fileprefix = "u_ta_" ; atprefix = "ta_" ; SUBCLASS = "template administrators:" } /^ USER_ROLE 4/ { fileprefix = "u_pr_" ; atprefix = "pr_" ; SUBCLASS = "user profiles:" } /^ LABEL "/ { close (detailfile) detailfile = fileprefix clean(LOGINNAME) SCC_CLASS = BASE_CLASS SUBCLASS scc_clean(LOGINNAME) "::" # w_out(LOGINNAME, detailfile) w_outf("Label : ", get_value(), detailfile) w_outf("Real name : ", REALNAME, detailfile) w_outf("Description : ", DESCRIPTION, detailfile) } /^ NODE_HIERARCHY "/ { w_outf("Node hierarchy : ", get_value(), detailfile) } /^ OP_INIT_ACT_FLAG TRUE/ && fileprefix == "u_op_" { w_out("Allowed actions:", detailfile) w_out(" Perform/stop actions : allowed", detailfile) } /^ OP_INIT_ACT_FLAG FALSE/ && fileprefix == "u_op_" { w_out("Allowed actions:", detailfile) w_out(" Perform/stop actions : not allowed", detailfile) } /^ ACKNOWLEDGE_FLAG TRUE/ && fileprefix == "u_op_" { w_out(" (Un-)acknowledge messages : allowed", detailfile) } /^ ACKNOWLEDGE_FLAG FALSE/ && fileprefix == "u_op_" { w_out(" (Un-)acknowledge messages : not allowed", detailfile) } /^ CHANGE_MSG_ATTR TRUE/ && fileprefix == "u_op_" { w_out(" Modify message attributes : allowed", detailfile) } /^ CHANGE_MSG_ATTR FALSE/ && fileprefix == "u_op_" { w_out(" Modify message attributes : not allowed", detailfile) } /^ OWN_FLAG TRUE/ && fileprefix == "u_op_" { w_out(" Own/disown messages : allowed", detailfile) } /^ OWN_FLAG FALSE/ && fileprefix == "u_op_" { w_out(" Own/disown messages : not allowed", detailfile) } /^ RESPONSIBILITY/ { PRINT_RESPONS = "true" } /^ NODE_GROUP/ { tstring = $0 gsub (/"/, "", tstring) w_out(tstring, detailfile) } /^ MESSAGE_GROUP/ { tstring = $0 gsub (/"/, "", tstring) w_out(tstring, detailfile) } /^ DESKTOP/ { PRINT_DESKTOP = "true" } /^ APPLICATION_REF "/ { if ( PRINT_DESKTOP == "true" ) { w_out("Assigned applications and application groups:", detailfile) PRINT_DESKTOP = "false" } gv = get_value() w_out(" (application) " gv, detailfile) gv = "aat" atprefix clean(gv) print " " LOGINNAME >> gv close(gv) } /^ APPLICATION_GROUP_REF "/ { if ( PRINT_DESKTOP == "true" ) { w_out("Assigned applications and application groups:", detailfile) PRINT_DESKTOP = "false" } gv = get_value() w_out(" (application group) " gv, detailfile) gv = "agat" atprefix clean(gv) print " " LOGINNAME >> gv close(gv) } /^ PROFILES/ { PRINT_PROFILE = "true" } /^ PROFILE "/ { if ( PRINT_PROFILE == "true" ) { w_out("Assigned profiles:", detailfile) PRINT_PROFILE = "false" } w_out(" " get_value(), detailfile) } ' ${OPERS} } ############################################################################### # Split applications ########################################################## ############################################################################### split_applications () { cd ${SPLIT_DIR} awk "${AWK_LIB}"' BEGIN { appfile = "" grpfile = "" grpmfile = "" targetstr[0] = "Start on : target node list" targetstr[1] = "Start on : target node(s) selected by operator" targetstr[2] = "Start on : management server" targetstr[3] = "Start on : local client" targetstr[4] = "Start URL on : local web browser" iappstr[0] = "virtual terminal" iappstr[1] = "physical terminal" iappstr[2] = "broadcast" iappstr[3] = "virtual terminal (PC)" intermstr[0] = "no window (eg X application)" intermstr[1] = "window (input/output)" intermstr[2] = "window (output only)" } /^ APPLICATION / { close (appfile) appname = get_value() appfile = "ad_" clean(appname) w_out(appname, appfile) w_out(" (application) " appname, grpmfile) if (length (grpname) > 0) { gv = "amoag_" clean(appname) print " " grpname >> gv close (gv) } T_SYMBOL = "" T_TARGET = "" T_APPL_CALL = "" T_IAPP = "" D_IN_TERM = 0 T_REG_NAME = "" cap_nodes = 0 nrnodes = 0 T_UNAME["MPE"] = "" T_UNAME["MS"] = "" T_UNAME["NetWare"] = "" T_UNAME["UNIX"] = "" } /^ SYMBOL / { T_SYMBOL = get_value() } /^ TARGET / { gv = get_value() T_TARGET = targetstr[gv] if (gv < 3) D_IN_TERM = 1 } /^ LABEL / { w_outf("Label : ", get_value(), appfile) } /^ DESCRIPTION / { w_outf("Description : ", get_value(), appfile) } /^ APPL_CALL / { T_APPL_CALL = get_value() } /^ INTERN_APPL_ACTION / && T_APPL_CALL == "" { T_IAPP = iappstr[$2] if ($3 == "ALLOW_CUSTOMIZE") { if ($4 == "TRUE") T_IAPP = T_IAPP ", allow customize: true" else T_IAPP = T_IAPP ", allow customize: false" } } /^ PARAMETERS / { w_outf("Application call : ", T_APPL_CALL, appfile) w_outf("Parameters : ", get_value(), appfile) } /^ NODE$/ && length (T_IAPP) == 0 { cap_nodes = 1 } /^ OTHER / && cap_nodes == 1 { nrnodes++ ; T_NODE[nrnodes] = get_value() } /^ IP / && cap_nodes == 1 { nrnodes++ ; T_NODE[nrnodes] = get_qvalue() } /^ }$/ { cap_nodes = 0 } /^ PLTFRM_FAMILY_NAME / { pltfrm = get_value() getline T_UNAME[pltfrm] = get_value() } /^ APPLICATION_TYPE / { gv = get_value() if (gv == "CSM_PLATFORM_INTERNAL") { w_out("Application type : " T_IAPP, appfile) if (length (T_UNAME["MPE"]) + length (T_UNAME["MS"]) + length (T_UNAME["NetWare"]) + length (T_UNAME["UNIX"]) > 0) { w_out("Username per platform:", appfile) w_outf(" MPE: ", T_UNAME["MPE"], appfile) w_outf(" MS: ", T_UNAME["MS"], appfile) w_outf(" NetWare: ", T_UNAME["NetWare"], appfile) w_outf(" UNIX: ", T_UNAME["UNIX"], appfile) } } else if (gv == "CSM_PLATFORM_INTEGRATED") { w_out("Application type : ITO application", appfile) w_outf("Symbol : ", T_SYMBOL, appfile) w_outf("", T_TARGET, appfile) i = 1 while (i <= nrnodes) { w_outf(" ", T_NODE[i], appfile) i++ } } } /^ START_IN_TERM_FLAG / && D_IN_TERM == 1 { w_out("Presentation : " intermstr[get_value()], appfile) } /^ USER_NAME / { w_outf("User name : ", get_value(), appfile) } /^ REGISTERED_NAME / { T_REG_NAME = get_value() } /^ ACTION_IDENTIFIER/ { gv = get_value() if (length (gv) == 0) { w_out("Application type : OV service", appfile) w_out("NNM Application name : " T_REG_NAME, appfile) } else { w_out("Application type : OV application", appfile) w_out("NNM Application name : " T_REG_NAME, appfile) w_out("NNM Action identifier : " gv, appfile) w_outf("", T_TARGET, appfile) i = 1 while (i <= nrnodes) { w_outf(" ", T_NODE[i], appfile) i++ } } } /^ APPLICATION_GROUP / || /^ MEMBER_APPLICATION_GROUP / { close (grpfile) close (grpmfile) if ($2 == "PSEUDO_GROUP") { grpfile = "rm_pseudo_group" grpmfile = "rm_pseudo_group_members" } else { grpname = get_value() grpfile = "agd_" clean(grpname) grpmfile = "agm_" clean(grpname) w_out(grpname, grpfile) } } /^ LABEL / { w_outf("Label : ", get_value(), grpfile) } /^ DESCRIPTION / { w_outf("Description : ", get_value(), grpfile) } /^ SYMBOL / { w_outf("Symbol : ", get_value(), grpfile) w_out("Members: ", grpfile) } /^ MEMBER_APPLICATION_GROUP / { gv = get_value() w_out(" (group) " gv, grpmfile) if (length(grpname) > 0) { gv = "agmoag_" clean(gv) print " " grpname >> gv close (gv) } } /^ APPLICATION_REF / { gv = get_value() w_out(" (application) " gv, grpmfile) if (length (grpname) > 0) { gv = "amoag_" clean(gv) print " " grpname >> gv close (gv) } } ' ${APPS} # add members to agd files ls | grep "^agm_" | while read AGM_FILE do sort ${AGM_FILE} >> "$(echo "${AGM_FILE}" | sed 's/^agm_/agd_/')" done } ############################################################################### # Split instruction text interfaces ########################################### ############################################################################### split_instruction () { cd ${SPLIT_DIR} awk "${AWK_LIB}"' BEGIN { filename = "" intermstr[2] = "no window (eg X application)" intermstr[0] = "window (output only)" } /^INSTRUCTION_INTERFACE / { close (filename) interface = get_value() filename = "ii_" clean(interface) w_out(interface, filename) T_NODE = "" } /^ DESCRIPTION / { w_outf("Description : ", get_value(), filename) } /^ INSTR_INTERF_CALL / { w_outf("Interface call : ", get_value(), filename) } /^ NODE / { T_NODE = $NF ; sub("^\"", "", T_NODE) ; sub ("\"$", "", T_NODE) } /^ START_ON_MGMT_SV 1/ { w_out("Start on : management server", filename) } /^ START_ON_MGMT_SV 0/ { w_out("Start on : " T_NODE, filename) } /^ USER_NAME / { w_out("Execute as user : " get_value(), filename) } /^ OUTPUT_MODE / { w_out("Presentation : " intermstr[get_value()], filename) } /^ RESOLVE_FOR_TTNS 0/ { w_out("Instruction text : ignore for trouble tickets", filename) } /^ RESOLVE_FOR_TTNS 1/ { w_out("Instruction text : resolve for trouble tickets", filename) } ' ${INSTR_INTERF} } ############################################################################### # Remove template group nesting ############################################### ############################################################################### remove_template_group_nesting () { cd ${SPLIT_DIR} # Set all template group names in member files to filenames ls | grep -e "^tgm_" -e "^ngm_" -e "^nm_" | while read MEMBER_FILE do awk "${AWK_LIB}"' /^group / { print "group tgm_" clean(substr ($0, 9)) next } { print } ' ${MEMBER_FILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${MEMBER_FILE} done # Search for empty template groups ls | grep "^tgd_" | while read TGD_FILE do touch "$(echo "${TGD_FILE}" | sed 's/^tgd/tgm/')" done # Remove nesting while [[ $(ls | grep "^tgm_" | wc -l) -gt 0 ]] do ls | grep "^tgm_" | while read TGM_FILE do if [[ $(grep -c '^group ' ${TGM_FILE}) -eq 0 ]] then # Get detail and done file name and template group name TGD_FILE=$(echo ${TGM_FILE} | sed 's/^tgm_/tgd_/') DONE_FILE=$(echo ${TGM_FILE} | sed 's/^tgm_/done_/') TG_NAME="$(head -1 ${TGD_FILE})" # Place template group name behind member templates awk -v TG_NAME="${TG_NAME}" '{ print $0 " in \"" TG_NAME "\"" }' ${TGM_FILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${TGM_FILE} # Scan all other member files for the current template group ls | grep -e "^tgm_" | xargs grep -l "^group ${TGM_FILE}\$" | while read MEMBER_FILE ; do sed " /^group ${TGM_FILE}\$/ { r ${TGM_FILE} d } " ${MEMBER_FILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${MEMBER_FILE} done # Rename template group members file mv ${TGM_FILE} ${DONE_FILE} fi done done # Rename template group members file ls | grep "^done_" | while read DONE_FILE do TGM_FILE=$(echo ${DONE_FILE} | sed 's/^done_/tgm_/') TGD_FILE=$(echo ${TGM_FILE} | sed 's/^tgm_/tgd_/') TG_NAME="$(head -1 ${TGD_FILE})" mv ${DONE_FILE} ${TGM_FILE} ls | grep -e "^ngm_" -e "^nm_" | xargs grep -l "^group ${TGM_FILE}\$" | while read MEMBER_FILE ; do sed " /^group ${TGM_FILE}\$/ { r ${TGM_FILE} d } " ${MEMBER_FILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${MEMBER_FILE} done done # Sort member files ls | grep -e "^nm_" | while read MEMBER_FILE do sort ${MEMBER_FILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${MEMBER_FILE} done } ############################################################################### # Remove application group nesting ############################################ ############################################################################### remove_application_group_nesting () { cd ${SPLIT_DIR} # Set all application group names in member files to filenames ls | grep -e "^agm_" | while read MEMBER_FILE do awk "${AWK_LIB}"' /^ \(group\) / { print " (group) agm_" clean(substr ($0, 17)) next } { print } ' ${MEMBER_FILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${MEMBER_FILE} done # Search for empty template groups ls | grep "^agd_" | while read AGD_FILE do touch "$(echo "${AGD_FILE}" | sed 's/^agd/agm/')" done # Remove nesting while [[ $(ls | grep "^agm_" | wc -l) -gt 0 ]] do ls | grep "^agm_" | while read AGM_FILE do if [[ -z "$(grep -l '^ (group)' ${AGM_FILE})" ]] then # Get detail and done file name and template group name AGD_FILE=$(echo ${AGM_FILE} | sed 's/^agm_/agd_/') DONE_FILE=$(echo ${AGM_FILE} | sed 's/^agm_/done_/') AG_NAME="$(head -1 ${AGD_FILE})" # Place template group name behind member templates awk -v AG_NAME="${AG_NAME}" '{ print $0 " by application group " AG_NAME }' ${AGM_FILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${AGM_FILE} # Scan all other member files for the current template group ls | grep -e "^agm_" | xargs grep -l "^ (group) ${AGM_FILE}\$" | while read MEMBER_FILE ; do sed " /^ (group) ${AGM_FILE}\$/ { r ${AGM_FILE} d } " ${MEMBER_FILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${MEMBER_FILE} done # Rename template group members file mv ${AGM_FILE} ${DONE_FILE} fi done done # Rename template group members file ls | grep "^done_" | while read DONE_FILE do AGM_FILE=$(echo ${DONE_FILE} | sed 's/^done_/agm_/') mv ${DONE_FILE} ${AGM_FILE} done } ############################################################################### # Add node group member to node group detail and node detail files ############ ############################################################################### add_ngm_to_nm () { cd ${SPLIT_DIR} # Add ngm files to ngd and nd files ls | grep "^ngm_" | while read NGM_FILE do if [[ -n "$(grep -l -v "^node " ${NGM_FILE})" ]] ; then NGD_FILE=$(echo ${NGM_FILE} | sed 's/^ngm_/ngd_/') NG_NAME="$(head -1 ${NGD_FILE})" awk "${AWK_LIB}"'/^node/ { print "nm_" clean($NF) }' ${NGM_FILE} | \ while read NM_FILE do { echo " Active templates by node group ${NG_NAME}:" grep -v "^node " ${NGM_FILE} } >> ${NM_FILE} done fi done } ############################################################################### # Create taon from nm ######################################################### ############################################################################### create_taon_from_nm () { cd ${SPLIT_DIR} ls | grep "^nm_" | while read NM_FILE do ND_FILE="$(echo "${NM_FILE}" | sed 's/nm_/nd_/')" N_NAME="$(head -1 ${ND_FILE})" awk -v N_NAME="${N_NAME}" "${AWK_LIB}"' /^console/ || /^ecs/ || /^logfile/ || /^monitor/ || /^opcmsg/ || /^snmp/ || /^sched/ { TEMPLATE = substr ($0, 9) I_TGROUP = index (TEMPLATE, " in") if (I_TGROUP > 0) TEMPLATE = substr (TEMPLATE, 1, I_TGROUP - 1) print "taon_" clean(TEMPLATE) " " N_NAME } ' ${NM_FILE} done | sort -u | awk ' BEGIN { filename = "" } filename != $1 { if (filename != "") close (filename) filename = $1 } { print " " substr ($0, length ($1) + 2) > filename } ' } ############################################################################### # Replace machine type number with description ################################ ############################################################################### repl_mtype () { cd ${SPLIT_DIR} export ORACLE_SID="$(awk '/^ORACLE_SID / { print $2 }' /etc/opt/OV/share/conf/ovdbconf)" export ORACLE_HOME="$(awk '/^ORACLE_HOME / { print $2 }' /etc/opt/OV/share/conf/ovdbconf)" export ORACLE_USER="$(awk '/^DBA_USER / { print $2 }' /etc/opt/OV/share/conf/ovdbconf)" scc_oracle_query "select machine_type, machine_type_str from opc_op.opc_net_machine;" | \ sed '1,/^---/d' | while read MNR MTYPE ; do ls | grep "^nd_*" | xargs grep -l "Machine type : ${MNR}," | while read SFILE ; do sed "s/Machine type : ${MNR},/Machine type : $(echo "${MTYPE}" | sed 's/\//\\\//g');/" ${SFILE} > ${TMP1_FILE} mv -f ${TMP1_FILE} ${SFILE} done done } ############################################################################### # Build responsibility matrix ################################################# ############################################################################### resp_matrix () { cd ${SPLIT_DIR} ls | grep -e "^u_op_" -e "^u_pr_" | while read UFILE do { awk -F:: ' substr($2, 1, 12) == " NODE_GROUP" { print "a " substr ($2, 14) } substr($2, 1, 16) == " MESSAGE_GROUP" { print "b " substr ($2, 18) }' ${UFILE} | sort -u awk -F:: 'substr($2, 1, 12) == " NODE_GROUP" || substr($2, 1, 16) == " MESSAGE_GROUP" { print $2 }' ${UFILE} } | awk ' BEGIN { NGNr = 0 MGNr = 0 NGlength = 0 MGlength = 0 } /^a/ { NGNr++ NG2Nr[substr ($0, 3)] = NGNr NGStr[NGNr] = substr ($0, 3) if (length ($0) > NGlength) NGlength = length ($0) next } /^b/ { MGNr++ Nr2MG[MGNr] = substr ($0, 3) MGStr[substr ($0, 3)] = sprintf("%" NGNr "s", " ") gsub (" ", "N", MGStr[substr ($0, 3)]) if (length ($0) > MGlength) MGlength = length ($0) next } /^ NODE_GROUP/ { GNr = NG2Nr[substr ($0, 14)] } /^ MESSAGE_GROUP/ { t = MGStr[substr ($0, 18)] t = substr (t, 1, GNr - 1) "Y" substr (t, GNr + 1) MGStr[substr ($0, 18)] = t } END { if (NGNr == 0) exit NGlength -= 2; MGlength -= 2; for (i = 1; i <= NGNr; i++) { x = sprintf("%" NGlength "s", NGStr[i]); NGStr[i] = x; } for (j = 1; j <= NGlength; j++) { printf ("%" MGlength "s", " ") for (i = 1; i <= NGNr; i++) printf (" | " substr(NGStr[i], j, 1)) printf ("\n") } printf ("%s", substr ("---------------------------------------------------------------", 1, MGlength)) for (i = 1; i <= NGNr; i++) printf ("-+--") printf ("\n") for (i = 1; i <= MGNr; i++) { MGroup = Nr2MG[i] printf ("%" MGlength "s", MGroup) for (j = 1; j <= NGNr; j++) if (substr (MGStr[MGroup], j, 1) == "Y") printf (" | Y") else printf (" | ") printf ("\n") } }' > ${TMP1_FILE} if [[ $(wc -l < ${TMP1_FILE}) -gt 1 ]] ; then { class="$(awk -F:: 'NR == 1 { print $1 }' ${UFILE} | sed 's/^fix/var/')" grep -v -e ":: NODE_GROUP" -e ":: MESSAGE_GROUP" ${UFILE} echo "${class}::Responsibility matrix:" awk -v CLASS="${class}:: " '{ print CLASS $0 }' ${TMP1_FILE} class="$(awk -F:: 'NR == 1 { print $1 }' ${UFILE})" echo "${class}::Responsibility overview (node group / message group):" awk -F:: -v CLASS="${class}:: " ' substr($2, 1, 12) == " NODE_GROUP" { printf (CLASS substr ($2, 14) " / ") } substr($2, 1, 16) == " MESSAGE_GROUP" { print substr ($2, 18) }' ${UFILE} | sort } > ${TMP2_FILE} mv -f ${TMP2_FILE} ${UFILE} fi done } ############################################################################### # Report data file set ######################################################## ############################################################################### report_data_file () { [[ -f "${1}${DFILE}" ]] && { echo "${2}::${3}" awk -v CLASS="${2}" '{ print CLASS "::" $0 }' "${1}${DFILE}" } } ############################################################################### # Report template data ######################################################## ############################################################################### report_template () { cd ${SPLIT_DIR} ls | grep -e "^td_" | cut -d_ -f2- | while read DFILE do t_fixclass="$(awk -F:: 'NR == 1 { print $1 }' "td_${DFILE}")" t_varclass="$(echo "${t_fixclass}" | sed 's/fix/var/')" cat "td_${DFILE}" report_data_file tmotg_ "${t_fixclass}" "Template is member of template groups:" report_data_file tatn_ "${t_fixclass}" "Template is assigned to nodes:" report_data_file tatng_ "${t_fixclass}" "Template is assigned to nodes groups:" report_data_file taon_ "${t_varclass}" "Template is active on nodes:" done } ############################################################################### # Report template group data ################################################## ############################################################################### report_tgroup () { cd ${SPLIT_DIR} ls | grep -e "^tgd_" | cut -d_ -f2- | while read DFILE do tg_fixclass="$(awk -F:: 'NR == 2 { print $1 }' "tgd_${DFILE}")" tg_varclass="$(echo "${tg_fixclass}" | sed 's/fix/var/')" awk 'NR > 1 { print }' "tgd_${DFILE}" report_data_file tgmotg_ "${tg_fixclass}" "Template group is member of template groups:" report_data_file tgatn_ "${tg_fixclass}" "Template group is assigned to nodes:" report_data_file tgatng_ "${tg_fixclass}" "Template group is assigned to nodes groups:" [[ -f "tgm_${DFILE}" ]] && { echo "${tg_varclass}::Active templates by this template group:" conv_member_tags 2 "${tg_varclass}::" < "tgm_${DFILE}" } done } ############################################################################### ############################################################################### report_tusage () { { echo "${fixclass}:template usage::Used templates:" ls | grep "^nm_" | xargs sed 's/ in \".*//' | sort | awk -v CLASS="${fixclass}:template usage:: " ' BEGIN { tname = "" } { if (tname == $0) tcount += 1 else { if (tname != "") print CLASS tname " (" tcount ")" tname = $0 tcount = 1 } } END { if (tname != "") print CLASS tname " (" tcount ")" }' echo "${fixclass}:template usage::" echo "${fixclass}:template usage::Unused templates:" ls | grep -e "^nm_" -e "^all_templates" | xargs sed 's/ in \".*//' | sort | awk -v CLASS="${fixclass}:template usage:: " ' BEGIN { tname = "" } { if (tname == $0) tcount += 1 else { if (tname != "" && tcount == 1) print CLASS tname tname = $0 tcount = 1 } } END { if (tname != "" && tcount = 1) print CLASS tname }' } | sed -e 's/:: console /:: (MPE console messages) /' \ -e 's/:: ecs /:: (event correlation) /' \ -e 's/:: logfile /:: (logfile encapsulator) /' \ -e 's/:: monitor /:: (monitor) /' \ -e 's/:: opcmsg /:: (message interface) /' \ -e 's/:: snmp /:: (trap interceptor) /' \ -e 's/:: sched. /:: (scheduled action) /' } ############################################################################### # Report message groups ####################################################### ############################################################################### report_msggrps () { awk ' /^MESSAGE_GROUP/ || /^ SYMBOL/ || /^ DESCRIPTION/ { printf ("%s:::", substr ($0, index ($0, "\""))) } /^ LABEL/ { printf ("%s\n", substr ($0, index ($0, "\""))) } ' ${MSGGRPS} | sort | awk -v class="${fixclass}:message groups::" -F ::: ' { gsub ("\"", "") IF (NR > 1) print class print class "Message group : " $1 if ($4 != "") print class " Label : " $4 if ($2 != "") print class " Symbol : " $2 if ($3 != "") print class " Description : " $3 }' } ############################################################################### # Report node data ############################################################ ############################################################################### report_nodes () { cd ${SPLIT_DIR} ls | grep -e "^nd_" | cut -d_ -f2- | while read DFILE do n_fixclass="$(awk -F:: 'NR == 2 { print $1 }' "nd_${DFILE}")" n_varclass="$(echo "${n_fixclass}" | sed 's/fix/var/')" awk 'NR > 1 { print }' "nd_${DFILE}" echo "${n_fixclass}::Node is member of node groups:" if [[ -f "nmong_${DFILE}" ]] then sort "nmong_${DFILE}" | awk -v CLASS="${n_fixclass}" '{ print CLASS "::" $0 }' else NNAME="$(awk 'NR == 1 { print }' "nd_${DFILE}")" echo "${msgclass}:nodes: Node ${NNAME} does not belong to any node group, messages will not be displayed in any message browser" fi [[ -f "nm_${DFILE}" ]] && { echo "${n_varclass}::Active templates on this node:" conv_member_tags 4 "${n_varclass}::" < "nm_${DFILE}" } done } ############################################################################### # Report node group data ###################################################### ############################################################################### report_ngroups () { cd ${SPLIT_DIR} ls | grep -e "^ngd_" | cut -d_ -f2- | while read DFILE do ng_varclass="${varclass}:node groups:$(awk "${AWK_LIB}"'NR == 1 { print scc_clean($0) }' "ngd_${DFILE}")::" awk 'NR > 1 { print }' "ngd_${DFILE}" [[ -f ngm_${DFILE} && -n "$(grep -l -v "^node " ngm_${DFILE})" ]] && { echo "${ng_varclass}Active templates via this node group:" grep -v "^node" ngm_${DFILE} | conv_member_tags 2 "${ng_varclass}" } done } ############################################################################### # Get node hierarchy group contents ########################################### ############################################################################### get_nh_group () { awk -v PARENT=$2 -F: '$1 == "group" && $3 == PARENT { print }' $1 | while read GROUPLINE do printf "%$(expr $3 \* 2)sLayout group: %s\n" " " "$(echo "${GROUPLINE}" | cut -d: -f4-)" get_nh_group $1 "$(echo "${GROUPLINE}" | cut -d: -f2)" $(expr $3 + 1) done awk -v PARENT=$2 -F: '$1 == "node " && $3 == PARENT { print }' $1 | while read GROUPLINE do printf "%$(expr $3 \* 2)sNode: %s\n" " " "$(echo "${GROUPLINE}" | cut -d: -f4-)" done } ############################################################################### # Report node hierarchy data ################################################## ############################################################################### report_nhiers () { cd ${SPLIT_DIR} ls | grep "^nh_" | cut -d_ -f2- | while read DFILE do t_fixclass="$(awk -F:: 'NR == 1 { print $1 }' nhd_${DFILE})::" cat nhd_${DFILE} echo "${t_fixclass}Node hierarchy contents:" get_nh_group nh_${DFILE} "000000000000000000000000000000000000" 1 | awk -v CLASS="${t_fixclass}" '{ print CLASS $0 }' done } ############################################################################### # Report distribution data #################################################### ############################################################################### report_ndist () { BLANK=0 export ORACLE_SID="$(awk '/^ORACLE_SID / { print $2 }' /etc/opt/OV/share/conf/ovdbconf)" export ORACLE_HOME="$(awk '/^ORACLE_HOME / { print $2 }' /etc/opt/OV/share/conf/ovdbconf)" export ORACLE_USER="$(awk '/^DBA_USER / { print $2 }' /etc/opt/OV/share/conf/ovdbconf)" scc_oracle_query "select n.node_name from opc_nodes o, opc_node_names n where o.node_id = n.node_id and o.sw_dist_req_flag != 0 order by n.node_name;" > ${TMP1_FILE} if [[ $(wc -l < ${TMP1_FILE}) -gt 2 ]] then BLANK=1 echo "${fixclass}:node software and configuration::nodes needing agent upgrade:" sed -e "1,2d" -e "s/^/${fixclass}:node software and configuration:: /" ${TMP1_FILE} fi scc_oracle_query "select n.node_name from opc_node_config c, opc_node_names n where c.node_id = n.node_id and c.status_flag != 0 group by n.node_name order by n.node_name;" > ${TMP1_FILE} if [[ $(wc -l < ${TMP1_FILE}) -gt 2 ]] then [[ ${BLANK} = 1 ]] && echo "${fixclass}:node software and configuration::" echo "${fixclass}:node software and configuration::nodes needing configuration distribution:" sed -e "1,2d" -e "s/^/${fixclass}:node software and configuration:: /" ${TMP1_FILE} fi } ############################################################################### # Report application data ##################################################### ############################################################################### report_apps () { cd ${SPLIT_DIR} ls | grep -e "^ad_" | cut -d_ -f2- | while read DFILE do t_fixclass="${fixclass}:applications:$(awk "${AWK_LIB}"'NR == 1 { print scc_clean($0) }' "ad_${DFILE}")" awk -v CLASS="${t_fixclass}::" 'NR > 1 { print CLASS $0 }' "ad_${DFILE}" report_data_file amoag_ "${t_fixclass}" "Application is member of application groups:" report_data_file aatop_ "${t_fixclass}" "Application is assigned to operator:" report_data_file aatpr_ "${t_fixclass}" "Application is assigned to user profile:" done } ############################################################################### # Report application group data ############################################### ############################################################################### report_agroups () { cd ${SPLIT_DIR} ls | grep -e "^agd_" | cut -d_ -f2- | while read DFILE do t_fixclass="${fixclass}:application groups:$(awk "${AWK_LIB}"'NR == 1 { print scc_clean($0) }' "agd_${DFILE}")" awk -v CLASS="${t_fixclass}::" 'NR > 1 { print CLASS $0 }' "agd_${DFILE}" report_data_file agmoag_ "${t_fixclass}" "Application group is member of application groups:" report_data_file agatop_ "${t_fixclass}" "Application group is assigned to operator:" report_data_file agatpr_ "${t_fixclass}" "Application group is assigned to user profile:" done } ############################################################################### # Report customer script data ################################################# ############################################################################### report_cust_scripts () { cd ${OV_CUST} for VENDOR in $(ls -l | awk '/^d/ { print $NF }') do cd ${OV_CUST}/${VENDOR} for MODEL in $(ls -l | awk '/^d/ { print $NF }') do cd ${OV_CUST}/${VENDOR}/${MODEL} for OS in $(ls -l | awk '/^d/ { print $NF }') do cd ${OV_CUST}/${VENDOR}/${MODEL}/${OS} find . -type f | sed 's/^..//' | sort | while read CUSTFILE do if [[ "$(echo ${CUSTFILE} | awk -F. '{ print $NF}')" = Z ]] then zcat ${CUSTFILE} > ${TMP1_FILE} echo "$(echo "${CUSTFILE}" | sed 's/.Z$//');\t\c" echo "$(file ${TMP1_FILE} | sed 's/.*: //'); cksum: \t\c" cksum < ${TMP1_FILE} else echo "${CUSTFILE};\t\c" echo "$(file ${CUSTFILE} | sed 's/.*: //'); cksum: \t\c" cksum < ${CUSTFILE} fi done | sed "s/^/${fixclass}:customer agent files:${VENDOR}\/${MODEL}\/${OS}::/" done done done } ############################################################################### # Report database maintenance ################################################# ############################################################################### report_db_maint () { awk "${AWK_LIB}"' /^ MAX_NUM_ACTIVE / { MAX_NUM_ACTIVE = $NF } /^ MAX_NUM_HIST / { MAX_NUM_HIST = $NF } /^ MAX_NUM_AUDIT / { MAX_NUM_AUDIT = $NF } /^ SEND_MSG_ACT_FLAG / { SEND_MSG_ACT_FLAG = $NF } /^ SEND_MSG_HIST_FLAG / { SEND_MSG_HIST_FLAG = $NF } /^ SEND_MSG_AUD_FLAG / { SEND_MSG_AUD_FLAG = $NF } /^ DOWNLOAD_HIST_FLAG / { DOWNLOAD_HIST_FLAG = $NF } /^ HIST_OLDER / { HIST_OLDER = $NF } /^ HIST_AT_TIME / { HIST_AT_TIME = get_value() } /^ HIST_NOTIFIC_FLAG / { HIST_NOTIFIC_FLAG = $NF } /^ DOWNLOAD_AUD_FLAG / { DOWNLOAD_AUD_FLAG = $NF } /^ AUDIT_OLDER / { AUDIT_OLDER = $NF } /^ AUDIT_AT_TIME / { AUDIT_AT_TIME = get_value() } /^ AUDIT_NOTIFIC_FLAG / { AUDIT_NOTIFIC_FLAG = $NF } /^ HIST_INTO_FILE / { HIST_INTO_FILE = get_value() } /^ AUDIT_INTO_FILE / { AUDIT_INTO_FILE = get_value() } END { if (SEND_MSG_ACT_FLAG = "TRUE" ) print "Send message for more then " MAX_NUM_ACTIVE " active and pending messages" if (SEND_MSG_HIST_FLAG = "TRUE" ) print "Send message for more then " MAX_NUM_HIST " history messages" if (SEND_MSG_AUD_FLAG = "TRUE" ) print "Send message for more then " MAX_NUM_AUDIT " audit records" if (DOWNLOAD_HIST_FLAG = "TRUE" ) print "Download history messages older then " HIST_OLDER " seconds to " HIST_INTO_FILE " at " HIST_AT_TIME if (DOWNLOAD_AUD_FLAG = "TRUE" ) print "Download audit records older then " HIST_OLDER " seconds to " AUDIT_INTO_FILE " at " AUDIT_AT_TIME }' ${DBMAINT} | sed "s/^/${fixclass}:database maintenance::/" } ############################################################################### # Report server configuration ################################################# ############################################################################### report_server_config () { awk "${AWK_LIB}"' BEGIN { audit[0] = "no audit" audit[1] = "operator audit" audit[2] = "administrator audit" MSI = 0 DUP = 0 } /^ PARALLEL_DISTRIB / { PD = "Maximum number of parallel distributions : " get_value() } /^ AUDIT_LEVEL / { AL = "Auditing level : " audit[get_value()] } /^ MESSAGE_IF_ENABLE 1/ { MSI = 1 } /^ MSG_IF_ALLOW_AA 1/ { MSI_AA = 1 } /^ MSG_IF_ALLOW_OA 1/ { MSI_OA = 1 } /^ MSG_DUPL_COUNTING 1/ { DUP = 1 } /^ ADD_COUNT_ANNOTATIONS 1/ { DUP_CNT = 1 } /^ OUTPUT_ALL_TO_MSI 1/ { MSI_SVR = "divert messages" } /^ OUTPUT_ALL_TO_MSI 2/ { MSI_SVR = "copy messages" } /^ PORT_RANGE / { PR = get_value() } END { print PD print AL if (DUP == 1) { print "Suppress and count duplicate messages" if (DUP_CNT == 1) print " Add duplicates as annotations" } if (MSI == 1) { print "Message stream interface enabled" if (length (MSI_SVR) > 0) print " Send all messages to server MSI: " MSI_SVR if (MSI_AA == 1) print " Allow externally defined automatic actions" if (MSI_OA == 1) print " Allow externally defined operator initiated actions" } if (length (PR) > 0) print "Allowed port range: " PRF }' ${SVRCFG} | sed "s/^/${fixclass}:server configuration::/" } ############################################################################### # Main ######################################################################## ############################################################################### [[ 1 = 1 ]] && clear_split [[ 1 = 1 ]] && { config_files create_download } [[ 1 = 1 ]] && { split_tgroup split_logfile split_message split_monitor split_trap split_console split_schedule split_ec split_node_group split_nodes split_hierarchy split_users split_applications split_instruction remove_template_group_nesting remove_application_group_nesting add_ngm_to_nm create_taon_from_nm repl_mtype resp_matrix } [[ 1 = 1 ]] && { report_template report_tgroup report_tusage report_msggrps report_nodes report_ngroups report_nhiers report_ndist report_apps report_agroups ls | grep "^u_pr" | xargs cat ls | grep "^u_op" | xargs cat ls | grep "^u_ta" | xargs cat } [[ 1 = 1 ]] && { report_cust_scripts } [[ 1 = 1 ]] && { report_db_maint [[ -n "$(grep -l "^ STATUS_FLAG 1" ${TROUBLET})" ]] && \ awk "${AWK_LIB}"'/^ TT_CALL / { print "Call for trouble ticket: " get_value() }' ${TROUBLET} | sed "s/^/${fixclass}:trouble ticket interface::/" report_server_config scc_check_file /etc/opt/omni/cell/CellServers "${fixclass}:managed Data Protector servers::" "#" } [[ 1 = 1 ]] && { remove_tmp_dirs } exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0800_s_oracle010050000000000000003000000115670774770013000224760ustar00rootsys00000000000000#!/bin/sh # Shell script to collect Oracle data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.5 $ . ${SCC_BIN}/scc_modules/scc_utils fixclass="fix:software:oracle" ORATAB=${ORATAB:-/etc/oratab} scc_check_file ${ORATAB} "${fixclass}:${ORATAB}::" "#" for ORAFILE in /etc/listener.ora /etc/tnsnames.ora /etc/sqlnet.ora /etc/tnsnav.ora do scc_check_file ${ORAFILE} "${fixclass}:sql-net:${ORAFILE}::" "#" done # Store the directories that we checked for the listener.ora, tnsnames.ora, .... echo "/etc" > ${TMP1_FILE} # in the following line [[ and ]] is used, because that's a build-in # which reacts better to the -n "possibly empty vatiable" if [[ -n "${TNS_ADMIN:-}" && "${TNS_ADMIN:-}" != "/etc" ]] then for ORAFILE in listener.ora tnsnames.ora sqlnet.ora tnsnav.ora do scc_check_file ${TNS_ADMIN}/${ORAFILE} "${fixclass}:sql-net:${TNS_ADMIN}/${ORAFILE}::" "#" done echo "${TNS_ADMIN}" >> ${TMP1_FILE} fi if [ -f ${ORATAB} ] then for ORACLE_SID in $(sed -e 's/:.*//' -e 's/[#*].*//' -e '/^[ ]*$/d' ${ORATAB} | sort) do ORACLE_HOME="$(awk -F: "/^${ORACLE_SID}:/ { print \$2 }" ${ORATAB})" ORACLE_USER="$(grep "ora_pmon_${ORACLE_SID}$" ${PROC_FILE} | awk 'NR == 1 { print $1 }')" export ORACLE_SID ORACLE_HOME if [[ -z "${ORACLE_USER}" ]] then continue # Nothing way to check automatically, try next ORACLE_SID fi class="${fixclass}:${ORACLE_SID}:general" echo "${class}::\$ORACLE_SID: ${ORACLE_SID}" echo "${class}::\$ORACLE_HOME: ${ORACLE_HOME}" echo "${class}::Unix user: ${ORACLE_USER}" # use the oracle user for executing svrmgrl and sqlplus # if those are executed as root, they are spawned as user daemon # which may result in file and directory permission problems if [ -x "${ORACLE_HOME}/bin/svrmgrl" ] then echo "${class}::" su ${ORACLE_USER} -c "${ORACLE_HOME}/bin/svrmgrl command=exit" | sed -e '/^[ ]*$/d' \ -e '/Copyright/d' \ -e "s/^/${class}::svrmgrl: /" fi if [ -x "${ORACLE_HOME}/bin/sqlplus" ] then echo "${class}::" su ${ORACLE_USER} -c "${ORACLE_HOME}/bin/sqlplus /nolog <<-EOF exit EOF" | sed -e '/^[ ]*$/d' \ -e '/Copyright/d' \ -e 's/Production on.*//' \ -e "s/^/${class}::sqlplus: /" fi # list init.ora and init.ora scc_check_file ${ORACLE_HOME}/dbs/init.ora "${fixclass}:${ORACLE_SID}:init.ora::" "#" scc_check_file ${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora "${fixclass}:${ORACLE_SID}:init${ORACLE_SID}.ora::" "#" # list files included with ifile sed -n -e 's/^[ ]*ifile.*=//p' \ ${ORACLE_HOME}/dbs/init.ora ${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora 2>/dev/null | while read ORAFILE do scc_check_file ${ORAFILE} "${fixclass}:${ORACLE_SID}:${ORAFILE}::" "#" done # check if .ora files are listed already, if not, list them # Check whether the current ${ORACLE_HOME} is already checked for *.ora. if [[ $(grep -c "^${ORACLE_HOME}\$" ${TMP1_FILE}) -eq 0 ]] then for ORAFILE in listener.ora tnsnames.ora sqlnet.ora tnsnav.ora do file="${ORACLE_HOME}/network/admin/${ORAFILE}" scc_check_file ${file} "${fixclass}:sql-net:${file}::" "#" done echo "${ORACLE_HOME}" >> ${TMP1_FILE} # Mark as checked fi scc_oracle_query "show sga" | sed -e "s/^/${fixclass}:${ORACLE_SID}:SGA::/" scc_oracle_query "select TABLESPACE_NAME, STATUS, FILE_NAME from DBA_DATA_FILES order by FILE_NAME;" | sed -e "s/^/${fixclass}:${ORACLE_SID}:database files::/" scc_oracle_query "select OWNER, SEGMENT_NAME, TABLESPACE_NAME, STATUS from DBA_ROLLBACK_SEGS order by OWNER, SEGMENT_NAME;" | sed -e "s/^/${fixclass}:${ORACLE_SID}:rollback segments::/" if [ ${ORA_LIST_USERS:-1} = 1 ] then scc_oracle_query "select USERNAME from ALL_USERS order by USERNAME;" | sed -e "s/^/${fixclass}:${ORACLE_SID}:users::/" fi scc_oracle_query "select OWNER, OBJECT_NAME, STATUS from ALL_OBJECTS where STATUS='INVALID' order by OWNER, OBJECT_NAME;" | sed -e "s/^/${fixclass}:${ORACLE_SID}:invalid objects::/" done fi rm -f ${TMP1_FILE} exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0900_s_system010050000000000000003000000146600774770013000225530ustar00rootsys00000000000000#!/bin/sh # Shell script to collect system data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.9 $ . ${SCC_BIN}/scc_modules/scc_utils if [ -x /usr/sbin/audevent ] then /usr/sbin/audevent | sed -e 's/^/fix:system:audevent::/' fi if [ -x /sbin/crashconf ] then /sbin/crashconf | awk '/^$/ { next } /^DEVICE/ { fixed=1; } { if ( fixed ) { print "fix:system:crashconf::" $0; } else { print "var:system:crashconf::" $0; } }' fi scc_check_file /etc/coreadm.conf "fix:system:/etc/coreadm.conf::" "#" scc_check_file /etc/dumpadm.conf "fix:system:/etc/dumpadm.conf::" "#" dmesg 2>/dev/null | sed -e "s/ $//" \ -e "s/^/var:system:log:dmesg::/" scc_check_file /etc/shutdownlog "var:system:log:/etc/shutdownlog::" "#" for file in /etc/dt/config/Xaccess \ /usr/dt/config/Xaccess \ /etc/environment \ /etc/issue \ /etc/.login \ /etc/login.access \ /etc/login.defs \ /etc/motd \ /etc/profile \ /etc/shells \ /etc/skel/local.cshrc \ /etc/skel/local.profile \ /etc/skel/.profile do scc_check_file "${file}" "fix:system:login:${file}::" "#" done for file in /etc/X11/SecurityPolicy \ /etc/X11/X0devices \ /etc/X11/X0pointerkeys \ /etc/X11/X0screens \ /etc/X11/Xconsoles \ /etc/dt/config/Xsetup do scc_check_file "${file}" "fix:system:X11:${file}::" "#" done # Often /etc/logingroup is a symbolic link to /etc/group. Check whether these files differ to determine # incorporating /etc/logingroup in the snapshot. file="/etc/logingroup" if [ -f ${file} -a "$(cmp -s ${file} /etc/group 2>/dev/null; echo $?)" -eq 1 ] then # All group-members must be on a single line. Split the line and sort # the data for better overview. This also enables us to compare systems # where users were added in different order to this file. awk -F: '{ if ( length( $4 ) == 0 ) { printf( "%s::%s:%s:%s:\n", p, $1, $2, $3 ); } else { cnt = split( $4, parts, "," ); for ( i = 1; i <= cnt; i++ ) { printf( "%s::%s:%s:%s:%s\n", p, $1, $2, $3, parts[ i ] ); } } }' p="fix:system:login:${file}" ${file} | sort fi scc_check_file /etc/man.config "fix:system:man::/etc/man.config: " "#" scc_check_file /usr/share/man/man.cf "fix:system:man::/usr/share/man/man.cf: " "#" for f in PATH MANPATH SHLIB_PATH do if [ -s /etc/${f} ] then sed -e '/^#/d' \ -e '/^[ ]*$/d' /etc/${f} | tr ":" "\012" | sed -e "s@^@fix:system:path::/etc/${f}: @" fi done scc_check_file /etc/manpath.config "fix:system:path::/etc/manpath.config: " "#" # Add the processes as variabele data. sed -e 's/^/var:system:processes::/' ${PROC_FILE} for f in /etc/security/* /etc/user_attr /etc/logindevperm /etc/securetty /etc/privgroup /etc/ttys /etc/limits /etc/permissions* do if [ -d ${f} ] then for g in ${f}/* do scc_check_file "${g}" "fix:system:security:${g}::" "#" done else if [ "${OS_NAME}" = "AIX" ] then if [ "${f}" = /etc/security/passwd -o "${f}" = /etc/security/group -o "${f}" = /etc/security/lastlog ] then # These files contain passwords or variable data, do not show them. continue; fi fi scc_check_file "${f}" "fix:system:security:${f}::" "#" fi done if [ -d /usr/lib/security ] then ls -l /usr/lib/security | scc_ls | sed -e 's@^@fix:system:security:/usr/lib/security::@' fi scc_check_file /etc/krb5.conf "fix:system:security:/etc/krb5.conf::" "#" scc_check_file /etc/krb5.keytab "fix:system:security:/etc/krb5.keytab::" "#" for d in /etc /etc/portsentry do scc_check_file "${dir}/portsentry.conf" "fix:system:security:${dir}/portsentry.conf::" "#" done scc_check_file /etc/ld.so.conf "fix:system:/etc/ld.so.conf::" "#" scc_check_file /etc/hosts.allow "fix:system:security:/etc/hosts.allow::" "#" scc_check_file /etc/hosts.deny "fix:system:security:/etc/hosts.deny::" "#" if [ -x /usr/bin/getconf ] then for c in POSIX_VERSION POSIX2_VERSION XOPEN_VERSION do echo "fix:system:standards::${c}: $(/usr/bin/getconf ${c} 2>/dev/null)" done fi if [ -x /usr/sbin/swapinfo ] then # Actual swap-usage is not fixed. Remove this info from the output. HDR=$(/usr/sbin/swapinfo 2>/dev/null | grep "^TYPE") start_var=$(echo "${HDR}" | sed -e 's/ *USED.*//' | wc -c) stop_var=$(echo "${HDR}" | sed -e 's/ *RESERVE.*//' | wc -c) /usr/sbin/swapinfo | cut -c1-${start_var},${stop_var}-100 | sed -e 's/^/fix:system:swapinfo::/' elif [ -x /usr/sbin/swap ] then HDR=$(/usr/sbin/swap -l 2>/dev/null | grep "^swapfile") start_var=$(echo "${HDR}" | sed -e 's/ blocks.*//' | wc -c | sed -e 's/^[ ]*//') /usr/sbin/swap -l 2>/dev/null | cut -c1-${start_var} | sed -e 's/^/fix:system:swap::/' elif [ -x /usr/sbin/lsps ] then /usr/sbin/lsps -a 2>/dev/null | awk '{ $(NF-3)=""; printf( "fix:system:swap lsps page info::%s\n", $0 ) }' elif [ -x /sbin/swapon ] then /sbin/swapon -s 2>/dev/null | awk '{ $(NF-1)=""; print "fix:system:swapon::" $0 }' fi scc_check_file /etc/swapspaces "fix:system:swap devices:/etc/swapspaces::" "\*" if [ -x /usr/bin/sysdumpdev ] then /usr/bin/sysdumpdev | sed -e 's/^/fix:system:dump::/' fi if [ "${scc_time_zone}" ] then if [ -s /usr/lib/tztab ] then # Specification of the points of change consist of the # name of the zone, followed by lines that start with a digit. sed -n -e '/^'"${scc_time_zone}"'/,/^[ ]*$/p' /usr/lib/tztab | sed -e 's@^@fix:system:time::/usr/lib/tztab: @' elif [ -x /usr/sbin/zdump ] then # zdump gives the current date and time in the first line: ignore. zdump -v ${scc_time_zone} | sed -e '1 d' \ -e 's@^@fix:system:time::zdump: @' fi fi exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_1000_s_users010050000000000000003000000132310774770013000223510ustar00rootsys00000000000000#!/bin/sh # Shell script to collect users data. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.7 $ . ${SCC_BIN}/scc_modules/scc_utils if [ -x /usr/sbin/useradd ] then useradd -D | sort | sed -e 's/^/fix:users:useradd defaults::/' fi if [ -x /usr/sbin/logins -o -x /usr/bin/logins ] # Available on HP-UX and SunOS then logins -o -x -a | awk -F: '{ prefix="var:users:logins::" if ( $2 < m ) { prefix="fix:users:logins::" } print prefix $0; }' m=${MAX_SYS_ACCOUNT_ID} | sort logins -d | sort -k 2n -k 1 | sed -e 's/^/fix:users:check:duplicate UIDs::/' logins -p | sort -k 1 | sed -e 's/^/fix:users:check:accounts without password::/' sed -e 's/:[^:]*:/:/' \ -e "s@^@var:users:/etc/group::@" /etc/group else for f in passwd group shadow do if [ -f /etc/${f} ] then # Erase the password fields when they are longer than 10 characters. sed -e 's/^\([^:]*\):[^:][^:][^:][^:][^:][^:][^:][^:][^:][^:]*:/\1:ERASED:/' /etc/${f} | if [ ${f} = "passwd" ] then awk -F: '{ prefix="var:users:" if ( $3 < m ) { prefix="fix:users:" } print prefix f "::" $0; }' f=/etc/${f} m=${MAX_SYS_ACCOUNT_ID} else sed -e "s@^@var:users:/etc/${f}::@" fi | sort fi if [ ${IS_NIS_MASTER} -eq 1 -a "${NIS_DATA_DIR}" != "/etc" -a -f "${NIS_DATA_DIR}/${f}" ] then # Erase the password fields when they are longer than 10 characters. sed -e 's/^\([^:]*\):[^:][^:][^:][^:][^:][^:][^:][^:][^:][^:]*:/\1:ERASED:/' \ -e "s@^@var:users:${NIS_DATA_DIR}/${f}::@" "${NIS_DATA_DIR}/${f}" fi done if [ "${OS_NAME}" = "AIX" ] then # Again, erase the passwords that are longer than 10 characters. sed -e 's/password = ...........*$/password = ERASED/' /etc/security/passwd 2>/dev/null | awk '/^[ ]*$/ { next } /^[^ ]/ { account=$1; next } { print "var:users:/etc/security/passwd::" account $0 }' awk '/^[ ]*$/ { next } /^[^ ]/ { group=$1; next } { print "var:users:/etc/security/group::" group $0 }' /etc/security/group 2>/dev/null fi fi # Single Signon: password synchronisation between Unix and Windows. scc_check_file /etc/sso.conf "fix:users:/etc/sso.conf::" "#" # Get the mount-points of all file-systems. df -P | awk '{ if ( $NF ~ "^/" ) { print $NF; } }' | sort >${TMP1_FILE} ( # Get all the mountpoints of NFS-mounted filesystems. # We exclude these filesystems from the survey of the accounts. df -lP | awk '{ if ( $NF ~ "^/" ) { print $NF; } }' | sort | comm -13 - ${TMP1_FILE} # Now we produce the data of the users. if [ ${IS_NIS_MASTER} -eq 1 ] then ypcat passwd else cat /etc/passwd fi ) | awk -F: '{ if ( NF == 1 ) { # Process the names of the NFS-filesystems dir=sprintf( "%s/", $1 ); nfs[ dir ]=1; next; } # Visit each homedirectory only once. if ( visited[ $6 ] == 0 ) { nfs_home_dir=0; for ( d in nfs ) { # Does homedirectory start with nfs-directory? if ( index( $6, d ) ) { nfs_home_dir=1; break; } } if ( ! nfs_home_dir ) { print $1, $3, $6; # Show: username, uid and home-directory } visited[ $6 ] =1; } }' | sort | while read user uid dir do if [ -z "${user}" ] then continue fi # Determine whether we are dealing with a system or an ordinary user. prefix="var" if [ ${uid} -lt ${MAX_SYS_ACCOUNT_ID} ] then prefix="fix" fi scc_check_file "${dir}/.rhosts" "${prefix}:users:accounts:${user}::.rhosts: " "#" | sort scc_check_file "${dir}/.netrc" "${prefix}:users:accounts:${user}::.netrc: " "#" scc_check_file "${dir}/.forward" "${prefix}:users:accounts:${user}::.forward: " "#" ( scc_check_file "${dir}/.ssh/known_hosts" "${prefix}:users:accounts:${user}::ssh known hosts: " "#" scc_check_file "${dir}/.ssh/authorized_keys" "${prefix}:users:accounts:${user}::authorized_keys: " "#" ) | awk '/^...:users:accounts:/ { for ( i = 2; i <= NF; i++ ) # Skip the classification. { if ( length( $i ) > 40 ) { $i=""; # Erase the keys } } } { print; }' done if [ -d /var/mail ] then ls /var/mail 2>/dev/null elif [ -d /var/spool/mail ] then ls /var/spool/mail 2>/dev/null fi | sed -e 's/^/var:users:mailboxes::/' pw_grp_ck_options="" if [ "${OS_NAME}" = "Linux" ] then pw_grp_ck_options="-r" fi if [ -x /usr/sbin/pwck ] then # For HP-UX 11 you will need patch PHCO_16196 to reduce the "noise" of pwck. # Erase the password-field from the output. /usr/sbin/pwck ${pw_grp_ck_options} 2>&1 | sed -e 's/:[^:][^:]*:/:/' \ -e '/^[ ]*$/d' \ -e 's/^/fix:users:check:pwck::/' fi if [ -x /usr/sbin/grpck ] then # Erase the password-field from the output. /usr/sbin/grpck ${pw_grp_ck_options} 2>&1 | sed -e 's/:[^:][^:]*:/:/' \ -e '/^[ ]*$/d' \ -e 's/^/fix:users:check:grpck::/' fi exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_utils010050000000000000003000000150020774770013000213640ustar00rootsys00000000000000#!/bin/sh # Shell script with utilities for the modules of scc. # Copyright (C) 2001-2003 Open Challenge B.V. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. # If not, write to the Free Software Foundation, # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Contact information: www.open-challenge.nl/scc/index.html # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.4.28 # file-version: $Revision: 1.5 $ # Use the following utilities for SunOS. AWK=awk if [ -x /usr/xpg4/bin/awk ] then alias awk=/usr/xpg4/bin/awk AWK=/usr/xpg4/bin/awk fi if [ -x /usr/xpg4/bin/grep ] then alias grep=/usr/xpg4/bin/grep fi if [ -x /usr/xpg4/bin/id ] then alias id=/usr/xpg4/bin/id fi if [ -x /usr/xpg4/bin/df ] then alias df=/usr/xpg4/bin/df fi export AWK # Add the contents of the file to the snapshot. # Syntax: scc_check_file # Return: 0 file is present # 1 file is absent scc_check_file() { if [ $# -ne 3 ] then echo "Syntax error, use: scc_check_file " >&2 echo "arg1: ${1}, arg2: ${2}" >&2 return 1 fi check=${2%%::*} if [ "${check}" = "${2}" ] then echo "improper prefix: ${2}, missing '::'" >&2 fi if [ -f "${1}" ] then # Binary files do not look nice in the snapshots. Use file # to avoid files with binary data. # List with exceptions: # - file thinks that some files in /proc are empty # so, do process empty files # - on HP-UX: /etc/default/fs: nettl binary Log file -version 17217 # - RH uses: empty # - SunOS uses: empty file action=1; f_type="$(file ${1} 2>/dev/null | head -1)" case "${f_type}" in *ASCII?text,*) ;; *text) ;; *empty) ;; *empty?file) ;; *executable?*?script) ;; *shell?script*) ;; *symbolic?link?to*) ;; /etc/default/fs*) ;; *cannot?open*) action=-1;; # Ignore NFS-errors. *) action=0;; esac if [ ${action} -gt 0 ] then # Ignore comment and blank lines. awk '/^[ ]*$/ { next } /^[ ]*'"${3}"'/ { next } { print p $0 }' p="${2}" "${1}" return 0; # indicate logging of data in file. elif [ ${action} -eq 0 ] then # Sometimes the file command tries to interpret too much. # Add a comment-line to get the result: data echo "fix:general::scc_check_file ignored non-ASCII file ${f_type}" fi fi return 1; # indicate skip of (absent) file. } # Encrypt stdin # Syntax: scc_crypt scc_crypt() { # Encrypt stdin. if [ -x /usr/bin/md5sum ] then /usr/bin/md5sum | sed -e 's/ .*//' elif [ -x /usr/bin/crypt ] then /usr/bin/crypt "${crypt_key}" | cksum | sed -e 's/ .*//' else # no encryption available, ignore data cat >/dev/null fi return 0; } # Add profiling data # Syntax: scc_timing scc_timing() { now=$(date '+%M:%S') min=${now%:*} sec=${now#*:} tick_cur=$(( ${sec#0} + ( 60 * ${min#0} ) )) if [ ${tick_cur} -lt ${tick_prev} ] then runtime=$(( ${tick_cur} + 3600 - ${tick_prev} )) else runtime=$(( ${tick_cur} - ${tick_prev} )) fi total_time=$(( ${total_time} + ${runtime} )) echo "var:profiling::$(date '+%H.%M.%S'):${runtime}:${total_time}:${1}" tick_prev=${tick_cur}; return; } # Reformat the output of ls -l, replace the time by the year. # The first 6 months after modification, the time is shown. # After 6 months, the year is shown. Avoid unnessary differences between snapshots. month_now=$(date '+%m') year_now=$(date '+%Y') scc_ls() { awk '{ if ( NF > 8 ) print }' | sed -e 's/ Jan / 01 /' \ -e 's/ Feb / 02 /' \ -e 's/ Mar / 03 /' \ -e 's/ Apr / 04 /' \ -e 's/ May / 05 /' \ -e 's/ Jun / 06 /' \ -e 's/ Jul / 07 /' \ -e 's/ Aug / 08 /' \ -e 's/ Sep / 09 /' \ -e 's/ Oct / 10 /' \ -e 's/ Nov / 11 /' \ -e 's/ Dec / 12 /' | ${AWK} '{ if ( $8 ~ "^[0-9][0-9][0-9][0-9]$" ) { year=$8 } else { year=j if ( $6 > m ) { year--; } } printf( "%s:%s:%s:%s:%s:%d-%02d-%02d:%s %s %s\n", $1, $2, $3, $4, $5, year, $6, $7, $9, $10, $11 ); }' j=${year_now} m=${month_now} return; } scc_oracle_query () { # This routine only works for Oracle 7.3 and later! ORA_USE_PROFILE=${ORA_USE_PROFILE:-0} { if [[ ${ORA_USE_PROFILE} = 1 ]] then echo "su - ${ORACLE_USER} -c \"" else echo "su ${ORACLE_USER} -c \"" fi if [[ -x ${ORACLE_HOME}/bin/svrmgrl ]] then echo "${ORACLE_HOME}/bin/svrmgrl << !!EOF" echo "connect internal" else echo "${ORACLE_HOME}/bin/sqlplus /nolog << !!EOF" echo "connect / as sysdba" echo "set linesize 32000;" echo "set pagesize 32000;" fi echo "$*" echo "exit" echo "!!EOF\"" # the output of the script above, executed by sh below MUST be redirected # to the TMP file, because of strange behaviour of Oracle 7 svrmgrl } | sh > ${TMP2_FILE} sed -e 's/SVRMGR> //' \ -e 's/SQL> //g' \ -e '1,/^Connected.$/d' \ -e '/^Server Manager complete/d' \ -e '/^Disconnected from Oracle/,$d' \ -e '/^[ ]*$/d' \ -e '/^[0123456789]* rows selected./d' ${TMP2_FILE} rm ${TMP2_FILE} } # On a RH73 Workstation, there is no "strings", replace the functionality by a function. strings_exe=$(which strings 2>/dev/null) strings_exe=${strings_exe##no *} # erase the message: no strings in . . if [ ! -x "${strings_exe}" ] then strings() { # Replace all binary nuls by a linefeed to avoid lines that are too long. if [ $# -eq 0 ] then tr -s "\000" "\012" else tr -s "\000" "\012" <$1 fi | tr -d -c "[_a-zA-Z \011\-/=\.\"\012]" return 0; } fi # Use the following utilities for SunOS. if [ -x /usr/ccs/bin/what ] then alias what=/usr/ccs/bin/what else # On a RH73 Workstation, there is no "what", replace the functionality by a function. what_exe=$(which what 2>/dev/null) what_exe=${what_exe##no *} # erase the message: no strings in . . if [ ! -x "${what_exe}" ] then what() { if [ -r "${1}" ] then echo "${1}:" strings "${1}" | sed -n -e 's/^@(#)/ /p' return 0; else echo "can't open ${1}" return 1 fi } fi fi # Do not exit scc/scc-run/opt/scc/doc/004070000000000000003000000000003777777777700152175ustar00rootsys00000000000000scc/scc-run/opt/scc/doc/COPYING010040000000000000003000000431310774770013000162040ustar00rootsys00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the 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. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. scc/scc-run/opt/scc/doc/scc-4.html010040000000000000003000000137210774770013000167520ustar00rootsys00000000000000Manpage of scc

scc(4)



NAME

scc - file formats used by SCC

DESCRIPTION

SCC stores configuration data from systems in flat files called snapshots. All configuration data is structured by prefixing it with a fixed-variable indication and with a hierarchial classification. The indication, all elements of the classification and the configuraton data are separated by colon's. By comparing two consecutive snapshots and ignoring the variable data, we are able to maintain a logbook of a system. Lines in the logbook also consist of colon separated fields.

SNAPSHOTS

The contents of the file /var/adm/cron/cron.allow are stored in a snapshot in the following way:


   fix:software:cron:configuration::/var/adm/cron/cron.allow:root
   fix:software:cron:configuration::/var/adm/cron/cron.allow:adm
   fix:software:cron:configuration::/var/adm/cron/cron.allow:uucp

After the indicator "fix" for fixed data there are at most five levels of hierarchical classifications of the remaining data. The classification and the data are separated by two consecutive colons.

When this file is altered (uucp should not run cron-jobs), the reported data contains the change itself (uucp) and the classification of the altered data (software:cron:configuration::/var/adm/cron/cron.allow:). Without the classification SCC only could have reported that a user has been removed.

CLASSIFICATIONS

The output of scc-collect is checked by scc-log. Any line that does not start with "fix:" of "var:" is prefixed with "fix:messages::", indicating unexpected output from one of the commands used by scc-collect. As the html-file groups data per classification, the original snapshot has to be inspected to locate the commands causing this output.

The snapshot is converted to a hierarchical menu. Therefore the following combination of classifications cannot be used:


   fix:software:myprogram::
   fix:software:myprogram:config::

The first classification results in html-code to access "myprogram" as an option in the sub-menu "software". The second classification should result in html-code to access a sub-menu "myprogram" containing the option "config".

It is the responsibility of the developer to ensure a correct menu-structure by using the correct classifications in scc-collect and in the plugins.

LOGBOOK

Two consecutive snapshots are compared using diff(1). The resulting output is altered to indicate the old and the new configuration. When the user uucp is removed from cron.allow, the following data is added to the logbook:


   2001-09-12:11.18.46:result::different
   2001-09-12:11.18.46:remark::
   2001-09-12:11.18.46:count::1
   2001-09-12:11.18.46:previous date::2001-09-08
   2001-09-12:11.18.46:previous time::07.37.46
   2001-09-12:11.18.46:data::old::software:cron:configuration::
        /var/adm/cron/cron.allow:uucp

For clarity the last line has been folded. Again we see colon separated fields. The first fields indicate the date and time of the change. Then there is a classification of the remaining fields, separated by two, consecutive colons from the differences. The classification is limited to: result, remark, count, previous date, previous time and data.

After reporting the result and some administrativia, finally the actual change is reported. The keyword old indicated that this data was only present in the old snapshot. So it has been removed from the current configuration of the system.

CLASS

A class-file contains lines with (parts of) classifications. When they are not present, colons are added in front and at the end of each classification. Lines starting with '#' are treated as comments.

To extract the boot configuration and start/stop links out a snapshot, use the following class-file:

   boot:config:
   boot:rc-file:

Class-files are used by scc-baseline(1) and scc-syscmp(1). Check the snapshots to determine the classifications to be extracted from the snapshot.

KEEP-FILE

The keep-file is used to store data that is obtained from running processes, that might not be running during the next run of scc. To avoid changes in the logbook any time such a proces temporarily does not run, the obtained data is stored in a keep-file. scc-collect uses the data in this file when the processes are not running. Examples of the data in the keep-file are apache-configuration data and rpm-data. The latter data should be recorded in the keep-file as the rpm-database is locked during installs and rpm does not return any data when it is queried during an install.

The format of the keep-file looks like the format of the snapshots. It consists of lines with colon-separated fields. Leading fields are used to identify the data. The contents of the keep-file are determined by scc-collect.

The keep-file is removed during the installation of SCC to enable upgrades of the format of this file. This results in the "feature" that SCC is unable to record it's own upgrade on a RPM-system.

COPYRIGHT

SCC is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V.

SEE ALSO

scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1),
scc-snap2html(1), scc(4), scc(5)

VERSION

$Revision: 1.17 $


This document was created by man2html using the manual pages.
Time: 08:54:47 GMT, October 29, 2003 scc/scc-run/opt/scc/doc/scc-5.html010040000000000000003000000152630774770013000167560ustar00rootsys00000000000000Manpage of scc

scc(5)



NAME

scc - introduction SCC

DESCRIPTION

System Configuration Collector is yet another configuration collector. Just like the other collectors it collects configuration data on Unix systems. The difference is that each line of collected data is extended with a hierarchical classification of the nature of the data and with an indicator whether that data is supposed to be static or dynamic. For example: the size of a filesystem is static data and the current usage is dynamic data. Consecutive collections of configuration data (snapshots) are compared and differences in the static data are added to a logbook. Filling a filesystem will not be reported in the logbook, but the extension of a filesystem will be. Additional software converts the snapshot and logbook to html-format.

The classification of the data is a hierarchy with the following top-level items (among others):


- general
- boot
- hardware
- kernel
- network
- software
- system
- users

Development of SCC started for HP-UX and later shifted to Solaris and Linux. At the moment most of the Operating System configuration of HP-UX is collected. Additional configuration is collected for OS-addons like MCServiceGuard and OmniBack.

INSTALLATION

SCC is available as HPUX depot, Solaris package, RPM and soure tar-ball. The software is NOT relocatable and installs in /opt/scc/bin. Data- and temporary files are located in /var/opt/scc.

During the pre-install phase, the software runs a possibly installed version of SCC. All changes on the system up to the moment of installation are collected in the logbook. During the post-install phase, the software removes the current snapshot (made by the previous version of SCC) and starts the new version of SCC. This means that SCC does not compare two possibly incompatible snapshots, avoiding flooding the logbook.

This means that the installation may take some time (typically less than 5 minutes). On a moderate pentium with RedHat 6.2, SCC completed a run within a minute. On an old and overloaded HP-UX server, it was reorganizing its database, two runs of SCC took 45 minutes to complete.

To install release 1.3.29 on HP-UX, use the commands:

        swinstall -s $(pwd)/scc-1.3.29.hpux-1x.depot scc
To register this file as a depot, use the command:
        swreg -l depot $(pwd)/scc-1.3.29.hpux-1x.depot
To add this file to an existing depot, use the command:
        swcopy -s $(pwd)/scc-1.3.29.hpux-1x.depot scc @/your/depot

To install release 1.3.29 of the SunOS package, use the commands:

        pkgadd -d ./scc-1.3.29.sunos.pkg -a none scc
You will be prompted for the execution of the pre/post-install scripts.

To install release 1.3.29 of the RPM package, use the commands:

        rpm -U ./scc-1.3-29.rpm

PROGRAMS

The programs of SCC have the following relationship:

scc: main program
this program calls scc-log and sends data to the SCC-server.
scc-log: this program calls:
- scc-collect: collect all data by calling modules in scc_modules
- compare new and old snapshots, add differences to logbook
- scc-snap2html: convert snapshot to HTML
- scc-log2html: convert logbook to HTML

Previous versions of SCC contained the programs scc-baseline and scc-syscmp to compare (parts of) snapshots. This functionality is moved to the scc-srv. These programs are removed from the distribution and from the systems when the new version of SCC is installed.

USING SCC

After the installation, the data is available in directory /var/opt/scc/data. The file scc.<hostname>.log contains the logbook and the file scc.<hostname>.cur contains the current snapshot.

To run SCC again, just start /opt/scc/bin/scc. To keep an accurate logbook of your system, you can schedule it with cron:

        0 6 * * * /opt/scc/bin/scc

Any errors produced by programs called by scc-collect, appear under the classification "messages". Most of the times they indicate some hardware or software error on the system. Running SCC is some kind of a healthcheck for your system.

It is possible to send your SCC-data (snapshots, logbooks and the html-files) to a server running the server-software of SCC (scc-srv). Before you send your data to a server, you have to prepare the server by installing scc-srv and configuring the server. On the server, summaries of the SCC-data are generated and all data is accessible through a web-interface.

To mark the completion of certain changes, use the -c option of scc(1). To mark changes in the snapshot when implementing a RFC, use the following commands:

scc                # record changes up to this moment
# perform the tasks required by the RFC
scc -c "RFC 123"   # record changes due to RFC

EXTENDING SCC

scc-collect(1) collects OS and OS-related configuration data. It does not collect specific application data. To extend the snapshots, refer to the manual page of scc-plugin(1). It offers a starting point to collect other configuration data.

Refer to the manual page of scc-collect(1) and scc(1) for a more detailed description of the use of modules.

SECURITY

As the programs of SCC must run as root to obtain all the necessary configuration data, the environment of SCC must be well protected. This is accomplished by creating separate directories for the data and programs of SCC and properly securing them.

Therefore SCC is not relocatable during installation. As only root should run these programs there is no need for ordinary users to put the SCC-directory in their PATH.

COPYRIGHT

SCC is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V.

SEE ALSO

scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1),
scc-snap2html(1), scc(4), scc(5)

VERSION

$Revision: 1.15 $


This document was created by man2html using the manual pages.
Time: 08:54:47 GMT, October 29, 2003 scc/scc-run/opt/scc/doc/scc-collect.html010040000000000000003000000166700774770013000202420ustar00rootsys00000000000000Manpage of scc-collect

scc-collect



NAME


        scc-collect - collect system configuration in a SCC-snapshot

SYNOPSIS


        scc-collect [ -a <arg> ] [ -e <module> ] [ -i ]

DESCRIPTION


        This program collects configuration data from a system and writes
        it to stdout as a SCC-snapshot. A snapshot is a file containing 
        configuration data. Each line of configuration-data is prefixed with
        a classification. Refer to scc(4) for a detailed description of the
        format of the contents of a snapshot.

        Part of the classification is an indicator whether the data is fixed 
        or variable. This makes it possible to compare snapshots and report 
        any difference in the configuration data that was supposed to be fixed.

        The entire process of creating a new snapshot, comparing it with the
        previous one and adding the differences to a logbook is done by 
        scc-log(1).

        The collection of configuration data is performed by means of 
        modules, located in directory /opt/scc/bin/scc_modules. There are two
        kinds of modules: system and user. The distinction is made by means
        of the names: scc_9999_s_<name> and scc_9999_u_<name>. Where 9999
        stands for a four digit number used to determine the order of the
        execution of the modules. The _s_ and _u_ indicate the system and
        user modules. When a system and user module use the same four-digit
        number, the system module is executed first. System modules are 
        distributed by scc. Each site can extend the functionality of SCC
        by adding user modules.

        Modules can be executed separately when the -i option is used. In 
        that case, the resulting data goes to stdout.
        Without the -i option, all system modules and the specified user
        modules are run, leaving their data in the file
        /var/opt/scc/data/plugin_data/<module>. In that case the output
        of scc-collect is the output of all system modules and all 
        plugin-data.

        When a user module requires additional arguments, the -a option
        can be used. Note that each started user module is started with
        these arguments.

        When the code of a user module changes, scc-collect automatically
        ignores any changes in the scc-data of this module on the next run
        of the user-module. To test module scc_1234_u_abc, use the
        following steps:

           - run the user-module to catch possible changes:
             scc -e scc_1234_u_abc
           - change the user-module
           - test the user-module:
             scc-collect -i -e scc_1234_u_abc
           - rerun the user-module and store the output:
             scc -e scc_1234_u_abc

        Note: when you change a user-module without running it, you will
        loose all changes (for the module) that were made before the 
        next run.

ARGUMENTS


        None.

OPTIONS


        -a <arg>        Start each user module with argument <arg>.
        -e <module>     Run only module <module>. Refer to the DESCRIPTION
                        section for a detailed description of modules.
                        <module> can contain shell filename wildcards.
                        To find the matching modules, the program searches
                        for *<module>*.
        -i              Run the program interactively. Without this option,
                        the program only runs when stdin is a tty.

EXAMPLES


        To execute all user modules, specifiy:

                scc-collect -i -e "scc_????_u_".

        To execute only the kernel system module, named scc_0300_s_kernel,
        specify:

                scc-collect -i -e kernel

EXTERNAL INFLUENCES


        The HP Support Tools Manager (stm) is not called when the environment
        variable SCC_IGNORE_STM is set. During install by SD-UX, it is set
        to avoid running stm.

        RPM is locked during installation of SCC, ignore rpm during installs
        of SCC. The install-scripts set the environment variable 
        SCC_INSTALL_PHASE.

        Use the environment variable SCC_PROFILING to add timing data
        to the snapshot. This enables you to locate possible performance
        bottlenecks. By default, this variable is empty and no profiling
        data is added to the snapshot.
        The profile data has classification: "var:profiling::"

DIAGNOSTICS


        This program writes the following messages to stderr:

        Syntax error, use: scc-collect [ -a <arg> ] [ -e <module> ] [ -i ]
        A syntax error has been detected and reported.

        scc-collect: use -i option to run interactive
        
        scc-collect: only root should run this program
        Log in as root to run this program.

        scc-collect: non-executable module: <module>
        Correct the permissions of the module in the directory
        /opt/scc/bin/scc_modules.

        scc-collect: missing data for module: <module>
        The file /var/opt/scc/data/plugin_data/<module> is missing.
        Run the module with the -m option to generate the datafile.
        

RETURN VALUE


        Upon completion, the program returns one of the following values:

                0 successful completion
                2 runtime error

COPYRIGHT


        scc-collect is free software under the terms of the GNU General Public 
        License. Copyright (C) 2001-2003 Open Challenge B.V.

FILES


        /opt/scc/bin/scc_modules - directory with modules
                scc_utils - utilities for modules
                scc_[0-9][0-9][0-9][0-9]_s_*
                modules distributed with scc and always executed
                scc_[0-9][0-9][0-9][0-9]_u_*
                user plugins, only executed with -u option
                they leave their output in the file:
                /var/opt/scc/data/plugin_data/<module>
        /var/opt/scc/tmp - directory for temporary files
        /var/opt/scc/data - directory for data files
                scc.<hostname>.cur - current SCC-snapshot
                scc.<hostname>.html - current SCC-snapshot in HTML-format
                scc.<hostname>.old - previous SCC-snapshot
                scc.<hostname>.new - new (temporary) SCC-snapshot
                scc.<hostname>.log - logbook for changes in SCC-snapshot
                scc.<hostname>.log.html - logbook in HTML-format
                scc.<hostname>.keep - data kept from a previous run

SEE ALSO


        scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1),
        scc-snap2html(1), scc(4), scc(5)

VERSION


        $Revision: 1.154 $



This document was created by man2html using the manual pages.
Time: 08:54:47 GMT, October 29, 2003 scc/scc-run/opt/scc/doc/scc-log.html010040000000000000003000000151760774770013000173760ustar00rootsys00000000000000Manpage of scc-log

scc-log



NAME


        scc-log - create a SCC-snapshot and compare with previous snapshot

SYNOPSIS


        scc-log [ -c <remark> ] [ -e <mod> ] [ -m <max> ] [ -r | -u ]

DESCRIPTION


        This program calls scc-collect to create a SCC-snapshot and compares
        it with a previous snapshot. Additional snapshots, created by plugins,
        are added. All differences are added to a logbook. Running the plugins
        is the reponsibility of the administrator. The snapshots generated by
        the plugins are expected in directory /var/opt/scc/data/plugin_data

        The contents of the snapshots generated by the plugins are tested to 
        check their format. Lines with unknown formats are prefixed with the
        classification: "fix:messages::". The classication of valid lines is
        extended with ":plugin:<file_name>:".

        Finally, both the new snapshot and the logbook are also written in
        HTML-format. Refer to scc(4) for a detailed description of the format
        of the snapshots and logbooks.

        In rare occasions, scc-collect "hangs". Use the following command
        to find the childprocesses of scc:
                UNIX95= ps -Hef
        This will show you the entire process-tree. On Solaris, you can use
        the ptree command from the proctools. Find the "deepest" descendant
        from scc-collect and kill this process. Then issue the command again
        to monitor the progress of scc-collect.

        On abnormal termination of scc-collect, the new snapshot probably is
        incomplete. When the cause of the problem is removed, a new run of
        scc can be started. This leads to large differences with the new,
        complete snapshot. To avoid this, use the -r option of scc-log to
        remove the current snapshot before making a new one.

        When the abnormal termination of scc-collect was not detected, the
        next run of scc will add many differences to the logbook. To reduce
        the size of the logbook, the logfile can be edited by hand and the
        differences can be deleted.

LIMITATIONS


        As the rpm-database is locked during the install of scc, the snapshot 
        made during the install does not contain any rpm-data. The next time
        scc is run after the install, it will record the rpm-data in the
        snapshot. This added rpm-data will not be mentioned in the logbook. 
        Any further changes in the rpm-data will be added to the logbook. 

ARGUMENTS


        None.

OPTIONS


        -c <remark>     add a remark to the logbook, indicating a "specific" 
                        reason to run scc. For instance to mark the successfull
                        configuration/change of a system.
        -e <mod>        scc-collect runs user module <mod> when collecting data.
        -m <max>        entries in the log-file, that are older than <max>
                        months, are deleted
        -r              remove the current snapshot to avoid comparing it with
                        the new (incompatible/incomplete) shapshot.
        -u              remove all snapshots, logbooks en html-files and exit

DIAGNOSTICS


        This program writes the following messages to stderr:

        Syntax error, use: scc-log [ -c <remark> ] [ -e <mod> ] [ -m <max> ]
                [ -r | -u ]
        A syntax error has been detected and reported.

        scc-log: another instance is active, check process ID in <lock>
        This program compares a new snapshot with a previous one. When more
        than one instance of this program is active, they use the same files
        to store their new version of the snapshot. Therefore only one 
        instance of scc-log should be active.
        In rare occasions, a system program, called by scc-collect, might hang.
        When that is the case, try to kill the child-processes of scc-collect.
        The lockfile contains the PID of scc-log. When the lock-file exists and
        the process with the PID does not exist, the lockfile is removed and 
        scc-log continues to run. Remove the lockfile only when you are certain
        that scc-collect is not running.

        scc-log: non-numeric argument for -m option: <max>
        Use only numeric arguments for -m option.

EXTERNAL INFLUENCES


        During the pre- and post-install, the existence of the lock-file
        scc.<hostname>.lock is checked to find out whether scc is running.

RETURN VALUE


        Upon completion, the program returns one of the following values:

                0 successful completion
                1 Syntax error
                2 Runtime error

COPYRIGHT


        scc-log is free software under the terms of the GNU General Public 
        License. Copyright (C) 2001-2003 Open Challenge B.V.

FILES


        /var/opt/scc/tmp - directory for temporary files
        /var/opt/scc/data - directory for data files
                scc.<hostname>.cur - current SCC-snapshot
                scc.<hostname>.html - current SCC-snapshot in HTML-format
                scc.<hostname>.old - previous SCC-snapshot
                scc.<hostname>.new - new (temporary) SCC-snapshot
                scc.<hostname>.lock - lockfile to indicate that SCC runs
                scc.<hostname>.log - logbook for changes in SCC-snapshots
                scc.<hostname>.log.html - logbook in HTML-format
                scc.<hostname>.keep - data kept from a previous run
                cfg.log - symbolic link to scc.<hostname>.log
                index.html - compatibility for snapshot on scc-srv
                plugin_data/ - directory with snapshots from plugins

SEE ALSO


        scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1),
        scc-snap2html(1), scc(4), scc(5)

VERSION


        $Revision: 1.73 $



This document was created by man2html using the manual pages.
Time: 08:54:47 GMT, October 29, 2003 scc/scc-run/opt/scc/doc/scc-log2html.html010040000000000000003000000037420774770013000203410ustar00rootsys00000000000000Manpage of scc-log2html

scc-log2html



NAME


        scc-log2html - convert a SCC-logbook to HTML-format

SYNOPSIS


        scc-log2html <name>

DESCRIPTION


        This program reads a SCC-logbook from stdin and converts it to HTML-
        format on stdout. Refer to scc(4) for a detailled description of 
        SCC-logbook.

        The html-file consists of a table with entries for each run of scc.
        For reported differences in the logbook, the menu contains an URL
        pointing to the corresponding report.

ARGUMENTS


        <name>          name of the host to convert the SCC-snapshot for

DIAGNOSTICS


        This program writes the following message to stderr:

        Syntax error, use: scc-log2html <name>
        A syntax error was detected and reported.

RETURN VALUE


        Upon completion, the program returns one of the following values:

                0 successful completion
                1 Syntax error

COPYRIGHT


        scc-log2html is free software under the terms of the GNU General Public 
        License. Copyright (C) 2001-2003 Open Challenge B.V.

FILES


        /var/opt/scc/tmp - directory for temporary files

SEE ALSO


        scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1),
        scc-snap2html(1), scc(4), scc(5)

VERSION


        $Revision: 1.45 $



This document was created by man2html using the manual pages.
Time: 08:54:47 GMT, October 29, 2003 scc/scc-run/opt/scc/doc/scc-plugin.html010040000000000000003000000051360774770013000201060ustar00rootsys00000000000000Manpage of scc-plugin

scc-plugin



NAME


        scc-plugin - template for a user module

SYNOPSIS


        scc-plugin

DESCRIPTION


        This program can be used as a starting point to write user modules
        for SCC. To extend the collection of data by scc-collect, copy this
        script to the directory /opt/scc/bin/scc_modules and name it
        scc_9999_u_NAME, where 9999 is a four-digit number specifying the
        order in which scc-collect executes the modules. Refer to the manual
        page of scc-collect for more details concerning modules.

        Data should be produced on stdout. Refer to scc(4) for a description
        of the layout of the data in a snapshot.

ARGUMENTS


        Use the -a option of scc-collect to provide this module with
        arguments. Another possibility to add dynamic behavior to this script
        is by using the file /etc/opt/scc/conf/scc-localize.

DIAGNOSTICS


        Any errors detected by this program should be produced on stdout
        in the following format:

                fix:messages::<message>

EXAMPLE


        The following code records the DNS-data of our domain:

        sed -e "s/^/fix:network:DNS mycom.com::/" /var/named/db.mycom

        Copy scc-plugin to scc_modules/scc_0500_u_dns and add this code at 
        the end of the new script and run:

                scc -e dns

COPYRIGHT


        scc-plugin is free software under the terms of the GNU General Public 
        License. Copyright (C) 2001-2003 Open Challenge B.V.

FILES


        /opt/scc/bin/scc_modules - directory for modules
        /var/opt/scc/tmp - directory for temporary files
        /var/opt/scc/data - directory for data files
        /var/opt/scc/data/plugin_data - directory checked by scc-log
                for output of modules

SEE ALSO


        scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1),
        scc-snap2html(1), scc(4), scc(5)

VERSION


        $Revision: 1.35 $



This document was created by man2html using the manual pages.
Time: 08:54:47 GMT, October 29, 2003 scc/scc-run/opt/scc/doc/scc-snap2html.html010040000000000000003000000040130774770013000205110ustar00rootsys00000000000000Manpage of scc-snap2html

scc-snap2html



NAME


        scc-snap2html - converts a SCC-snapshot to HTML-format

SYNOPSIS


        scc-snap2html <hostname>

DESCRIPTION


        This program reads a SCC-snapshot from stdin and converts it to 
        HTML-format on stdout. The hierarchical classification in the snapshot
        is converted to a hierarchical menu to the corresponding data. Refer to
        scc(4) for a detailled description of a SCC-snapshot.

        The resulting html-code only contains text and can be viewed with a 
        browser like lynx.

ARGUMENTS


        <name>          name of the host to convert the SCC-snapshot for

DIAGNOSTICS


        This program writes the following message to stderr:

        Syntax error, use: scc-snap2html <name>
        A syntax error was detected and reported.

RETURN VALUE


        Upon completion, the program returns one of the following values:

                0 successful completion
                1 Syntax error

COPYRIGHT


        scc-snap2html is free software under the terms of the GNU General Public
        License. Copyright (C) 2001-2003 Open Challenge B.V.

FILES


        /var/opt/scc/tmp - directory for temporary files

SEE ALSO


        scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1),
        scc-snap2html(1), scc(4), scc(5)

VERSION


        $Revision: 1.46 $



This document was created by man2html using the manual pages.
Time: 08:54:47 GMT, October 29, 2003 scc/scc-run/opt/scc/doc/scc.html010040000000000000003000000235210774770013000166100ustar00rootsys00000000000000Manpage of scc

scc


SYNOPSIS


        scc - collect and send snapshot-files to server

DESCRIPTION


        Run the program scc-log and optionally send the resulting files 
        to the destination. By default the files are sent by email,
        other possibilities are rcp, scp and cp. When scc-log exits
        with an error, no files are transferred.

        The security setup of the server receiving the files is very
        important. Refer to the documentation of scc-srv for the setup
        of the server.

        The collection of scc-data from the system is done by means of
        modules. Two kinds of modules exist, user and system modules. 
        The system modules are installed and run by scc. To extend the
        reach of the snapshots, user modules can be added to collect
        additional data. Refer to scc-collect(1) for more details. To
        run all user modules, use the following command-line:

                scc -e "*"

        When a specific user module requires much time, you can run
        it less frequent. The data from the last run of the module is
        kept in the directory /var/opt/scc/data/plugin_data. Suppose
        you have three user modules, named:

                scc_0550_u_abc
                scc_0650_u_def
                scc_0750_u_ghi

        Where module scc_0650_u_def should be run only once a week,
        while you want scc to run daily. You can use the following
        cronjobs to achieve this:

                0 6 1-6 * * /opt/scc/bin/scc -e "scc_0[57]50_u_"
                0 6 0   * * /opt/scc/bin/scc -e "*"

        You have to use the naming convention and shell filename
        generation wildcards to specify multiple modules to run.

        When stdin is not a terminal, after running scc-log, a random 
        delay is used to sleep before the files are transferred to the
        destination. This avoids flooding the receiving system when all
        your systems start scc at the same time.
        The transferred files are tarred, compressed and uuencoded when
        sent via email. For RedHat, uuencode is part of 
        Applications/Archiving.

        The files to be transferred can be several MB. Check the mail-
        connectivity first by using the -t option. This will send empty files.
        Use the -p option with "smtp" to use the SMTP-protocol directly and
        skip the mail-transport facility of the client.

        Refer to the manual page of scc-log(1) for troubleshooting
        when scc seems to "hang".

        Use the environment variable SCC_PROFILING to add timing data
        to the snapshot. This enables you to locate possible performance
        bottlenecks. By default, this variable is empty and no profiling
        data is added to the snapshot.

SYNTAX


        scc [ -c <remark> ] [ -d <delay> ] [ -e <mod> ] [ -f ] [ -i <smtp> ]
                [ -k <key> ] [ -m <max> ] [ -n ] [ -p <prog> ] [ -s <dest> ]
                [ -t ]

OPTIONS


        -c <remark>     add a remark to the logbook, indicating a "specific" 
                        reason to run scc. To mark the implementation of
                        RFC "123" on a system, use:

                        scc                # record changes up to this moment
                        # perform the tasks required by the RFC
                        scc -c "RFC 123"   # record changes due to RFC

        -d <delay>      maximum delay (in seconds) to wait before the files are
                        transmitted to <dest>. Default delay is 300 seconds.
        -e <mod>        scc-collect runs user module <mod> when collecting data.
        -f              Use the full qualified name, not the short hostname,
                        when sending files to the SCC server. On the SCC client,
                        all filenames contain the short hostname only.
        -i <smtp>       SMTP-server to connect to when using "-p smtp"
        -k <key>        file containing public key of scc-server; used to
                        encrypt the data that is sent via mail/smtp.
        -m <max>        entries in the log-file, that are older than <max>
                        months, are deleted
        -n              Do not collect new SCC-data. Sent the files right away.
        -p <prog>       use <prog> to send the files, default value is mail,
                        other values are:
                        cp      copy to local directory <dest>
                        rcp     remote-copy to scc-server
                        scp     SSH-copy to scc-server
                        smtp    use SMTP to connect directly to port 25 of 
                                host-part of <dest> or to <smtp> of -i option.
        -s <dest>       Destination to send the files to:
                        cp              local directory: /var/opt/scc/data
                        mail|smtp       email-address: scc-transfer@myserver.com
                        rcp|scp         destination: <user>@myserver.com:<dir>
                                        the <user> and <dir> parts are optional
        -t              test connectivity by sending empty files, no delay is
                        used

ARGUMENTS


        None.

DIAGNOSTICS


        The program issues the following messsages to stderr:

        Syntax error, use: scc [ -c <remark> ] [ -d <delay> ] [ -e <mod> ]
                [ -f ] [ -i <smtp> ] [ -k <key> ] [ -m <max> ] [ -n ]
                [ -p <prog> ] [ -s <dest> ] [ -t ]
        A syntax error has been detected and reported.

        scc: non-numeric interval
        A non-numeric value has been specified for <delay>.

        scc: non-numeric argument for -m option: <max>
        Use only numeric arguments for -m option.

        scc: -p option must be used prior to -s option
        As the interpretation of the argument of the -s option depends upon the
        argument of the -p option, the -p option cannot be used after the -s 
        option.

        scc: unknown transfer-method: <prog>
        The argument of the -p option has an unsupported value.

        scc: uuencode not found
        This program is used to sent the snapshot through email. On RedHat
        it is part of: Applications/Archiving.

        scc: openssl not found
        This program is used when the -k option is used to encrypt the data to 
        be sent via email. When openssl is not found in PATH, no data is sent.

RETURN VALUE


        Upon completion, the program returns one of the following values:

                0 successful completion
                1 Syntax error
                2 Runtime error

EXAMPLES


        To take a daily snapshot and transfer the files to myserver, use a 
        cronjob like:

           0 23 * * * /opt/scc/bin/scc -s scc-transfer@mysrv.mydom

        This runs scc-log daily and transfers the files to mysrv. On mysrv 
        the alias file should contain a line like:

           scc-transfer: "|/opt/scc-srv/bin/scc-receive-mail                                    /var/opt/scc-srv/transfer"

        Refer to the manual page scc-srv(5) for the proper setup of the
        server part of SCC.

EXTERNAL INFLUENCES


        The names of the files that are sent to the scc-server, must be
        known in the server-software also: scc-transfer.gz, scc-transfer.Z
        or scc-transfer depending on the presence of compression software.
        Refer to the manual page scc-srv(5) for the setup of the scc-server.

        This program uses gzip or compress to compress the data.
        It uses uuencode to transfer the data through email.

COPYRIGHT


        scc is free software under the terms of the GNU General Public 
        License. Copyright (C) 2001-2003 Open Challenge B.V.

FILES


        /var/opt/scc/data - directory for data files
                scc.<hostname>.cur - current SCC-snapshot
                scc.<hostname>.html - current SCC-snapshot in HTML-format
                scc.<hostname>.log - logbook for changes in SCC-snapshots
                scc.<hostname>.log.html - logbook in HTML-format
        The filename on the scc-server is: scc.<hostname>.tar.gz When
        gzip is not found, compress is used and ".gz" is changed in ".Z".
        When compress is also not found, cat is used and ".gz" is removed
        from the filename. When the -f option is used, the DNS-domain is
        added to the remote filenames.
        When rcp/scp are used, the file scc.<hostname>.signal is used to
        indicate the completed transfer of the scc-data on the server.

SEE ALSO


        scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1),
        scc-snap2html(1), scc(4), scc(5)

VERSION


        $Revision: 1.44 $



This document was created by man2html using the manual pages.
Time: 08:54:47 GMT, October 29, 2003 scc/scc-run/opt/scc/man/004070000000000000003000000000003777777777700152255ustar00rootsys00000000000000scc/scc-run/opt/scc/man/man1/004070000000000000003000000000003777777777700160615ustar00rootsys00000000000000scc/scc-run/opt/scc/man/man1/scc-collect.1010040000000000000003000000134030774770013000202670ustar00rootsys00000000000000.TA t .TH scc-collect 1 "SCC" .nf .SH NAME .nf scc-collect - collect system configuration in a SCC-snapshot .SH SYNOPSIS .nf scc-collect [ -a ] [ -e ] [ -i ] .SH DESCRIPTION .nf This program collects configuration data from a system and writes it to stdout as a SCC-snapshot. A snapshot is a file containing configuration data. Each line of configuration-data is prefixed with a classification. Refer to scc(4) for a detailed description of the format of the contents of a snapshot. Part of the classification is an indicator whether the data is fixed or variable. This makes it possible to compare snapshots and report any difference in the configuration data that was supposed to be fixed. The entire process of creating a new snapshot, comparing it with the previous one and adding the differences to a logbook is done by scc-log(1). The collection of configuration data is performed by means of modules, located in directory /opt/scc/bin/scc_modules. There are two kinds of modules: system and user. The distinction is made by means of the names: scc_9999_s_ and scc_9999_u_. Where 9999 stands for a four digit number used to determine the order of the execution of the modules. The _s_ and _u_ indicate the system and user modules. When a system and user module use the same four-digit number, the system module is executed first. System modules are distributed by scc. Each site can extend the functionality of SCC by adding user modules. Modules can be executed separately when the -i option is used. In that case, the resulting data goes to stdout. Without the -i option, all system modules and the specified user modules are run, leaving their data in the file /var/opt/scc/data/plugin_data/. In that case the output of scc-collect is the output of all system modules and all plugin-data. When a user module requires additional arguments, the -a option can be used. Note that each started user module is started with these arguments. When the code of a user module changes, scc-collect automatically ignores any changes in the scc-data of this module on the next run of the user-module. To test module scc_1234_u_abc, use the following steps: - run the user-module to catch possible changes: scc -e scc_1234_u_abc - change the user-module - test the user-module: scc-collect -i -e scc_1234_u_abc - rerun the user-module and store the output: scc -e scc_1234_u_abc Note: when you change a user-module without running it, you will loose all changes (for the module) that were made before the next run. .SH ARGUMENTS .nf None. .SH OPTIONS .nf -a Start each user module with argument . -e Run only module . Refer to the DESCRIPTION section for a detailed description of modules. can contain shell filename wildcards. To find the matching modules, the program searches for **. -i Run the program interactively. Without this option, the program only runs when stdin is a tty. .SH EXAMPLES .nf To execute all user modules, specifiy: scc-collect -i -e "scc_????_u_". To execute only the kernel system module, named scc_0300_s_kernel, specify: scc-collect -i -e kernel .SH EXTERNAL INFLUENCES .nf The HP Support Tools Manager (stm) is not called when the environment variable SCC_IGNORE_STM is set. During install by SD-UX, it is set to avoid running stm. RPM is locked during installation of SCC, ignore rpm during installs of SCC. The install-scripts set the environment variable SCC_INSTALL_PHASE. Use the environment variable SCC_PROFILING to add timing data to the snapshot. This enables you to locate possible performance bottlenecks. By default, this variable is empty and no profiling data is added to the snapshot. The profile data has classification: "var:profiling::" .SH DIAGNOSTICS .nf This program writes the following messages to stderr: Syntax error, use: scc-collect [ -a ] [ -e ] [ -i ] A syntax error has been detected and reported. scc-collect: use -i option to run interactive scc-collect: only root should run this program Log in as root to run this program. scc-collect: non-executable module: Correct the permissions of the module in the directory /opt/scc/bin/scc_modules. scc-collect: missing data for module: The file /var/opt/scc/data/plugin_data/ is missing. Run the module with the -m option to generate the datafile. .SH RETURN VALUE .nf Upon completion, the program returns one of the following values: 0 successful completion 2 runtime error .SH COPYRIGHT .nf scc-collect is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V. .SH FILES .nf /opt/scc/bin/scc_modules - directory with modules scc_utils - utilities for modules scc_[0-9][0-9][0-9][0-9]_s_* modules distributed with scc and always executed scc_[0-9][0-9][0-9][0-9]_u_* user plugins, only executed with -u option they leave their output in the file: /var/opt/scc/data/plugin_data/ /var/opt/scc/tmp - directory for temporary files /var/opt/scc/data - directory for data files scc..cur - current SCC-snapshot scc..html - current SCC-snapshot in HTML-format scc..old - previous SCC-snapshot scc..new - new (temporary) SCC-snapshot scc..log - logbook for changes in SCC-snapshot scc..log.html - logbook in HTML-format scc..keep - data kept from a previous run .SH SEE ALSO .nf scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5) .SH VERSION .nf $Revision: 1.154 $ scc/scc-run/opt/scc/man/man1/scc-log.1010040000000000000003000000122070774770013000174240ustar00rootsys00000000000000.TA t .TH scc-log 1 "SCC" .nf .SH NAME .nf scc-log - create a SCC-snapshot and compare with previous snapshot .SH SYNOPSIS .nf scc-log [ -c ] [ -e ] [ -m ] [ -r | -u ] .SH DESCRIPTION .nf This program calls scc-collect to create a SCC-snapshot and compares it with a previous snapshot. Additional snapshots, created by plugins, are added. All differences are added to a logbook. Running the plugins is the reponsibility of the administrator. The snapshots generated by the plugins are expected in directory /var/opt/scc/data/plugin_data The contents of the snapshots generated by the plugins are tested to check their format. Lines with unknown formats are prefixed with the classification: "fix:messages::". The classication of valid lines is extended with ":plugin::". Finally, both the new snapshot and the logbook are also written in HTML-format. Refer to scc(4) for a detailed description of the format of the snapshots and logbooks. In rare occasions, scc-collect "hangs". Use the following command to find the childprocesses of scc: UNIX95= ps -Hef This will show you the entire process-tree. On Solaris, you can use the ptree command from the proctools. Find the "deepest" descendant from scc-collect and kill this process. Then issue the command again to monitor the progress of scc-collect. On abnormal termination of scc-collect, the new snapshot probably is incomplete. When the cause of the problem is removed, a new run of scc can be started. This leads to large differences with the new, complete snapshot. To avoid this, use the -r option of scc-log to remove the current snapshot before making a new one. When the abnormal termination of scc-collect was not detected, the next run of scc will add many differences to the logbook. To reduce the size of the logbook, the logfile can be edited by hand and the differences can be deleted. .SH LIMITATIONS .nf As the rpm-database is locked during the install of scc, the snapshot made during the install does not contain any rpm-data. The next time scc is run after the install, it will record the rpm-data in the snapshot. This added rpm-data will not be mentioned in the logbook. Any further changes in the rpm-data will be added to the logbook. .SH ARGUMENTS .nf None. .SH OPTIONS .nf -c add a remark to the logbook, indicating a "specific" reason to run scc. For instance to mark the successfull configuration/change of a system. -e scc-collect runs user module when collecting data. -m entries in the log-file, that are older than months, are deleted -r remove the current snapshot to avoid comparing it with the new (incompatible/incomplete) shapshot. -u remove all snapshots, logbooks en html-files and exit .SH DIAGNOSTICS .nf This program writes the following messages to stderr: Syntax error, use: scc-log [ -c ] [ -e ] [ -m ] [ -r | -u ] A syntax error has been detected and reported. scc-log: another instance is active, check process ID in This program compares a new snapshot with a previous one. When more than one instance of this program is active, they use the same files to store their new version of the snapshot. Therefore only one instance of scc-log should be active. In rare occasions, a system program, called by scc-collect, might hang. When that is the case, try to kill the child-processes of scc-collect. The lockfile contains the PID of scc-log. When the lock-file exists and the process with the PID does not exist, the lockfile is removed and scc-log continues to run. Remove the lockfile only when you are certain that scc-collect is not running. scc-log: non-numeric argument for -m option: Use only numeric arguments for -m option. .SH EXTERNAL INFLUENCES .nf During the pre- and post-install, the existence of the lock-file scc..lock is checked to find out whether scc is running. .SH RETURN VALUE .nf Upon completion, the program returns one of the following values: 0 successful completion 1 Syntax error 2 Runtime error .SH COPYRIGHT .nf scc-log is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V. .SH FILES .nf /var/opt/scc/tmp - directory for temporary files /var/opt/scc/data - directory for data files scc..cur - current SCC-snapshot scc..html - current SCC-snapshot in HTML-format scc..old - previous SCC-snapshot scc..new - new (temporary) SCC-snapshot scc..lock - lockfile to indicate that SCC runs scc..log - logbook for changes in SCC-snapshots scc..log.html - logbook in HTML-format scc..keep - data kept from a previous run cfg.log - symbolic link to scc..log index.html - compatibility for snapshot on scc-srv plugin_data/ - directory with snapshots from plugins .SH SEE ALSO .nf scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5) .SH VERSION .nf $Revision: 1.73 $ scc/scc-run/opt/scc/man/man1/scc-log2html.1010040000000000000003000000023410774770013000203710ustar00rootsys00000000000000.TA t .TH scc-log2html 1 "SCC" .nf .SH NAME .nf scc-log2html - convert a SCC-logbook to HTML-format .SH SYNOPSIS .nf scc-log2html .SH DESCRIPTION .nf This program reads a SCC-logbook from stdin and converts it to HTML- format on stdout. Refer to scc(4) for a detailled description of SCC-logbook. The html-file consists of a table with entries for each run of scc. For reported differences in the logbook, the menu contains an URL pointing to the corresponding report. .SH ARGUMENTS .nf name of the host to convert the SCC-snapshot for .SH DIAGNOSTICS .nf This program writes the following message to stderr: Syntax error, use: scc-log2html A syntax error was detected and reported. .SH RETURN VALUE .nf Upon completion, the program returns one of the following values: 0 successful completion 1 Syntax error .SH COPYRIGHT .nf scc-log2html is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V. .SH FILES .nf /var/opt/scc/tmp - directory for temporary files .SH SEE ALSO .nf scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5) .SH VERSION .nf $Revision: 1.45 $ scc/scc-run/opt/scc/man/man1/scc-plugin.1010040000000000000003000000034340774770013000201430ustar00rootsys00000000000000.TA t .TH scc-plugin 1 "SCC" .nf .SH NAME .nf scc-plugin - template for a user module .SH SYNOPSIS .nf scc-plugin .SH DESCRIPTION .nf This program can be used as a starting point to write user modules for SCC. To extend the collection of data by scc-collect, copy this script to the directory /opt/scc/bin/scc_modules and name it scc_9999_u_NAME, where 9999 is a four-digit number specifying the order in which scc-collect executes the modules. Refer to the manual page of scc-collect for more details concerning modules. Data should be produced on stdout. Refer to scc(4) for a description of the layout of the data in a snapshot. .SH ARGUMENTS .nf Use the -a option of scc-collect to provide this module with arguments. Another possibility to add dynamic behavior to this script is by using the file /etc/opt/scc/conf/scc-localize. .SH DIAGNOSTICS .nf Any errors detected by this program should be produced on stdout in the following format: fix:messages:: .SH EXAMPLE .nf The following code records the DNS-data of our domain: sed -e "s/^/fix:network:DNS mycom.com::/" /var/named/db.mycom Copy scc-plugin to scc_modules/scc_0500_u_dns and add this code at the end of the new script and run: scc -e dns .SH COPYRIGHT .nf scc-plugin is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V. .SH FILES .nf /opt/scc/bin/scc_modules - directory for modules /var/opt/scc/tmp - directory for temporary files /var/opt/scc/data - directory for data files /var/opt/scc/data/plugin_data - directory checked by scc-log for output of modules .SH SEE ALSO .nf scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5) .SH VERSION .nf $Revision: 1.35 $ scc/scc-run/opt/scc/man/man1/scc-snap2html.1010040000000000000003000000024110774770013000205470ustar00rootsys00000000000000.TA t .TH scc-snap2html 1 "SCC" .nf .SH NAME .nf scc-snap2html - converts a SCC-snapshot to HTML-format .SH SYNOPSIS .nf scc-snap2html .SH DESCRIPTION .nf This program reads a SCC-snapshot from stdin and converts it to HTML-format on stdout. The hierarchical classification in the snapshot is converted to a hierarchical menu to the corresponding data. Refer to scc(4) for a detailled description of a SCC-snapshot. The resulting html-code only contains text and can be viewed with a browser like lynx. .SH ARGUMENTS .nf name of the host to convert the SCC-snapshot for .SH DIAGNOSTICS .nf This program writes the following message to stderr: Syntax error, use: scc-snap2html A syntax error was detected and reported. .SH RETURN VALUE .nf Upon completion, the program returns one of the following values: 0 successful completion 1 Syntax error .SH COPYRIGHT .nf scc-snap2html is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V. .SH FILES .nf /var/opt/scc/tmp - directory for temporary files .SH SEE ALSO .nf scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5) .SH VERSION .nf $Revision: 1.46 $ scc/scc-run/opt/scc/man/man1/scc.1010040000000000000003000000170550774770013000166530ustar00rootsys00000000000000.TA t .TH scc 1 "SCC" .nf .SH SYNOPSIS .nf scc - collect and send snapshot-files to server .SH DESCRIPTION .nf Run the program scc-log and optionally send the resulting files to the destination. By default the files are sent by email, other possibilities are rcp, scp and cp. When scc-log exits with an error, no files are transferred. The security setup of the server receiving the files is very important. Refer to the documentation of scc-srv for the setup of the server. The collection of scc-data from the system is done by means of modules. Two kinds of modules exist, user and system modules. The system modules are installed and run by scc. To extend the reach of the snapshots, user modules can be added to collect additional data. Refer to scc-collect(1) for more details. To run all user modules, use the following command-line: scc -e "*" When a specific user module requires much time, you can run it less frequent. The data from the last run of the module is kept in the directory /var/opt/scc/data/plugin_data. Suppose you have three user modules, named: scc_0550_u_abc scc_0650_u_def scc_0750_u_ghi Where module scc_0650_u_def should be run only once a week, while you want scc to run daily. You can use the following cronjobs to achieve this: 0 6 1-6 * * /opt/scc/bin/scc -e "scc_0[57]50_u_" 0 6 0 * * /opt/scc/bin/scc -e "*" You have to use the naming convention and shell filename generation wildcards to specify multiple modules to run. When stdin is not a terminal, after running scc-log, a random delay is used to sleep before the files are transferred to the destination. This avoids flooding the receiving system when all your systems start scc at the same time. The transferred files are tarred, compressed and uuencoded when sent via email. For RedHat, uuencode is part of Applications/Archiving. The files to be transferred can be several MB. Check the mail- connectivity first by using the -t option. This will send empty files. Use the -p option with "smtp" to use the SMTP-protocol directly and skip the mail-transport facility of the client. Refer to the manual page of scc-log(1) for troubleshooting when scc seems to "hang". Use the environment variable SCC_PROFILING to add timing data to the snapshot. This enables you to locate possible performance bottlenecks. By default, this variable is empty and no profiling data is added to the snapshot. .SH SYNTAX .nf scc [ -c ] [ -d ] [ -e ] [ -f ] [ -i ] [ -k ] [ -m ] [ -n ] [ -p ] [ -s ] [ -t ] .SH OPTIONS .nf -c add a remark to the logbook, indicating a "specific" reason to run scc. To mark the implementation of RFC "123" on a system, use: scc # record changes up to this moment # perform the tasks required by the RFC scc -c "RFC 123" # record changes due to RFC -d maximum delay (in seconds) to wait before the files are transmitted to . Default delay is 300 seconds. -e scc-collect runs user module when collecting data. -f Use the full qualified name, not the short hostname, when sending files to the SCC server. On the SCC client, all filenames contain the short hostname only. -i SMTP-server to connect to when using "-p smtp" -k file containing public key of scc-server; used to encrypt the data that is sent via mail/smtp. -m entries in the log-file, that are older than months, are deleted -n Do not collect new SCC-data. Sent the files right away. -p use to send the files, default value is mail, other values are: cp copy to local directory rcp remote-copy to scc-server scp SSH-copy to scc-server smtp use SMTP to connect directly to port 25 of host-part of or to of -i option. -s Destination to send the files to: cp local directory: /var/opt/scc/data mail|smtp email-address: scc-transfer@myserver.com rcp|scp destination: @myserver.com: the and parts are optional -t test connectivity by sending empty files, no delay is used .SH ARGUMENTS .nf None. .SH DIAGNOSTICS .nf The program issues the following messsages to stderr: Syntax error, use: scc [ -c ] [ -d ] [ -e ] [ -f ] [ -i ] [ -k ] [ -m ] [ -n ] [ -p ] [ -s ] [ -t ] A syntax error has been detected and reported. scc: non-numeric interval A non-numeric value has been specified for . scc: non-numeric argument for -m option: Use only numeric arguments for -m option. scc: -p option must be used prior to -s option As the interpretation of the argument of the -s option depends upon the argument of the -p option, the -p option cannot be used after the -s option. scc: unknown transfer-method: The argument of the -p option has an unsupported value. scc: uuencode not found This program is used to sent the snapshot through email. On RedHat it is part of: Applications/Archiving. scc: openssl not found This program is used when the -k option is used to encrypt the data to be sent via email. When openssl is not found in PATH, no data is sent. .SH RETURN VALUE .nf Upon completion, the program returns one of the following values: 0 successful completion 1 Syntax error 2 Runtime error .SH EXAMPLES .nf To take a daily snapshot and transfer the files to myserver, use a cronjob like: 0 23 * * * /opt/scc/bin/scc -s scc-transfer@mysrv.mydom This runs scc-log daily and transfers the files to mysrv. On mysrv the alias file should contain a line like: scc-transfer: "|/opt/scc-srv/bin/scc-receive-mail \ /var/opt/scc-srv/transfer" Refer to the manual page scc-srv(5) for the proper setup of the server part of SCC. .SH EXTERNAL INFLUENCES .nf The names of the files that are sent to the scc-server, must be known in the server-software also: scc-transfer.gz, scc-transfer.Z or scc-transfer depending on the presence of compression software. Refer to the manual page scc-srv(5) for the setup of the scc-server. This program uses gzip or compress to compress the data. It uses uuencode to transfer the data through email. .SH COPYRIGHT .nf scc is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V. .SH FILES .nf /var/opt/scc/data - directory for data files scc..cur - current SCC-snapshot scc..html - current SCC-snapshot in HTML-format scc..log - logbook for changes in SCC-snapshots scc..log.html - logbook in HTML-format The filename on the scc-server is: scc..tar.gz When gzip is not found, compress is used and ".gz" is changed in ".Z". When compress is also not found, cat is used and ".gz" is removed from the filename. When the -f option is used, the DNS-domain is added to the remote filenames. When rcp/scp are used, the file scc..signal is used to indicate the completed transfer of the scc-data on the server. .SH SEE ALSO .nf scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5) .SH VERSION .nf $Revision: 1.44 $ scc/scc-run/opt/scc/man/man4/004070000000000000003000000000003777777777700160645ustar00rootsys00000000000000scc/scc-run/opt/scc/man/man4/scc.4010040000000000000003000000123620774770013000166550ustar00rootsys00000000000000.TA t .TH scc 4 "SCC" .nf .SH NAME .p scc - file formats used by SCC .SH DESCRIPTION .p SCC stores configuration data from systems in flat files called snapshots. All configuration data is structured by prefixing it with a fixed-variable indication and with a hierarchial classification. The indication, all elements of the classification and the configuraton data are separated by colon's. .p By comparing two consecutive snapshots and ignoring the variable data, we are able to maintain a logbook of a system. Lines in the logbook also consist of colon separated fields. .SH SNAPSHOTS .p The contents of the file /var/adm/cron/cron.allow are stored in a snapshot in the following way: .nf fix:software:cron:configuration::/var/adm/cron/cron.allow:root fix:software:cron:configuration::/var/adm/cron/cron.allow:adm fix:software:cron:configuration::/var/adm/cron/cron.allow:uucp .fi .p After the indicator "fix" for fixed data there are at most five levels of hierarchical classifications of the remaining data. The classification and the data are separated by two consecutive colons. .p When this file is altered (uucp should not run cron-jobs), the reported data contains the change itself (uucp) and the classification of the altered data (software:cron:configuration::/var/adm/cron/cron.allow:). Without the classification SCC only could have reported that a user has been removed. .SH CLASSIFICATIONS .p The output of scc-collect is checked by scc-log. Any line that does not start with "fix:" of "var:" is prefixed with "fix:messages::", indicating unexpected output from one of the commands used by scc-collect. As the html-file groups data per classification, the original snapshot has to be inspected to locate the commands causing this output. .p The snapshot is converted to a hierarchical menu. Therefore the following combination of classifications cannot be used: .nf fix:software:myprogram:: fix:software:myprogram:config:: .fi .p The first classification results in html-code to access "myprogram" as an option in the sub-menu "software". The second classification should result in html-code to access a sub-menu "myprogram" containing the option "config". .p It is the responsibility of the developer to ensure a correct menu-structure by using the correct classifications in scc-collect and in the plugins. .SH LOGBOOK .p Two consecutive snapshots are compared using diff(1). The resulting output is altered to indicate the old and the new configuration. When the user uucp is removed from cron.allow, the following data is added to the logbook: .nf 2001-09-12:11.18.46:result::different 2001-09-12:11.18.46:remark:: 2001-09-12:11.18.46:count::1 2001-09-12:11.18.46:previous date::2001-09-08 2001-09-12:11.18.46:previous time::07.37.46 2001-09-12:11.18.46:data::old::software:cron:configuration:: /var/adm/cron/cron.allow:uucp .fi .p For clarity the last line has been folded. .p Again we see colon separated fields. The first fields indicate the date and time of the change. Then there is a classification of the remaining fields, separated by two, consecutive colons from the differences. The classification is limited to: result, remark, count, previous date, previous time and data. .p After reporting the result and some administrativia, finally the actual change is reported. The keyword old indicated that this data was only present in the old snapshot. So it has been removed from the current configuration of the system. .SH CLASS .p A class-file contains lines with (parts of) classifications. When they are not present, colons are added in front and at the end of each classification. Lines starting with '#' are treated as comments. To extract the boot configuration and start/stop links out a snapshot, use the following class-file: .nf boot:config: boot:rc-file: .fi .p Class-files are used by scc-baseline(1) and scc-syscmp(1). Check the snapshots to determine the classifications to be extracted from the snapshot. .SH KEEP-FILE .p The keep-file is used to store data that is obtained from running processes, that might not be running during the next run of scc. To avoid changes in the logbook any time such a proces temporarily does not run, the obtained data is stored in a keep-file. scc-collect uses the data in this file when the processes are not running. Examples of the data in the keep-file are apache-configuration data and rpm-data. The latter data should be recorded in the keep-file as the rpm-database is locked during installs and rpm does not return any data when it is queried during an install. .p The format of the keep-file looks like the format of the snapshots. It consists of lines with colon-separated fields. Leading fields are used to identify the data. The contents of the keep-file are determined by scc-collect. .p The keep-file is removed during the installation of SCC to enable upgrades of the format of this file. This results in the "feature" that SCC is unable to record it's own upgrade on a RPM-system. .SH COPYRIGHT .p SCC is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V. .SH SEE ALSO .nf scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5) .fi .SH VERSION .p $Revision: 1.17 $ scc/scc-run/opt/scc/man/man5/004070000000000000003000000000003777777777700160655ustar00rootsys00000000000000scc/scc-run/opt/scc/man/man5/scc.5010040000000000000003000000135250774770013000166610ustar00rootsys00000000000000.TA t .TH scc 5 "SCC" .nf .SH NAME .p scc - introduction SCC .SH DESCRIPTION .p System Configuration Collector is yet another configuration collector. Just like the other collectors it collects configuration data on Unix systems. The difference is that each line of collected data is extended with a hierarchical classification of the nature of the data and with an indicator whether that data is supposed to be static or dynamic. For example: the size of a filesystem is static data and the current usage is dynamic data. Consecutive collections of configuration data (snapshots) are compared and differences in the static data are added to a logbook. Filling a filesystem will not be reported in the logbook, but the extension of a filesystem will be. Additional software converts the snapshot and logbook to html-format. .p The classification of the data is a hierarchy with the following top-level items (among others): .br - general .br - boot .br - hardware .br - kernel .br - network .br - software .br - system .br - users .p Development of SCC started for HP-UX and later shifted to Solaris and Linux. At the moment most of the Operating System configuration of HP-UX is collected. Additional configuration is collected for OS-addons like MCServiceGuard and OmniBack. .SH INSTALLATION .p SCC is available as HPUX depot, Solaris package, RPM and soure tar-ball. The software is NOT relocatable and installs in /opt/scc/bin. Data- and temporary files are located in /var/opt/scc. .p During the pre-install phase, the software runs a possibly installed version of SCC. All changes on the system up to the moment of installation are collected in the logbook. During the post-install phase, the software removes the current snapshot (made by the previous version of SCC) and starts the new version of SCC. This means that SCC does not compare two possibly incompatible snapshots, avoiding flooding the logbook. .p This means that the installation may take some time (typically less than 5 minutes). On a moderate pentium with RedHat 6.2, SCC completed a run within a minute. On an old and overloaded HP-UX server, it was reorganizing its database, two runs of SCC took 45 minutes to complete. .p To install release 1.3.29 on HP-UX, use the commands: .nf swinstall -s $(pwd)/scc-1.3.29.hpux-1x.depot scc .fi To register this file as a depot, use the command: .nf swreg -l depot $(pwd)/scc-1.3.29.hpux-1x.depot .fi To add this file to an existing depot, use the command: .nf swcopy -s $(pwd)/scc-1.3.29.hpux-1x.depot scc @/your/depot .fi To install release 1.3.29 of the SunOS package, use the commands: .nf pkgadd -d ./scc-1.3.29.sunos.pkg -a none scc .fi You will be prompted for the execution of the pre/post-install scripts. To install release 1.3.29 of the RPM package, use the commands: .nf rpm -U ./scc-1.3-29.rpm .fi .SH PROGRAMS .p The programs of SCC have the following relationship: .p scc: main program .br this program calls scc-log and sends data to the SCC-server. .br scc-log: this program calls: .br - scc-collect: collect all data by calling modules in scc_modules .br - compare new and old snapshots, add differences to logbook .br - scc-snap2html: convert snapshot to HTML .br - scc-log2html: convert logbook to HTML .p Previous versions of SCC contained the programs scc-baseline and scc-syscmp to compare (parts of) snapshots. This functionality is moved to the scc-srv. These programs are removed from the distribution and from the systems when the new version of SCC is installed. .SH USING SCC .p After the installation, the data is available in directory .I /var/opt/scc/data. The file .I scc..log contains the logbook and the file .I scc..cur contains the current snapshot. .p To run SCC again, just start .I /opt/scc/bin/scc. To keep an accurate logbook of your system, you can schedule it with cron: .nf 0 6 * * * /opt/scc/bin/scc .fi .p Any errors produced by programs called by scc-collect, appear under the classification "messages". Most of the times they indicate some hardware or software error on the system. Running SCC is some kind of a healthcheck for your system. .p It is possible to send your SCC-data (snapshots, logbooks and the html-files) to a server running the server-software of SCC (scc-srv). Before you send your data to a server, you have to prepare the server by installing scc-srv and configuring the server. On the server, summaries of the SCC-data are generated and all data is accessible through a web-interface. .p To mark the completion of certain changes, use the .I -c option of .B scc(1). To mark changes in the snapshot when implementing a RFC, use the following commands: .nf scc # record changes up to this moment # perform the tasks required by the RFC scc -c "RFC 123" # record changes due to RFC .fi .SH EXTENDING SCC .p .B scc-collect(1) collects OS and OS-related configuration data. It does not collect specific application data. To extend the snapshots, refer to the manual page of .B scc-plugin(1). It offers a starting point to collect other configuration data. .p Refer to the manual page of scc-collect(1) and scc(1) for a more detailed description of the use of modules. .SH SECURITY .p As the programs of SCC must run as root to obtain all the necessary configuration data, the environment of SCC must be well protected. This is accomplished by creating separate directories for the data and programs of SCC and properly securing them. .p Therefore SCC is not relocatable during installation. As only root should run these programs there is no need for ordinary users to put the SCC-directory in their PATH. .SH COPYRIGHT .p SCC is free software under the terms of the GNU General Public License. Copyright (C) 2001-2003 Open Challenge B.V. .SH SEE ALSO .nf scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5) .SH VERSION .p $Revision: 1.15 $ scc/scc-run/var/opt/004070000000000000003000000000003777777777700144725ustar00rootsys00000000000000scc/scc-run/var/opt/scc/004070000000000000003000000000003777777777700152425ustar00rootsys00000000000000scc/scc-run/var/opt/scc/data/004070000000000000003000000000003777777777700161535ustar00rootsys00000000000000scc/scc-run/var/opt/scc/data/plugin_data/004070000000000000003000000000003777777777700204425ustar00rootsys00000000000000scc/scc-run/var/opt/scc/tmp/004070000000000000003000000000003777777777700160425ustar00rootsys00000000000000