catalog/INDEX010064400000000000003000000013641167241765500131410ustar00rootsys00000000000000distribution layout_version 1.0 data_model_revision 2.40 uuid 86263b2a-2739-11e1-bd4d-f4ce46f5cede mod_time 1323966381 create_time 1323966381 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.17.23 title "System Configuration Collector" description "System Configuration Collector" mod_time 1323966381 create_time 1323966381 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 758302 revision 1.17.23 title "System Configuration Collector" description "System Configuration Collector" mod_time 1323966381 create_time 1323966381 state available catalog/dfiles/INDEX010064400000000000003000000003011167241765500143750ustar00rootsys00000000000000distribution layout_version 1.0 data_model_revision 2.40 uuid 86263b2a-2739-11e1-bd4d-f4ce46f5cede mod_time 1323966381 create_time 1323966381 path_max 255 name_max 100 media sequence_number 1 catalog/dfiles/INFO010064400000000000003000000002121167241765500142620ustar00rootsys00000000000000control_file path INDEX size 132 mode 0444 mtime 1323966381 tag INDEX control_file path INFO size 198 mode 0444 mtime 1323966381 tag INFO catalog/scc/pfiles/INDEX010044400000000000003000000004621167241765500151670ustar00rootsys00000000000000product tag scc data_model_revision 2.40 instance_id 1 control_directory scc revision 1.17.23 title "System Configuration Collector" description "System Configuration Collector" mod_time 1323966381 create_time 1323966381 os_name HP-UX os_release ?.1?.* directory / all_filesets scc-run is_locatable false catalog/scc/pfiles/INFO010044400000000000003000000002121167241765500150440ustar00rootsys00000000000000control_file path INDEX size 306 mode 0444 mtime 1323966381 tag INDEX control_file path INFO size 198 mode 0444 mtime 1323966381 tag INFO catalog/scc/scc-run/INDEX010044400000000000003000000004011167241765500152500ustar00rootsys00000000000000fileset tag scc-run data_model_revision 2.40 instance_id 1 control_directory scc-run size 758302 revision 1.17.23 title "System Configuration Collector" description "System Configuration Collector" mod_time 1323966381 create_time 1323966381 state available catalog/scc/scc-run/INFO010044400000000000003000000177611167241765500151550ustar00rootsys00000000000000control_file path INDEX size 257 mode 0444 mtime 1323966381 tag INDEX control_file path INFO size 8236 mode 0444 mtime 1323966381 tag INFO control_file path postinstall size 2354 cksum 2983585173 mode 0544 mtime 1323890205 tag postinstall control_file path postremove size 1691 cksum 2704626191 mode 0544 mtime 1323890206 tag postremove control_file path preinstall size 2777 cksum 2918774267 mode 0544 mtime 1323890205 tag preinstall file path /etc/opt type d mode 0755 uid 0 gid 3 owner root group sys file path /etc/opt/scc type d mode 0755 uid 0 gid 3 owner root group sys file path /etc/opt/scc/conf type d mode 0755 uid 0 gid 3 owner root group sys file path /etc/opt/scc/newconfig type d mode 0755 uid 0 gid 3 owner root group sys file path /etc/opt/scc/newconfig/scc-localize type f size 7374 cksum 1416885755 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890205 file path /etc/opt/scc/newconfig/scc-split.conf type f size 3251 cksum 2890306699 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890205 file path /etc/opt/scc/newconfig/style.css type f size 1315 cksum 15588194 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890205 file path /opt type d mode 0755 uid 0 gid 3 owner root group sys file path /opt/scc type d mode 0755 uid 0 gid 3 owner root group sys file path /opt/scc/bin type d mode 0755 uid 0 gid 3 owner root group sys file path /opt/scc/bin/scc type f size 17459 cksum 1651875359 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc-cmp type f size 8700 cksum 3046445536 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/bin/scc-collect type f size 12654 cksum 4148644057 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/bin/scc-log type f size 25140 cksum 2951306495 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/bin/scc-log2html type f size 12301 cksum 88343066 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/bin/scc-plugin type f size 2836 cksum 633354953 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc-snap2html type f size 19209 cksum 2209004064 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules type d mode 0755 uid 0 gid 3 owner root group sys file path /opt/scc/bin/scc_modules/scc_0000_s_general type f size 14389 cksum 539292676 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0100_s_boot type f size 15915 cksum 137567690 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0200_s_hardware type f size 57087 cksum 3438521049 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0300_s_kernel type f size 14387 cksum 3781204989 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0400_s_vol_mngt type f size 47701 cksum 2589242415 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0500_s_network type f size 46986 cksum 2588407815 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0500_u_named type f size 4476 cksum 3327456370 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0600_s_software type f size 68908 cksum 2807267745 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0610_s_oracle_sapr3 type f size 6679 cksum 2750244164 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0620_s_websphere type f size 2426 cksum 2137135673 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0630_s_pkgmngt type f size 31702 cksum 2514640219 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0700_s_hp_ov type f size 17443 cksum 890872507 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0700_u_hp_ovou_srv type f size 83952 cksum 3181091702 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0800_s_oracle type f size 20093 cksum 1023991451 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_0900_s_system type f size 21423 cksum 2233967070 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_1000_s_users type f size 8139 cksum 373739859 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_9999_s_perms type f size 2034 cksum 1977973363 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/bin/scc_modules/scc_utils type f size 32569 cksum 1536290436 mode 0500 uid 0 gid 3 owner root group sys mtime 1323890205 file path /opt/scc/doc type d mode 0755 uid 0 gid 3 owner root group sys file path /opt/scc/doc/COPYING type f size 17997 cksum 3097571973 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890205 file path /opt/scc/doc/scc-4.html type f size 6145 cksum 2376830875 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890205 file path /opt/scc/doc/scc-5.html type f size 14387 cksum 2607493377 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890205 file path /opt/scc/doc/scc-cmp.html type f size 2696 cksum 940900179 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/doc/scc-collect.html type f size 7378 cksum 4233587903 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/doc/scc-log.html type f size 9116 cksum 2408363288 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/doc/scc-log2html.html type f size 2528 cksum 661201726 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/doc/scc-plugin.html type f size 2496 cksum 1001661481 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/doc/scc-snap2html.html type f size 2749 cksum 3857892244 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/doc/scc.html type f size 14945 cksum 2357634567 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/man type d mode 0755 uid 0 gid 3 owner root group sys file path /opt/scc/man/man1 type d mode 0755 uid 0 gid 3 owner root group sys file path /opt/scc/man/man1/scc-cmp.1 type f size 2039 cksum 2429902232 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/man/man1/scc-collect.1 type f size 6583 cksum 2797128849 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/man/man1/scc-log.1 type f size 8311 cksum 422780489 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/man/man1/scc-log2html.1 type f size 1923 cksum 729392751 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890203 file path /opt/scc/man/man1/scc-plugin.1 type f size 1919 cksum 3983762991 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/man/man1/scc-snap2html.1 type f size 2143 cksum 346296533 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/man/man1/scc.1 type f size 13870 cksum 593350492 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890204 file path /opt/scc/man/man4 type d mode 0755 uid 0 gid 3 owner root group sys file path /opt/scc/man/man4/scc.4 type f size 5600 cksum 1313119561 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890205 file path /opt/scc/man/man5 type d mode 0755 uid 0 gid 3 owner root group sys file path /opt/scc/man/man5/scc.5 type f size 13614 cksum 3899102368 mode 0400 uid 0 gid 3 owner root group sys mtime 1323890205 file path /var/opt type d mode 0755 uid 0 gid 3 owner root group sys file path /var/opt/scc type d mode 0755 uid 0 gid 3 owner root group sys file path /var/opt/scc/data type d mode 0755 uid 0 gid 3 owner root group sys file path /var/opt/scc/tmp type d mode 0755 uid 0 gid 3 owner root group sys catalog/scc/scc-run/postinstall010054400140500013562000000044621167217303500201110ustar00cz2rgtmrhuxbr00000000000000#!/bin/sh # Shell script to run after the install of the scc software. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/pkg_files/postin $ # ID: $Id: postin 4772 2011-08-18 18:11:43Z siemkorteweg $ # Do not use POSIX features in this script as it can be sourced by a non-POSIX system shell! 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 umask 077 # The correct situation is that the lock file does not exist (no preinstall hook) # or that the lock file is empty becasue of the prein(stall) script. if [ -s ${SCC_TMP}/scc.lock ] then echo "ERROR: install aborted, another instance of scc" echo "ERROR: is active." 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." # This is generic postinstall code: # 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 # Collect data in upgrade mode: remove current snapshot and add comment to logbook. ${SCC_BIN}/scc-log --upgrade echo "NOTE: The snapshot and logbook can be found in ${SCC_DATA}" exit 0 catalog/scc/scc-run/postremove010054400140500013562000000032331167217303600177340ustar00cz2rgtmrhuxbr00000000000000#!/bin/sh # Shell script to run after the uninstall of the scc software. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/pkg_files/postrem $ # ID: $Id: postrem 2643 2010-07-15 10:02:43Z siemkorteweg $ # Do not use POSIX features in this script as it can be sourced by a non-POSIX system shell! SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP if [ -x "${SCC_BIN}/scc" ] then # Upon upgrading by means of rpm -U scc-X.rpm, # the postremove is called after installing the new version. # In that case we should not remove anything. : else # This is the "real" remove. Remove additional directories and files. rm -rf ${SCC_TOP} /opt/scc /etc/opt/scc fi exit 0 catalog/scc/scc-run/preinstall010054400140500013562000000053311167217303500177060ustar00cz2rgtmrhuxbr00000000000000#!/bin/sh # Shell script to run before the install of the scc software. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/pkg_files/prein $ # ID: $Id: prein 4740 2011-06-29 15:33:53Z siemkorteweg $ # Do not use POSIX features in this script as it can be sourced by a non-POSIX system shell! 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 # Avoid too strict permissions for newly created /var/opt directory. # Otherwise scc-srv will not work correctly. umask 022 mkdir -p ${SCC_TOP} 2>/dev/null umask 077 mkdir -p ${SCC_DATA} ${SCC_TMP} 2>/dev/null # 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 log files 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_TMP}/scc.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 an empty lock-file for scc-log indicating to # the postinstall that the install is running. > ${SCC_TMP}/scc.lock exit 0 scc/scc-run/etc/opt/004075500000000000003000000000003777777777700144675ustar00rootsys00000000000000scc/scc-run/etc/opt/scc/004075500000000000003000000000003777777777700152375ustar00rootsys00000000000000scc/scc-run/etc/opt/scc/conf/004075500000000000003000000000003777777777700161645ustar00rootsys00000000000000scc/scc-run/etc/opt/scc/newconfig/004075500000000000003000000000003777777777700172165ustar00rootsys00000000000000scc/scc-run/etc/opt/scc/newconfig/scc-localize010050000000000000003000000163161167217303500214370ustar00rootsys00000000000000# Script to customize the collection of data. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc-localize $ # ID: $Id: scc-localize 4778 2011-09-01 20:26:52Z siemkorteweg $ # 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. set -u ############################################################################## # General variables ############################################################################## # The scripts use a limited list of directories to search for programs. # Adjust the following line to extend this list. export SCC_PATH="" # Access to additional directories should be restricted to root. # This mechanism replaces the separate variables in this file used until version 1.11.20. if [ -n "${SCC_PATH}" ] then PATH="${PATH}:${SCC_PATH}" fi # Add the default EMC Symmetrix directory: if [ -d /usr/symcli/bin ] then PATH=${PATH}:/usr/symcli/bin fi export SCC_PROFILING="yes" # To remove timing info from the snapshot (under class "var:profiling::") # uncomment the following line: # export SCC_PROFILING="" export SCC_ROOT_PW="" # On some systems the root password is changed frequently. Uncomment the # following variable to avoid entries in the logbook for every run of scc. # export SCC_ROOT_PW=var # Account data from accounts with UID < MAX_SYS_ACCOUNT_ID have fixed data, # other accounts var data. Uncomment the following line to change the defaults # set in scc-collect. #export MAX_SYS_ACCOUNT_ID=1000 # Indicate whether the entries in the logbook are determined with "context" diff (-u option). # Uncomment the following line to activate this option (provided diff supports this option). #export SCC_CONTEXT_DIFF="yes" # Variable data in snapshots can be shown in a different color. # The specification of the color has moved to the style.css. ############################################################################## # Variables for Oracle ############################################################################## export ORATAB=/etc/oratab # The default locations for the oratab file are /etc/oratab or # /var/opt/oracle/oratab. Uncomment and change the ORATAB variable if this file # is in another location. # export ORATAB=/etc/oratab export ORA_USE_PROFILE=0 # 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=1 # Usually the SQL*Net config files are located in either /etc (/var/opt/oracle), # $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=0 ############################################################################## # Variables for hardware chapter ############################################################################## export IGNORE_NO_HW=0 # 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 export SCC_IGNORE_STM=no # 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 # Access to EMC Symmetrix command line interface (SymCLI) can be controlled # via extending SCC_PATH in the general section of this file. # Thus replacing the SYMCLI variable for versions up to 1.11.20. ############################################################################## # Variables for network chapter ############################################################################## export SCC_VAR_ROUTE_DATA=no # Systems connected to networks with many ICMP redirects, suffer from many # changes in the logbooks as these new routes are not marked dynamic. # Uncomment the following variable to set all network routing output from netstat # as variable data. The configuration of the static routes is captured in the # networking configuration files. # export SCC_VAR_ROUTE_DATA=yes ############################################################################## # Variables for OV Operations manager user-module ############################################################################## export OPCDWN=1 # 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=0 export OPCDWN_DIR="${SCC_TMP}/opcsplit" # 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= ############################################################################## # Variables for software system-module ############################################################################## # Access to the samba testparm command can be controlled # via extending SCC_PATH in the general section of this file. # Thus replacing the SCC_TESTPARM variable for versions up to 1.11.20. # Access to the perl executable can be controlled via extending # SCC_PATH in the general section of this file. # Thus replacing the SCC_PERL variable for versions up to 1.11.20. export SCC_SCR_DETAILS="no" # Uncomment the following line to activate the collection of System Configuration Repository details. # export SCC_SCR_DETAILS="yes" # Do not exit, as this script is sourced. scc/scc-run/etc/opt/scc/newconfig/scc-split.conf010050000000000000003000000062631167217303500217140ustar00rootsys00000000000000 # Configuration file to split the snapshot. # Copyright (C) 2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc-split.conf $ # ID: $Id: scc-split.conf 4778 2011-09-01 20:26:52Z siemkorteweg $ # Purpose of this file: # This file is an example how to split a scc snapshot into # several logical parts. This file can be used to provide # each Oracle instance with its own snapshot and logbook. # # This file is installed in the /etc/opt/scc/newconfig directory. # Copy it to the directory /etc/opt/scc/conf to avoid that # your changes are erased when installing a new release of scc. # # The syntax of this file is: # - empty lines and lines starting with '#' are treated as comment # - host specification: # host||local introduces new pseudo host; local production of logfile # host||remote intriduces new pseudo host; production of logfile on scc-srv # this requires at least release 1.4.1 of scc-srv # # - check whether data should be extracted for # host||present| extract when exists # host||absent| extract when does not exist # # - class specification # class||cp| copy all data from snapshot to scc..cur # class||cp|| copy all data from snapshot to scc..cur # change to . Note that can be empty! # class||mv| move all data from snapshot to scc..cur # class||mv|| move all data from snapshot to scc..cur # change to . Note that can be empty! # # class|rm| remove all data from snapshot # # To move all data for Oracle instance ABC to scc.abc.cur, use the following lines: # host|abc|local # class|abc|mv|:software:oracle:ABC: # # The scc-srv supports in the web-interface comparing snapshots for the top-level classifications. # To be able to compare parts of Oracle snapshots, remove the classification ":software:oracle::" # when moving the data. # host|abc|local # class|abc|mv|:software:oracle:ABC:| # # To extend the data of Oracle instance ABC with a list of the filesystems, use the following lines: # host|abc|local # class|abc|mv|:software:oracle:ABC:| # class|abc|cp|var:Volume Management:file systems:survey: scc/scc-run/etc/opt/scc/newconfig/style.css010050000000000000003000000024431167217303500210120ustar00rootsys00000000000000/* * Default style sheet for scc. * * SCC-release: 1.17.23 * URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/style.css $ * ID: $Id: style.css 4616 2011-03-15 19:09:56Z siemkorteweg $ */ /* * The following tag is used to specify the color of variable data in the snapshot. * In previous versions the variable SCC_VAR_COLOR was used for this purpose. */ .scc_var { color: purple; } /* * The following tags are used to specify the colors of the lines with the changed entries in log file. */ .new { color: blue; } .old { color: red; } .ctx { color: green; } table.SCC { border-spacing: 0px; background: #FFC0C0; border: 0.1em solid black; } table.SCC th { text-align: left; font-weight: normal; padding: 0.1em 0.5em; } table.SCC td { border: 0px solid black; padding: 0.1em 0.5em; } /* Table heading: full red */ table.SCC thead th { text-align: center; font-weight: bold; background-color: red; border-bottom: 1px solid black; color: white; } /* Even rows, not emphasised (default background color of table) */ /* Even rows, emphasised */ table.SCC tr.Even_Emp { background: #FFA0A0; } /* Odd rows, not emphasised */ table.SCC tr.Odd { background: #FF8080; } /* Odd rows, emphasised */ table.SCC tr.Odd_Emp { background: #FF6060; } scc/scc-run/opt/004075500000000000003000000000003777777777700137145ustar00rootsys00000000000000scc/scc-run/opt/scc/004075500000000000003000000000003777777777700144645ustar00rootsys00000000000000scc/scc-run/opt/scc/bin/004075500000000000003000000000003777777777700152345ustar00rootsys00000000000000scc/scc-run/opt/scc/bin/scc010050000000000000003000000420631167217303400156520ustar00rootsys00000000000000#!/bin/sh # Shell script to collect and send configuration data for SCC. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc $ # ID: $Id: scc 4778 2011-09-01 20:26:52Z siemkorteweg $ set -u 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 # Perform the security settings before calling any program. PATH=${SCC_BIN}:/sbin:/usr/sbin:/usr/bin:/bin; export PATH 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 . ${SCC_BIN}/scc_modules/scc_utils [ -x ${SCC_CONF}/scc-localize ] && . ${SCC_CONF}/scc-localize # Some systems do not provide nice. n_exe="$(which nice 2>/dev/null)" if [ ! -x "${n_exe}" ] then alias nice="" fi test_dir="${SCC_TMP}/scc-d-$$" TMP_FILE="${SCC_TMP}/scc-f-$$" SCC_PSEUDO_ALTERNATE="${SCC_TMP}/scc-a-$$" SYNTAX="Syntax error, use: ${ProgName} [ -a|--alternate ] [ -c|--comment ] [ -d|--delay ] [ -e|--extra ] [ -f|--fqdn ] [ -F|--from ] [ -i|--smtp ] [ -I|--ident ] [ -k|--key ] [ -m|--max_age ] [ -n|--norun ] [ -p|--prog ] [ -P|--port ] [ -r|--restart ] [ -s|--destination ] [ -t|--test ] [ -u|--user ] [ -v|--virtual ] [ -V|--version ]" empty_files=0 prog=mail max_interval=300 tty="$(which tty 2>/dev/null)" if [ -x "${tty}" ] then # Ignore output and message for ttylinux. if tty -s >/dev/null 2>/dev/null then # Waiting is meant for lots of jobs scheduled at the same time. max_interval=0 # Do not wait when interactive. fi fi alternate_dir="" key_file="" max_months=0 # 0 means: no limit. dest="" mods="" remark="" fqdn=0 do_run=1 port_default="" port="" restart="" smtp_server="" ssh_identity="" user="" virtual_host="" virtual_host_opt="" smtp_from="" while [ $# -gt 0 ] do if [ $# -eq 1 ] then # All options, except the ones in the following list, should have an argument. case "${1}" in -f|--fqdn|-n|--norun|-r|--restart|-t|--test|-V|--version) ;; *) echo "${ProgName}: Syntax error, missing argument for option: $1" exit 2;; esac fi case "${1}" in -a|--alternate) alternate_dir="${2}"; if [ ! -d "${alternate_dir}" ] then echo "${ProgName}: cannot access ${alternate_dir}" >&2 exit 2 fi shift 2;; -c|--comment) remark=$(echo "${2}" | tr -d "\012") # be sure that the remark is single-line shift 2;; -d|--delay) case "${2}" in [0-9]*) max_interval=${2};; *) echo "${ProgName}: non-numeric interval: ${2}" >&2 exit 1;; esac shift 2;; -e|--extra) mods="${2}"; # Pass on to scc-log shift 2;; -f|--fqdn) fqdn=1 shift 1;; -F|--from) smtp_from="${2}"; case "${smtp_from}" in \<**\>) ;; # valid form: \<*|*\>) echo "${ProgName}: wrong format of mail-address: ${smtp_from}" >&2 exit 1;; *@*) smtp_from="<${smtp_from}>" # non-rfc compliant; add < and > esac shift 2;; -i|--smtp) smtp_server="${2}"; prog=smtp; # No need for -p smtp with -i option port_default=25 shift 2;; -I|--ident) if [ ! -f "${2}" ] then echo "${ProgName}: cannot access identity_file ${2}" >&2 exit 1; fi ssh_identity="-i ${2}" # -i option for scp. prog=scp port_default=22 shift 2;; -k|--key) key_file="${2}"; shift 2;; -m|--max_age) case "${2}" in [0-9]*) max_months=${2};; *) echo "${ProgName}: non-numeric argument for -m option: ${2}" >&2 exit 1; esac shift 2;; -n|--norun) do_run=0 shift 1;; -p|--prog) if [ -n "${dest}" ] then echo "${ProgName}: -p option must be used prior to -s option" >&2 exit 2 fi port_default=25 case "${2}" in cp|ftp|pull|mail|rcp) prog="${2}";; scp) port_default=22 prog="${2}";; smtp) port_default=25 prog="${2}";; *) echo "${ProgName}: unknown transfer-method: ${2}" >&2 exit 2;; esac shift 2;; -P|--port) port="${2}" shift 2;; -r|--restart) restart="-r" shift 1;; -s|--dest) dest="${2}" shift 2;; -t|--test) empty_files=1 shift 1;; -u|--user) user="${2}" uid="$(id -u ${user} 2>/dev/null)" if [ $? -ne 0 ] then echo "${ProgName}: unknown user: ${user}" >&2 exit 2 fi shift 2;; -v|--virtual) virtual_host_opt=" -v ${2}"; # Pass on to scc-log virtual_host="${2}"; shift 2;; -V|--version) echo "1.17.23" exit 0;; -*) echo "${SYNTAX}" >&2 exit 1;; *) break;; esac done if [ $# -ne 0 ] then echo "${SYNTAX}" >&2 exit 1 fi if [ ${empty_files} -eq 1 -a "${alternate_dir}" ] then echo "${ProgName}: cannot use -t option combined with -a option" >&2 exit 2 fi if [ -z "${port}" -a ! -z "${port_default}" ] then port=${port_default} fi our_name=$(hostname) if [ -z "${our_name}" ] then DOMAIN="" our_name="empty" # same value as in scc-log and scc-collect. elif [ "${our_name}" = "${our_name%%.*}" ] then # No domain available in hostname. DOMAIN="" if [ -x /bin/dnsdomainname ] then DOMAIN=$(/bin/dnsdomainname 2>/dev/null) elif [ -x /bin/domainname ] then DOMAIN=$(/bin/domainname) # Indicated by Antoine Davous. fi if [ "${DOMAIN}" = "" ] then DOMAIN=$(awk '/^domain/ { print $2 }' /etc/resolv.conf 2>/dev/null | tail -n 1) fi if [ "${DOMAIN}" = "" ] then ns_exe="$(which nslookup 2>/dev/null)" if [ -x "${ns_exe}" ] then DOMAIN=$(nslookup ${our_name} 2>/dev/null | sed -n "s/^Name.*${our_name}\.//p") fi fi if [ "${DOMAIN}" = "" ] then DOMAIN=$(awk '/^search/ { print $2 }' /etc/resolv.conf 2>/dev/null | tail -n 1) fi else DOMAIN=${our_name#*.} fi if [ -n "${virtual_host}" ] then our_name="${virtual_host}" fi if [ ${fqdn} -gt 0 ] then if [ -n "${DOMAIN}" ] then our_name="${our_name%%.*}.${DOMAIN}" else echo "${ProgName}: cannot determine domainname" >&2 exit 2 fi else our_name=${our_name%%.*} # Erase domain. fi mail_dest="" case "${prog}" in pull) # scc executes and places the files in a directory that is inspected later by scc-srv. max_interval=0 dest="${SCC_DATA}/transfer" ;; mail) # Indicate the destination address. mail_dest="${dest}" ;; smtp) # Determine the sender of the mail if [ -z "${smtp_from}" ] then if [ -z "${DOMAIN}" ] then from_host="${our_name}" else from_host="${our_name%%.*}.${DOMAIN}" fi sender="" else sender="${smtp_from}" fi # Determine the destination if [ -z "${smtp_server}" ] then # Split the email-address into host and account mail_dest=${dest%%@*} smtp_server=${dest##*@} else mail_dest=${dest} fi ;; esac if [ -n "${mail_dest}" ] then # Check the format of the mail-destination. case "${mail_dest}" in \<*\>) ;; # valid form: \<*|*\>) echo "${ProgName}: wrong format of mail-address: ${mail_dest}" >&2 exit 1;; *) mail_dest="<${mail_dest}>" # non-rfc compliant; add < and > esac fi MAIL_NAME=scc-transfer-data PASSPHRASE_FILE="passphrase" trap "rm -rf ${SCC_PSEUDO_ALTERNATE} ${TMP_FILE} ${SCC_TMP}/scc*tar ${SCC_TMP}/scc*signal ${SCC_TMP}/${MAIL_NAME}* ${SCC_TMP}/${PASSPHRASE_FILE}* ${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 s in cur log log.html html do touch scc.${our_name}.${s} done max_interval=0 # do not wait when testing. else if [ ${do_run} -eq 1 ] then if [ -z "${alternate_dir}" ] then # Produce new, real SCC-data nice ${SCC_BIN}/scc-log -c "${remark}" -e "${mods}" -m "${max_months}" ${restart} ${virtual_host_opt} if [ $? -ne 0 ] then exit 1 fi fi else max_interval=0 # do not wait when no run is required. fi cd ${SCC_DATA} fi # Only send the files when we have a destination. if [ -z "${dest}" ] then exit 0 fi if [ ${max_interval} -gt 1 ] then # Wait for a maximized, random interval if [ -z "${RANDOM:-}" ] then # No ${RANDOM}, use the seconds, minutes and hours. Add 10 to avoid multiplying with 0. RANDOM="$(date '+%H:%M:%S' | awk -F: '{ print ( 10 + $1 ) * ( 10 + $2 ) * ( 10 + $3 ) }' )" export RANDOM fi sleep $(( ${RANDOM} % ${max_interval} )) fi # Check whether data for pseudo hosts was split off from the main snapshot. # Use the ${alternate_dir} for the temporary symbolic links to the files for the pseudo hosts. # When ${alternate_dir} does not exist, we create a temporary directory (and remove it at the end of this script). split_file=${SCC_CONF}/scc-split.conf split_hosts="" if [ -s "${split_file}" -a -z "${virtual_host}" ] then split_hosts="$(awk -F"|" '/^host\|/ { print $2 }' ${split_file} | sort -u)" fi if [ "${split_hosts}" ] then if [ -z "${alternate_dir}" ] then alternate_dir="${SCC_PSEUDO_ALTERNATE}" mkdir -p "${alternate_dir}" fi for host in ${our_name} ${split_hosts} do for e in cur log html log.html do ln -s ${SCC_DATA}/scc.${host}.${e} ${alternate_dir}/scc.${host}.${e} done done fi if [ "${alternate_dir}" ] then cd "${alternate_dir}" fi start_dir="$(pwd)" if [ "${alternate_dir}" ] then # Check all snapshots. for f in scc.*.cur do host="${f%.cur}" echo "${host#scc.}" done else if [ ${fqdn} -eq 1 ] then for s in cur html log log.html do ln -s scc.${our_name%%.*}.${s} scc.${our_name}.${s} done echo ${our_name} else echo ${our_name%%.*} fi fi | while read host do cd "${start_dir}" 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 REMOTE_NAME=scc.${host}.tar REMOTE_SIGNAL=scc.${host}.signal if [ ! -f scc.${host}.cur ] then # Split hosts with remote compares can be absent. # Do not send any data in this case. cd ${SCC_TMP} continue fi # Pack the data in a single file, follow symbolic links. tar -chf - scc.${host}.cur scc.${host}.log scc.${host}.log.html scc.${host}.html | "${p_exe}" >${SCC_TMP}/${REMOTE_NAME}${suffix} if [ "${alternate_dir}" -o ${fqdn} -eq 1 ] then # The alternate directory can contain symbolic links. # The FQDN files are symbolic links and no longer needed. for s in cur html log log.html do if [ -h scc.${host}.${s} ] then rm -f scc.${host}.${s} fi 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_FILE} ] then # Generate a random passphrase. # Replace \0 and \n to avoid short (possibly empty) passwords. openssl rand 40 | tr -s "\012\000" "n0" > ${PASSPHRASE_FILE} 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_FILE} \ -e \ -salt -S 83AF2E2D8BE716C2 if [ ! -f ${PASSPHRASE_FILE}.e ] then # Encrypt the passphrase with the public key. openssl rsautl \ -in ${PASSPHRASE_FILE} \ -out ${PASSPHRASE_FILE}.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_FILE}.e ${MAIL_NAME}${suffix}.e rm -f ${PASSPHRASE_FILE} ${PASSPHRASE_FILE}.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 "${mail_dest}" else # prog = smtp transfer_exe="$(which nc 2>/dev/null)" transfer_opt="-v" if [ ! -x "${transfer_exe}" ] then transfer_exe="$(which telnet 2>/dev/null)" transfer_opt="" fi if [ ! -x "${transfer_exe}" ] then echo "${ProgName}: cannot find nc and telnet to transfer data" >&2 exit 2 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: ${sender}" sleep 5 echo "rcpt to: ${mail_dest}" sleep 5 echo "data" sleep 5 echo "subject: SCC snapshot ${host}" sleep 5 echo "to: ${mail_dest}" echo "" sleep 5 uuencode ${MAIL_NAME}${suffix} <${REMOTE_NAME}${suffix} echo "." sleep 5 echo "quit" sleep 5 ) | "${transfer_exe}" ${transfer_opt} ${smtp_server} ${port} >${SCC_DATA}/smtp.log 2>&1 # Inspect the file to find out about errors. No parsing of the logfile (yet). # Luc Capronnier suggests looking for values below 400 in the response. fi ;; rcp) # Produce an empty signal-file to indicate that transfer is in progress. >${REMOTE_SIGNAL} rcp ${REMOTE_SIGNAL} ${dest} # Transfer the packed files. rcp ${REMOTE_NAME}${suffix} ${dest} # Replace the empty signal-file to indicate that transfer is complete. echo "done" >${REMOTE_SIGNAL} rcp ${REMOTE_SIGNAL} ${dest} ;; pull) # Produce an empty signal-file to indicate that transfer is in progress. >${dest}/${REMOTE_SIGNAL} # Transfer the packed files. cp ${REMOTE_NAME}${suffix} "${dest}" # Replace the empty signal-file to indicate that transfer is complete. echo "done" >"${dest}/${REMOTE_SIGNAL}" if [ "${user}" ] then # This feature has been suggested by Sven Weise. # The files should be retrieved by a non-root user. # Change the permissions/ownership of directories "above" the files to be transferred. chmod o+x "${SCC_TOP}" chmod o+x "${SCC_DATA}" chown ${user} "${dest}" # Change ownership of the files to be transferred. chown ${user} "${dest}"/* fi ;; scp) which scp 2>/dev/null >/dev/null if [ $? -ne 0 ] then echo "${ProgName}: scp not found" >&2 exit 2 fi # Produce an empty signal-file to indicate that transfer is in progress. >${REMOTE_SIGNAL} port_scp="-P ${port}" quiet="-q" scp ${quiet} ${port_scp} ${ssh_identity} ${REMOTE_SIGNAL} ${dest} >/dev/null 2>/dev/null if [ $? -ne 0 ] then # Some dropbear implementations of scp complain about the -q option and do # not show the progress without the -q option. # Do not use the -q option when a dropbear implementation results in an error. exe="$(ls -l $(which scp) | sed -e 's@.*/@@')" if [ "${exe}" = "dropbear" ] then quiet="" scp ${quiet} ${port_scp} ${ssh_identity} ${REMOTE_SIGNAL} ${dest} >/dev/null 2>/dev/null fi fi # Transfer the packed files. scp ${quiet} ${port_scp} ${ssh_identity} ${REMOTE_NAME}${suffix} ${dest} >/dev/null 2>/dev/null # Replace the empty signal-file to indicate that transfer is complete. echo "done" >${REMOTE_SIGNAL} scp ${quiet} ${port_scp} ${ssh_identity} ${REMOTE_SIGNAL} ${dest} >/dev/null 2>/dev/null ;; cp) if [ -d "${dest}" ] then # 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} else echo "${ProgName}: cannot access target directory: ${dest}" >&2 fi ;; ftp) # ${dest} is : host=${dest%:*} dir=${dest#*:} # Produce an empty signal-file to indicate that transfer is in progress. >${REMOTE_SIGNAL} ftp ${host} <<-_X_ cd ${dir} bin put ${REMOTE_SIGNAL} _X_ # Transfer the packed files to the destination ftp ${host} <<-_X_ cd ${dir} bin put ${REMOTE_NAME}${suffix} _X_ # Replace the empty signal-file to indicate that transfer is complete. echo "done" >${REMOTE_SIGNAL} ftp ${host} <<-_X_ cd ${dir} bin put ${REMOTE_SIGNAL} _X_ ;; esac rm -f ${REMOTE_SIGNAL} ${REMOTE_NAME}${suffix} done exit 0 scc/scc-run/opt/scc/bin/scc-cmp010050000000000000003000000207741167217303300164330ustar00rootsys00000000000000#!/bin/sh # Shell script to compare configuration data for SCC. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc-cmp $ # ID: $Id: scc-cmp 4778 2011-09-01 20:26:52Z siemkorteweg $ set -u 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 [ -x ${SCC_CONF}/scc-localize ] && . ${SCC_CONF}/scc-localize . ${SCC_BIN}/scc_modules/scc_utils umask 077 if [ $# -ne 4 ] then echo "Syntax error, use: ${ProgName} " >&2 exit 1 fi export TMP1_FILE=${SCC_TMP}/scc_cmp1_$$ export TMP2_FILE=${SCC_TMP}/scc_cmp2_$$ export TMP3_FILE=${SCC_TMP}/scc_cmp3_$$ trap "rm -f ${TMP1_FILE} ${TMP2_FILE} ${TMP3_FILE}" 0 trap "exit 2" 1 2 3 15 # Split a snapshot into files per classification, containing the "fix" data. # Required for context diff. snap_split() { my_dir="${1}" my_snap="${2}" rm -rf "${my_dir}" mkdir -p "${my_dir}" awk '/^fix:/ { file_name = $0; gsub( "::.*", "", file_name ); gsub( "/", "_", file_name ); # filename cannot contain "/" file_name = sprintf( "%s/%s", d, file_name ); print >>file_name; }' d="${my_dir}" <"${my_snap}" } prev_snapshot="${1}" new_snapshot="${2}" remark="${3}" ignore="${4}" if [ ! -f "${new_snapshot}" ] then echo "${ProgName}: cannot access file ${new_snapshot}" >&2 exit 2 fi timestamp="$(head "${new_snapshot}" | awk -F: '/date/ { d=$NF; next } /:start time:/ { print d ":" $NF }' )"; runtime="$(head "${new_snapshot}" | sed -n -e "s/^var:general::runtime://p")" if [ -f "${prev_snapshot}" ] then >${TMP1_FILE} # The software system module of scc records the checksums of all modules. # scc-collect "surrounds" the data of a user-module with the following tags: # # var:MoDuLe:start::: # ... # var:MoDuLe:end::: # # These tags are used to ignore changes when a user-modules has been changed. # 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 # recorded by the software system module 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 all system modules and the user-module: scc -e "" # - change the user-module # - test the user-module: scc-collect -i -e "" # - rerun the system modules and 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_" ${prev_snapshot} >${TMP2_FILE} grep "^var:MoDuLe:start::scc_[0-9][0-9][0-9][0-9]_u_" ${new_snapshot} >${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} ${prev_snapshot} | grep "^fix:" >${TMP2_FILE} sed -f ${TMP1_FILE} ${new_snapshot} | grep "^fix:" >${TMP3_FILE} if [ -z "${remark}" ] # Do not change remark supplied with -c option. then remark="changes in modules $(awk -F: '{ printf( "%s ", $(NF - 1) ) }' ${TMP1_FILE}), differences ignored" fi >${TMP1_FILE} else grep "^fix:" ${prev_snapshot} >${TMP2_FILE} grep "^fix:" ${new_snapshot} >${TMP3_FILE} fi diff -u /dev/null /dev/null 2>/dev/null # Check for support of context diff? if [ $? -eq 0 -a "${SCC_CONTEXT_DIFF:-}" = "yes" ] then # Context diff: contributed by Erik-Jan Taal: snap_split ${SCC_DATA}/new ${TMP3_FILE} snap_split ${SCC_DATA}/old ${TMP2_FILE} diff -u -NP ${SCC_DATA}/old ${SCC_DATA}/new | sed -e '/^diff /d' \ -e '/^--- /d' \ -e '/^+++ /d' \ -e '/^@@ /d' \ -e 's/^+fix:/new::/' \ -e 's/^-fix:/old::/' \ -e 's/^ fix:/ctx::/' \ ${ignore} >${TMP1_FILE} dif_cnt=$(grep -c "^[no][el][wd]:" ${TMP1_FILE}) # Count the "new" and "old" lines. rm -rf ${SCC_DATA}/new ${SCC_DATA}/old else # Compare old new diff ${TMP2_FILE} ${TMP3_FILE} | sed -e "/^[0-9]/d" \ -e "/^--/d" \ -e "s/^< fix:/old::/" \ -e "s/^> fix:/new::/" \ ${ignore} >${TMP1_FILE} dif_cnt="$(wc -l <${TMP1_FILE} | sed -e 's/^ *//')" fi if [ -s ${TMP1_FILE} ] then old_cnt="$(wc -l <${TMP2_FILE})" new_cnt="$(wc -l <${TMP3_FILE})" # Require a minimal size of the snapshots. if [ "${old_cnt}" -gt 1000 -o "${new_cnt}" -gt 1000 ] then # Do not signal all changes when new and previous are less # than 20% of each other or when the number of differences execeeds 20.000 if [ ${new_cnt} -lt $(( ${old_cnt} / 5 )) -o \ ${old_cnt} -lt $(( ${new_cnt} / 5 )) -o \ ${dif_cnt} -gt 20000 ] then # Old and new differ too much or there are too many changes. # Reduce the differences to the count of all classes of the differences. # Ignore the context files with context diff. remark="Too many changes; reduced to # of lines per classification" awk '/^old::/ { sub( "^old::", "" ); sub( "::.*", "" ); old[ $0 ] += 1; } /^new::/ { sub( "^new::", "" ); sub( "::.*", "" ); new[ $0 ] += 1; } { if ( ! id[ $0 ] ) { id[ $0 ] = NR; } } END { for ( o in old ) { printf( "%d %d old::%s::%d\n",\ old[ o ] + new[ o ], id[ o ],\ o, old[ o ] ); } for ( n in new ) { printf( "%d %d new::%s::%d\n",\ new[ n ] + old[ n ], id[ n ],\ n, new[ n ] ); } }' ${TMP1_FILE} | sort -k 1nr -k 2n -k 3 | sed -e 's/^[0-9 ]*//' >${TMP2_FILE} mv ${TMP2_FILE} ${TMP1_FILE} fi # Too many differences. fi # if [ "${old_cnt}" -gt 1000 -o "${new_cnt}" -gt 1000 ] # Get the date and time of the old (current) snapshot. d_o=$(head ${prev_snapshot} | sed -n -e "s/.*::date://p") t_o=$(head ${prev_snapshot} | sed -n -e "s/.*::start time://p" | sed -e 's/:/./g') echo "${timestamp}:result::different" echo "${timestamp}:remark::${remark}" echo "${timestamp}:runtime::${runtime}" echo "${timestamp}:count::${dif_cnt}" echo "${timestamp}:previous date::${d_o}" echo "${timestamp}:previous time::${t_o}" sed -e "s/^/${timestamp}:data::/" ${TMP1_FILE} else # File with differences is empty. No differences. echo "${timestamp}:result::identical" echo "${timestamp}:remark::${remark}" echo "${timestamp}:runtime::${runtime}" fi # if [ -s ${TMP1_FILE} ] else # if [ -f "${prev_snapshot}" ] # No previous snapshot. This means that scc has been (re)started. echo "${timestamp}:result::(re)start" echo "${timestamp}:remark::${remark}" echo "${timestamp}:runtime::${runtime}" fi exit 0 scc/scc-run/opt/scc/bin/scc-collect010050000000000000003000000305561167217303300173000ustar00rootsys00000000000000#!/bin/sh # Shell script to collect configuration data for SCC. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc-collect $ # ID: $Id: scc-collect 4784 2011-09-20 19:37:37Z siemkorteweg $ set -u ProgName=${0##*/}; export ProgName # Use the program scc-relocate from the source-tar to change the sources, # which results in the install of SCC in other directories. 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 # Perform the security settings before calling any program. PATH=/sbin:/usr/sbin:/usr/bin:/bin:/usr/lib:${SCC_BIN}; export PATH umask 077 . ${SCC_BIN}/scc_modules/scc_utils # Indicate the directory for temporary files. export TMPDIR=${SCC_TMP} export TMP=${SCC_TMP} export SHELL=/bin/sh export LANG=C mkdir -p ${SCC_DATA} ${SCC_TMP} 2>/dev/null cd ${SCC_TMP} if [ ! -w ${SCC_DATA} ] then echo "${ProgName}: insufficient access to data directory: ${SCC_DATA}" >&2 exit 2 fi # Now we can start: export ODMDIR="${ODMDIR:-}" export SCC_PROFILING="${SCC_PROFILING:-yes}" export SCC_IGNORE_STM="${SCC_IGNORE_STM:-}" export SCC_INSTALL_PHASE="${SCC_INSTALL_PHASE:-}" export SCC_INSTALL_METHOD="${SCC_INSTALL_METHOD:-}" # Unset this variable when it is empty to avoid default (UTC). if [ -z "${TZ:-}" ] then unset TZ fi SYNTAX="Syntax error, use: ${ProgName} [ -a ] [ -e ] [ -i ]" >&2 args="" interactive=0 modules="" while [ $# -gt 0 ] do if [ $# -eq 1 ] then # All options, except the ones in the following list, should have an argument. if [ "x${1}" != "x-i" ] then echo "${ProgName}: Syntax error, missing argument for option: $1" exit 2 fi fi 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 mkdir -p ${SCC_DATA} ${SCC_TMP} 2>/dev/null [ -x ${SCC_CONF}/scc-localize ] && . ${SCC_CONF}/scc-localize tty="$(which tty 2>/dev/null)" if [ -x "${tty}" -a ${interactive} -eq 0 ] then # Ignore output and message for ttylinux. if tty -s >/dev/null 2>/dev/null then echo "${ProgName}: use -i option to run interactive" >&2 exit 2 fi fi 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) if [ -z "${hostname}" ] then hostname="empty" # same value as in scc and scc-log fi HOSTNAME=${hostname%%.*} export OS_NAME hostname HOSTNAME scc_linux_distro # Set SCC_LINUX_DISTRO to the proper value. 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.2" 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. # Reduce the length of the lines. # On some systems java code is part of the output, resulting in lines exceeding 2KB and errors from grep. # Indicated by Doug Probst and Mattijs de Ruijter. case "${OS_NAME}" in *BSD) ps -ajxww -o user,pid,ppid,state,pri,%cpu,%mem,vsz,rss,tty,start,time,command | cut -c1-300 >${PROC_FILE} ;; OSF1) ps axww -o user,pid,ppid,state,pri,%cpu,%mem,vsz,rss,tty,start,time,command | cut -c1-300 >${PROC_FILE} ;; AIX) ps -Af | cut -c1-300 >${PROC_FILE} ;; *) # Try to collect the process hierarchy. busybox_check ps if [ $? -ne 0 ] then busybox_ps | cut -c 1-300 >${PROC_FILE} else UNIX95= ps -Hef 2>/dev/null | cut -c1-300 >${PROC_FILE} if [ $(wc -l <$PROC_FILE) -lt 10 ] # Not supported? then ps -ef 2>/dev/null | cut -c1-300 >${PROC_FILE} fi fi ;; esac IS_NIS_MASTER=0; export IS_NIS_MASTER NIS_DATA_DIR=""; export NIS_DATA_DIR grep -l ypxfrd ${PROC_FILE} >/dev/null 2>/dev/null if [ $? -eq 0 ] then IS_NIS_MASTER=1 NIS_DATA_DIR=$(grep "^[ ]*DIR" /var/yp/Makefile 2>/dev/null | tail -n 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" export crypt_key=$(sed -n -e "s@^${scc_keep_crypt_tag}:@@p" ${SCC_KEEP_CONFIG}) if [ ! -n "${crypt_key}" ] then if [ -z "${RANDOM:-}" ] then # No ${RANDOM}, use the seconds, minutes and hours. Add 10 to avoid multiplying with 0. RANDOM="$(date '+%H:%M:%S' | awk -F: '{ print ( 10 + $1 ) * ( 10 + $2 ) * ( 10 + $3 ) }' )" export RANDOM fi crypt_key="${RANDOM}${RANDOM}" fi echo "${scc_keep_crypt_tag}:${crypt_key}" >>${SCC_KEEP_NEW} return 0; } now=$(date '+%H.%M.%S') hour=${now%%.*} min=${now%.*} min=${min#*.} sec=${now##*.} tick_prev=$(( ${sec#0} + ( 60 * ${min#0} ) + ( 3600 * ${hour#0} ) )); export tick_prev total_time=0; export total_time # 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 # The adb-command, used to retrieve settings from the kernel, uses two sets of format strings. # Indicated by Harry van Wiggen. if [ "${OS_NAME}" = "HP-UX" ] then export HPUX_ADB_STRING_FORMAT="S" export HPUX_ADB_NMBR_FORMAT="D" value="$(echo "boot_string/${HPUX_ADB_STRING_FORMAT}" | /usr/bin/adb "${HPUX_KERNEL}" /dev/kmem 2>/dev/null)" if [ -z "${value}" ] then HPUX_ADB_STRING_FORMAT="ls" HPUX_ADB_NMBR_FORMAT="ld" fi fi # Edit scc-localize to change the default setting of this variable. if [ -z "${MAX_SYS_ACCOUNT_ID:-}" ] then MAX_SYS_ACCOUNT_ID=500 if [ "${OS_NAME}" = "HP-UX" -o "${OS_NAME}" = "SunOS" ] then MAX_SYS_ACCOUNT_ID=100 # check logins(1) fi fi export MAX_SYS_ACCOUNT_ID scc_crypt_init; ## START: GENERAL [ ${SCC_PROFILING} ] && scc_timing "start of run" # sysctl -a references obsolete/deprecated variables on some systems. # Use the files in /proc/sys to retrieve just the existing variables. # Record the data in a file for use in the hardware, kernel and network modules. export SYSCTL_DATA=${SCC_TMP}/sysctl.data if [ -x /sbin/sysctl ] then if [ -d /proc/sys ] then # remove the files of the deprecated variables: find /proc/sys -type f 2>/dev/null | sed -e '/\/proc\/sys\/net\/ipv6\/route\/flush/d' \ -e '/\/proc\/sys\/net\/ipv6\/neigh\/.*\/base_reachable_time$/d' \ -e '/\/proc\/sys\/net\/ipv6\/neigh\/.*\/retrans_time$/d' \ -e '/\/proc\/sys\/net\/ipv4\/route\/flush/d' \ -e '/\/proc\/sys\/fs\/binfmt_misc\/register/d' | awk '{ # Determine the label from the filename: /proc/sys/fs/aoi-nr => fs.aio-nr cnt=split( $0, parts, "/" ); printf( "%s %s", $0, parts[ 4 ] ) for ( i = 5; i <= cnt; i++ ) { printf( ".%s", parts[ i ] ); } printf( "\n" ) }' | while read file label do # RHEL 6.0 contains a write-only file. Test to avoid errors. if [ -r "${file}" ] then sed -e "s/^/${label} = /" "${file}" 2>/dev/null fi done else /sbin/sysctl -a 2>/dev/null # No /proc/sys available fi fi >${SYSCTL_DATA} mkdir -p ${SCC_DATA}/plugin_data # Just in case it was removed SCC_MODULE=""; export SCC_MODULE ( cd ${SCC_BIN}/scc_modules for SCC_MODULE in scc_[0-9][0-9][0-9][0-9]_[su]_* do if [ -x "${SCC_MODULE}" ] then case "${SCC_MODULE}" in scc_*~) continue;; # Ignore (vim) copies. esac echo "moduleSTART:${SCC_MODULE}" >>${SCC_KEEP_NEW} module_has_run=0 rm -f ${TMP1_FILE} ${TMP2_FILE} ${TMP3_FILE} if [ ${interactive} -eq 0 ] then [ ${SCC_PROFILING} ] && scc_timing "${SCC_MODULE} start of module" fi case "${SCC_MODULE}" in scc_[0-9][0-9][0-9][0-9]_s_*) # scc system module if [ ${interactive} -eq 0 ] # All modules, no specific modules requested? then ./"${SCC_MODULE}" 2>&1 module_has_run=1 else case "${SCC_MODULE}" in *${modules}*) ./"${SCC_MODULE}" 2>&1 # run the matching system module module_has_run=1 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 "${SCC_MODULE}" in *${modules}*) # run the user module checksum="$(sed -e '/^[ ]*#/d' \ -e '/^[ ]*$/d' ${SCC_MODULE} | scc_checksum)" if [ ${interactive} -eq 1 ] then echo "var:MoDuLe:start::${SCC_MODULE}:${checksum}" ./"${SCC_MODULE}" ${args} 2>&1 module_has_run=1 echo "var:MoDuLe:end::${SCC_MODULE}:" else # Surround the data with these tags, when a module # is changed, scc-log detects this and removes the # data of the module 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::${SCC_MODULE}:${checksum}" ./"${SCC_MODULE}" ${args} 2>&1 module_has_run=1 echo "var:MoDuLe:end::${SCC_MODULE}:" } >"${SCC_DATA}/plugin_data/${SCC_MODULE}" fi ;; esac; fi if [ ${interactive} -eq 0 ] then # Send the plugin-data of new user-modules only when it exists. if [ -s ${SCC_DATA}/plugin_data/${SCC_MODULE} ] then # Incorporate the output of the user module. cat "${SCC_DATA}/plugin_data/${SCC_MODULE}" fi fi ;; esac if [ ${interactive} -eq 0 ] then [ ${SCC_PROFILING} ] && scc_timing "${SCC_MODULE} end of module" fi if [ ${module_has_run} -eq 0 ] then # The module has not run. # Preserve its data from the keep-file into the new keep-file. sed -n -e "/^moduleSTART:${SCC_MODULE}/,/^moduleEND:${SCC_MODULE}/p" ${SCC_KEEP_CONFIG} | sed -e "/^module.*:${SCC_MODULE}/d" >>${SCC_KEEP_NEW} fi echo "moduleEND:${SCC_MODULE}" >>${SCC_KEEP_NEW} else echo "fix:messages::non-executable module: ${SCC_MODULE}" fi # if [ -x "${SCC_MODULE}" ] done # for SCC_MODULE in scc_[0-9][0-9][0-9][0-9]_[su]_* ) | if [ -x /bin/busybox ] then # Do not use the limited version of tr in case of busybox. cat - else tr "\177-\377" "_" # Replace non-ASCCI characters by "_" fi ## END [ ${SCC_PROFILING} ] && scc_timing "end of run" if [ "${interactive}" -eq 0 ] then # Changing a module will change the check_sum in the keep-file. # During the next (regular) run of scc we want the differences for an altered module to be ignored. # Do not preserver the keep-data running in interactive mode. mv ${SCC_KEEP_NEW} ${SCC_KEEP_CONFIG} fi rm -f ${SYSCTL_DATA} exit 0 scc/scc-run/opt/scc/bin/scc-log010050000000000000003000000610641167217303300164320ustar00rootsys00000000000000#!/bin/sh # Shell script to collect and compare configuration data for SCC. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc-log $ # ID: $Id: scc-log 4797 2011-11-16 19:57:51Z siemkorteweg $ set -u ProgName=${0##*/}; export ProgName SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP # Perform the security settings before calling any program. PATH=/sbin:/usr/sbin:/usr/bin:/bin:${SCC_BIN}; export PATH export SCC_DATA=${SCC_TOP}/data export SCC_TMP=${SCC_TOP}/tmp export SCC_CONF=/etc/opt/scc/conf export SCC_NEWCONF=/etc/opt/scc/newconfig export TMPDIR=${SCC_TMP} export TMP=${SCC_TMP} export SHELL=/bin/sh export LANG=C umask 077 mkdir -p ${SCC_DATA}/transfer ${SCC_TMP} 2>/dev/null cd ${SCC_TMP} [ -x ${SCC_CONF}/scc-localize ] && . ${SCC_CONF}/scc-localize . ${SCC_BIN}/scc_modules/scc_utils # PuppyLinux does not provide nice. n_exe="$(which nice 2>/dev/null)" if [ ! -x "${n_exe}" ] then alias nice="" fi name=$(hostname) name=${name%%.*} if [ -z "${name}" ] then name="empty" # same value as in scc and scc-collect fi index=${SCC_DATA}/index.html lock_cfg=${SCC_TMP}/scc.lock ito_log=${SCC_DATA}/cfg.log split_file=${SCC_CONF}/scc-split.conf export TMP1_FILE=${SCC_TMP}/scc_log1_$$ export TMP2_FILE=${SCC_TMP}/scc_log2_$$ export TMP3_FILE=${SCC_TMP}/scc_log3_$$ export PROC_FILE=${SCC_TMP}/scc_log_ps_$$ # File, used in release 1.1.30, no longer needed rm -f ${SCC_DATA}/scc_rpm_keep # Produce head for html-file on stdout. # Argument: title scc_html_head( ) { echo '' echo "" echo "" echo ' ' echo " Index for ${1}" echo "" } scc_check_snapshot() { awk '/^fix:messages:/ { # When a module signals an error, the syntax of the message-line is correct visited[ "fix:messages::" ] = 1; compare[ ":messages:" ] = 1; } /^fix:|^var:|^hlp:/ { class=$0; sub( /::.*/, "::", class ); cnt=split( class, part, ":" ); if ( visited[ class ] ) # Each visited class already has been checked. { print $0; # print, but do not check again. next; } # line with classification with minimal number of elements: # fix:general:: # cnt is 4 # line with classification with maximal number of elements: # fix:1:2:3:4:5:6:7:8:9:10:: # cnt is 13 if ( cnt < 4 ) { print "fix:messages::not enough fields in classification:", $0; } else if ( cnt > 13 ) { print "fix:messages::too many fields in classification:", $0; } else if ( ( class == $0 ) && ( class !~ "::$" ) ) { print "fix:messages::no end of classification:", $0; } else { visited[ class ]=1; # A class conflict occurs in the following case: # fix:a:b::data # fix:a:b:c::data # Either a:b is the classification of configuration data, # or it is the entry-point for a sub-menu. # Help-info can be available for a sub-menu. # Therefore no class conflicts for help-info. if ( class !~ "^hlp:" ) { sub( /^.../, "", class ); # erase fix or var or hlp 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 "\""; break; } if ( index( class, c ) == 1 ) { print "fix:messages::class conflict for \"" c "\" and \"" class "\""; break; } } compare[ class ]=1; } print $0; } next; } { print "fix:messages::unknown prefix:" $0; }' return 0; } # Check for the conditions in a split-file. # ARGUMENTS # "absent" or "present" # possible formats are: # # | check_split_condition() { if [ "${2}" != "${2#*|}" ] then # This is a very simple process checker. user="${2%|*}" # Split $2 into and proc="${2#*|}" awk '{ if ( $1 != u ) { next; } if ( $0 ~ p ) { exit 2; } }' u="${user}" p="${proc}" ${PROC_FILE} ret=$? if [ "${1}" = "present" -a "${ret}" -eq 2 ] then return 1; fi if [ "${1}" = "absent" -a "${ret}" -ne 2 ] then return 1; fi else if [ "${1}" = "present" -a -f "${2}" ] then return 1; fi if [ "${1}" = "absent" -a ! -f "${2}" ] then return 1; fi fi return 0 } # To avoid that scc is run (by cron) between the pre- and the post-install, # an empty lock-file is created in the pre-install after running scc. if [ -f ${lock_cfg} -a ! -s ${lock_cfg} -a -n "${SCC_INSTALL_PHASE:-}" ] then rm -f ${lock_cfg} # make sure that scc-log will continue fi # 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 # lock file from the other, running invocation of this program. trap "rm -f ${TMP1_FILE} ${TMP2_FILE} ${TMP3_FILE} ${lock_cfg} ${PROC_FILE}" 0 trap "exit 2" 1 2 3 15 # Record our PID in the lock-file echo "$$" > ${lock_cfg} interactive="" remark="" max_months=0 # No limit mods="" restart=0 uninstall=0 virtual_host=0 while [ $# -gt 0 ] do if [ $# -eq 1 ] then # All options, except the ones in the following list, should have an argument. case ${1} in -r|--reset|-u|--uninstall|--upgrade) ;; *) echo "${ProgName}: Syntax error, missing argument for option: $1" exit 1;; esac fi case ${1} in -c|--comment) remark=$(echo "${2}" | tr -d "\012") # be sure that the remark is single-line shift 2;; -e|--extra) mods="${2}"; shift 2;; -m|--max_age) case "${2}" in [0-9]*) max_months=${2};; *) echo "${ProgName}: non-numeric argument for -m option: ${2}" >&2 exit 1;; esac shift 2;; -r|--reset) restart=1 shift 1;; -u|--uninstall) uninstall=1 shift 1;; --upgrade) restart=1 remark="install of SCC release 1.17.23" shift 1;; -v|--virtual) interactive=" -i " virtual_host=1 name="${2}" # Act as data is originating from virtual host. shift 2;; *) echo "Syntax error, use ${ProgName} [ -c|--comment ] [ -e|--extra ] [ -m|--max_age ] [ -r|--reset | -u|--uninstall ] [ --upgrade ] [ -v|--virtual " >&2 exit 1;; esac done if [ ${virtual_host} -eq 1 -a -z "${mods}" ] then echo "${ProgName}: use -e option with -v option" >&2 exit 1 fi # Do not overwrite an existing stylesheet. if [ ! -f ${SCC_DATA}/style.css ] then cp -p ${SCC_NEWCONF}/style.css ${SCC_DATA} chmod 400 ${SCC_DATA}/style.css fi log_cfg=${SCC_DATA}/scc.${name}.log keep=${SCC_DATA}/scc.${name}.keep split_hosts="" if [ -s "${split_file}" -a ${virtual_host} -eq 0 ] then split_hosts="$(awk -F"|" '/^host\|/ { print $2 }' ${split_file} | sort -u)" fi if [ ${restart} -eq 1 ] then # Erase the current snapshot(s) to indicate the restart. rm -f ${SCC_DATA}/scc.${name}.cur if [ ${virtual_host} -eq 0 ] then for h in ${split_hosts} do rm -f ${SCC_DATA}/scc.${h}.cur done fi fi if [ ${uninstall} -eq 1 ] then for h in ${name} ${split_hosts} do rm -f ${SCC_DATA}/scc.${h}.* done rm -f ${ito_log} ${lock_cfg} ${keep} exit 0 fi if [ ${virtual_host} -eq 0 ] then # For some programs that inspect the logbook, "fixed" filenames are easier. # Use a symbolic link to save disk-space. if [ -h ${ito_log} ] then # Check whether the target of the symlink corresponds to ${log_cfg}. # When this is not the case, the hostname of the system changed. prev_host="$(ls -l ${ito_log} | awk '{ sub( /\.log$/, "", $NF ); sub( /.*scc\./, "", $NF ); print $NF }')" if [ "${prev_host}" != "${name}" ] then # We have to move the files to reflect the new hostname. for suffix in cur html log log.html keep old do mv ${SCC_DATA}/scc.${prev_host}.${suffix} ${SCC_DATA}/scc.${name}.${suffix} 2>/dev/null done if [ -z "${remark}" ] # Do not change remark supplied with -c option. then remark="Hostname changed from ${prev_host} to ${name}" fi fi fi rm -f ${ito_log} touch ${log_cfg} ln -s ${log_cfg} ${ito_log} fi # Reduce the log file to the specified number of months. if [ ${max_months} -gt 0 ] then # Remove leading 0 from current month to avoid illegal octal numbers 08 and 09. Indicated by Eduardo Alvarenga. cur_month=$(date '+%m') limit=$(( ( $(date '+%Y') * 12 ) + ${cur_month#0} - ${max_months} )) for h in ${name} ${split_hosts} do echo "${SCC_DATA}/scc.${h}.log" done | sort -u | while read logfile do first=$(head -n 1 ${logfile} | 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}" ${logfile} >${TMP1_FILE} # The html-version of the log file is generated from scratch out of the shorter log file. mv ${TMP1_FILE} ${logfile} fi done fi # if [ ${max_months} -gt 0 ] # Record the start of collecting. 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} ) )) # When scc is installed via installp, it runs with a non-default ODM environment. # Correct this (we only read data from ODM). if [ -d /etc/objrepos ] then export ODMDIR=/etc/objrepos fi env="$(which env 2>/dev/null)" if [ -x "${env}" ] then # Run scc-collect in a "clean" environment. # It needs TZ to use the correct time-settings. # It needs ODMDIR to use the correct object database for AIX. # 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. # It uses SCC_INSTALL_METHOD to know whether source installs should be recorded. nice env -i \ TZ="${TZ:-}" \ ODMDIR="${ODMDIR:-}" \ SCC_PROFILING="${SCC_PROFILING:-yes}" \ SCC_IGNORE_STM="${SCC_IGNORE_STM:-}" \ SCC_INSTALL_PHASE="${SCC_INSTALL_PHASE:-}" \ SCC_INSTALL_METHOD="${SCC_INSTALL_METHOD:-}" \ LOGNAME="root" \ ${SCC_BIN}/scc-collect -e "${mods}" ${interactive} ${TMP3_FILE} 2>&1 else # Some systems do not provide env. Do not run in a clean environment. nice ${SCC_BIN}/scc-collect -e "${mods}" ${interactive} ${TMP3_FILE} 2>&1 fi # Record the end of collecting. 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} ))" # Check the syntax of the new snapshot. rm -f ${TMP1_FILE} sed -e 's/[ ][ ]*$//' \ -e '/^$/d' ${TMP3_FILE} | scc_check_snapshot >${TMP2_FILE} rm -f ${TMP1_FILE} ${TMP3_FILE} # Do not use the split-file when -v option is used. if [ -s ${split_file} -a ${virtual_host} -eq 0 ] then # The file ${PROC_FILE} only exists during the collection of data. # Extract its contents from the new snapshot. sed -n -e "s/^var:system:processes:://p" <${TMP2_FILE} >${PROC_FILE} # Split the new snapshot according to the split-file. # Produce the new snapshots for all pseudo hosts in the splitfile. # ${TMP2_FILE} contains the collected data. for host in ${split_hosts} do rm -f ${SCC_DATA}/scc.${host}.new # Check whether pseudo host is active/present. check="$(sed -n -e "s/^host|${host}|present|//p" ${split_file})" if [ -n "${check}" ] then check_split_condition present "${check}" if [ $? -eq 0 ] then continue fi fi check="$(sed -n -e "s/^host|${host}|absent|//p" ${split_file})" if [ -n "${check}" ] then check_split_condition absent "${check}" if [ $? -eq 0 ] then continue fi fi # Collect all the classifications that have to be moved/copied. cp_file=${SCC_TMP}/${host}.cp.$$ del_file=${SCC_TMP}/${host}.del.$$ rm -f ${cp_file} ${del_file} awk -F"|" '/^[ ]*#/ { next } /^[ ]*$/ { next } { if ( $2 != h ) { next; } data = ""; n_class = ""; del = 0; new = 0; } /^class\|.*\|rm\|/ { data = $4; del = 1; } /^class\|.*\|cp\|/ { data = $4; n_class = $4; if ( NF == 5 ) { n_class = $5; } new = 1; } /^class\|.*\|mv\|/ { data = $4; n_class = $4; if ( NF == 5 ) { n_class = $5; } del = 1; new = 1; } { if ( new == 0 && del == 0 ) { next; } if ( length( n_class ) == 0 ) { n_class = ":" } if ( data ~ "^fix:" || data ~ "^var:" ) { # Do not extend. if ( new ) { # n_class should also start with "fix:" or "var:" printf( "s%s^%s%s%s%sp\n", \ sep, data, sep, \ n_class, sep ) >>cp_file } if ( del ) { print data >>del_file; } } else { # Extend optional with fix, var and hlp. col = ":" if ( data ~ "^:" ) { col = ""; } if ( new ) { printf( "s%s^fix%s%s%sfix%s%s%sp\n", \ sep, col, data, sep, \ col, n_class, sep ) >>cp_file printf( "s%s^var%s%s%svar%s%s%sp\n", \ sep, col, data, sep, \ col, n_class, sep ) >>cp_file printf( "s%s^hlp%s%s%shlp%s%s%sp\n", \ sep, col, data, sep, \ col, n_class, sep ) >>cp_file } if ( del ) { print "fix" col data >>del_file; print "var" col data >>del_file; print "hlp" col data >>del_file; } } next; }' \ cp_file="${cp_file}" \ del_file="${del_file}" \ h="${host}" \ sep='\001' \ ${split_file} if [ -s ${cp_file} ] # Something to copy? then sed -n -f ${cp_file} ${TMP2_FILE} | scc_check_snapshot >${TMP1_FILE} { grep -l "^fix:messages::" ${TMP1_FILE} >/dev/null 2>/dev/null if [ $? -eq 0 ] then echo "fix:messages::inspect scc.${host}.cur to determine cause of messages in system/user-modules" fi echo "var:general::date:${d_n}" echo "var:general::start time:${t_n_b}" echo "var:general::stop time :${t_n_e}" echo "var:general::runtime:${runtime}" echo "fix:general::hostname:${host}" echo "var:general::remark:${remark}" if [ ${restart} -eq 1 ] then echo "var:general::restart:true" fi # Get the specification for this host from the split-file. # Put them in the general part of the snapshot. awk -F"|" '/^[ ]*#/ { next } { if ( $2 != h ) { next; } print "fix:general::split-file:" $0; }' h="${host}" ${split_file} cat ${TMP1_FILE} rm -f ${TMP1_FILE} } >${SCC_DATA}/scc.${host}.new fi if [ -s ${del_file} ] # Something to remove? then grep -v -f ${del_file} ${TMP2_FILE} >${TMP2_FILE}.tmp mv ${TMP2_FILE}.tmp ${TMP2_FILE} fi rm -f ${cp_file} ${del_file} done # while read host fi # if [ -s ${split_file} ] # The data of the pseudo hosts has been split off from the entire scc-data of the host. # Now we can generate the new snapshot for the local host. { grep -l "^fix:messages::" ${TMP2_FILE} >/dev/null 2>/dev/null if [ $? -eq 0 ] then echo "fix:messages::inspect scc.${name}.cur to determine cause of messages in system/user-modules" fi echo "var:general::date:${d_n}" echo "var:general::start time:${t_n_b}" echo "var:general::stop time :${t_n_e}" echo "var:general::runtime:${runtime}" echo "var:general::remark:${remark}" if [ ${restart} -eq 1 ] then echo "var:general::restart:true" fi cat ${TMP2_FILE} rm -f ${TMP2_FILE} } >${SCC_DATA}/scc.${name}.new # When diff is implemented by BusyBox, we cannot parse the differences for the logbook. # Changing the order of two lines and deleting a line only signals the deleted line, not the swap of the lines. # In that case, all compares should be done on the server (which should provide a non-busybox diff). export REMOTE_COMPARE="" busybox_check diff if [ $? -ne 0 ] then export REMOTE_COMPARE=yes else # In case the distro does not provide diff: diff_exe="$(which diff 2>/dev/null)" if [ ! -x "${diff_exe}" ] then export REMOTE_COMPARE=yes fi fi # Compare with previous snapshot and generate html-files. { echo "${name} local" if [ -s ${split_file} -a ${virtual_host} -eq 0 ] then awk -F"|" '/^host\|/ { if ( $3 == "local" || $3 == "remote" ) print $2, $3 }' ${split_file} fi } | sort -u | while read host compare do if [ "${REMOTE_COMPARE}" ] then compare=remote fi new_snapshot=${SCC_DATA}/scc.${host}.new prev_snapshot=${SCC_DATA}/scc.${host}.cur old_snapshot=${SCC_DATA}/scc.${host}.old logfile=${SCC_DATA}/scc.${host}.log if [ ! -f ${SCC_DATA}/scc.${host}.new ] then # No data split off. if [ "${compare}" = "local" ] then # No new data available, do nothing. Previous data will be send to server. : else # Remove all files, to avoid that anything is send to the server. rm -f ${SCC_DATA}/scc.${host}.cur \ ${SCC_DATA}/scc.${host}.log \ ${SCC_DATA}/scc.${host}.html \ ${SCC_DATA}/scc.${host}.log.html fi continue fi if [ "${compare}" = "local" ] then # During the post-install run of each install, rpm and pkg_info cannot be used and # the snapshot does not contain any rpm- and pkg_info data. During runs after the # installs, rpm- and pkg_info data is collected and copied to the keep-file. During # post-install runs of upgrades, the data (of the previous run) is copied from the # keep file. This strategy does not work immediately after the initial install as # the keep-file is empty in this case. Ignore corresponding log-messages, but signal # this in the remark in the logfile (when the -c option was not used). log_remark="${remark}" # To avoid some superfluous changes, we ignore some data. # We use a sed file to remove data from the snapshot prior to comparing. # Paul te Vaanholt indicated problems with the previous construction. >${TMP1_FILE} # 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 log file, by ignoring all # rpm-data when the old (current) snapshot does not contain # any rpm-data. # Ignore this when rpm is implemented by busybox. busybox_check rpm if [ $? -eq 0 -a -x /bin/rpm -a -f "${prev_snapshot}" -a -z "${SCC_INSTALL_PHASE:-}" ] then # No busybox rpm, there is a previous snapshot and we are NOT in the installation process. if [ "$(/bin/rpm -qa 2>/dev/null | wc -l)" -ne 0 ] then grep -l "^fix:software:installed-rpms:" "${prev_snapshot}" >/dev/null 2>/dev/null if [ $? -ne 0 ] then # No rpm-data in current (previous) snapshot. So this is the first run after the initial install. echo "/^new::software:installed-rpms:/d" >>${TMP1_FILE} [ -z "${log_remark}" ] && log_remark="rpm changes are ignored on the first run after the initial install" fi # AIX lists all rpms also as native installp packages. Ignore these too. if [ "$(uname -s)" = "AIX" ] then grep -l "^fix:software:installed-aix-filesets:" "${prev_snapshot}" >/dev/null 2>/dev/null if [ $? -ne 0 ] then echo "/^new::software:installed-aix-filesets:/d" >>${TMP1_FILE} fi fi grep -l "^fix:software:rpm:imported keys:" "${prev_snapshot}" >/dev/null 2>/dev/null if [ $? -ne 0 ] then # RPM is being used, but imported keys have to be checked separate. grep -l "^fix:software:rpm:imported keys:" "${new_snapshot}" >/dev/null 2>/dev/null if [ $? -eq 0 ] then # No rpm-data in current (previous) snapshot and data present in new snapshot. echo "/^new::software:rpm:imported keys:/d" >>${TMP1_FILE} [ -z "${log_remark}" ] && log_remark="rpm imported keys changes are ignored on the first run after the initial install" fi fi fi fi # During install, the BSD package database is locked and cannot return # the installed packages. After the installation, the new snapshot # contains package-data, but the old snapshot does not contain # package-data. Avoid messages in the log file, by ignoring all # package-data when the old (current) snapshot does not contain # any package-data. if [ -x /usr/sbin/pkg_info -o -x /usr/pkg/sbin/pkg_info ] then if [ -f "${prev_snapshot}" ] then grep -l "^fix:software:installed-BSD-packages:" "${prev_snapshot}" >/dev/null 2>/dev/null if [ $? -ne 0 ] then # No package-data in current (previous) snapshot. So this is the first run after the initial install. echo "/^new::software:installed-BSD-packages:/d" >>${TMP1_FILE} [ -z "${log_remark}" ] && log_remark="pkginfo changes are ignored on the first run after the initial install" fi fi fi # Moving data from the main-snapshot through the split-file should not # add to the differences when the split-file is created or extended. # Only appplicable for the "main"-snapshot. if [ "${host}" = "${name}" -a -f ${split_file} -a -f "${prev_snapshot}" ] then # Retrieve the classifications of data that is moved. # Adjust them to delete-statements in a sed-file. # Replace all '/' by '\/' to avoid syntax errors. sed -n \ -e 's/|$//' \ -e 's@^class|.*|mv|\(.*\)|.*@\1@p' \ -e 's@^class|.*|mv|\(.*\)@\1@p' \ <${split_file} | sed -e 's@/@\\/@g' \ -e 's@^@/@' \ -e 's@$@/d@' \ >>${TMP1_FILE} fi ignore="-f ${TMP1_FILE}" ${SCC_BIN}/scc-cmp "${prev_snapshot}" "${new_snapshot}" "${log_remark}" "${ignore}" >>${logfile} rm -f ${TMP1_FILE} else # if [ "${compare}" = "local" ] # Just empty the logfile to indicate to the server a remote compare. >${logfile}; fi if [ -f ${prev_snapshot} ] then rm -f ${old_snapshot} mv -f ${prev_snapshot} ${old_snapshot} fi mv -f ${new_snapshot} ${prev_snapshot} if [ -s ${logfile} ] then nice ${SCC_BIN}/scc-log2html ${host} <${logfile} >${logfile}.html else > ${logfile}.html fi # The file with the previous snapshot has been replaced by the new (current) snapshot. nice ${SCC_BIN}/scc-snap2html ${host} <${prev_snapshot} >${SCC_DATA}/scc.${host}.html done if [ ${virtual_host} -eq 0 ] then # 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. scc_html_head "Index for ${name}" >${index} cat <<-_X_ >>${index} snapshot of ${name}
logbook of ${name} _X_ fi exit 0 scc/scc-run/opt/scc/bin/scc-log2html010050000000000000003000000300151167217303300173710ustar00rootsys00000000000000#!/bin/sh # Shell script to convert a SCC logbook to html-format. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc-log2html $ # ID: $Id: scc-log2html 4795 2011-11-13 19:24:45Z siemkorteweg $ set -u ProgName=${0##*/}; export ProgName standalone="" if [ "X${1}" = "X--standalone" -o "X${1}" = "X-s" ] then standalone="yes" shift 1 fi if [ $# -ne 1 ] then echo "Syntax error, use ${ProgName} [ -s|--standalone ] " >&2 exit 1 fi SCC_BIN=/opt/scc/bin SCC_TOP=/var/opt/scc export SCC_BIN SCC_TOP # Perform the security settings before calling any program. PATH=/sbin:/usr/sbin:/usr/bin:/bin; export PATH 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 cd ${SCC_TMP} umask 077 . ${SCC_BIN}/scc_modules/scc_utils export TMP_FILE=${SCC_TMP}/scc_log_html_$$ trap "rm -f ${TMP_FILE}" 0 trap "exit 2" 1 2 3 15 # Replace special HTML-characters in input. sed -e 's/&/\&/g' \ -e 's//\>/g' \ -e "s/'/\'/g" \ -e 's/"/\"/g' >${TMP_FILE} if [ ! -s ${TMP_FILE} ] then exit 0 fi # In standalone mode and with only one run, we do not generate statistics. single_run="" if [ "${standalone}" ] then first_run_time="$(head -n 1 ${TMP_FILE} | sed -e 's/:[^0-9].*//')" last_run_time="$(tail -n 1 ${TMP_FILE} | sed -e 's/:[^0-9].*//')" if [ "${first_run_time}" = "${last_run_time}" ] then single_run="yes" fi fi TABLE_TAG="" TOP_NAME="" TOP_URL="Top    " echo '' echo "" echo "" if [ -z "${standalone}" ] then echo '' else if [ -f "${SCC_DATA}/style.css" ] then echo '" fi fi echo "Logbook: $1" echo "" echo "" echo "
"; echo "${TOP_NAME}" echo "

Logbook: ${1}

" # DO NOT CHANGE THE FOLLOWING HTML-CODE WITHOUT CONSULTING scc.cgi IN scc-srv if [ -z "${single_run}" ] then echo "
"; echo "

" if [ -z "${standalone}" ] then echo " Home    " echo " Configuration    " fi echo ' Statistics' echo "

" echo "
"; echo "

Summary of runs of SCC

" else echo "

Run of SCC

" fi # 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. awk -F: '/:result::/ { stat_cnt_runs++; if ( length( prev_res ) ) { # restart or identical, no number of differences. print prev_res ":" ":" prev_runtime ":" prev_remark; prev_remark=""; prev_runtime=""; } prev_res=$0; } /:remark::/ { # A remark can contain ":", syntax of a line is: :
"; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print ""; print ""; tr_c = "Even"; } } /^0:/ { # We print the statistics as pre-formatted text. # Last part of the data. The END-statement takes care of the . # Format of the data is: #0::"; print "
DateTimeRuntimeResultCountRemark
"; print ""; statistics=1; # Heading done! if ( length( single_run ) ) { next; } print "
"; print "
"; print "" printf( "

%sStatistics

\n", t ); print u; print ""; print " "; print " Category"; print " Value"; print " "; print ""; print ""; s_tr="Even"; } if ( length( single_run ) ) { next; } print ""; if ( s_tr != "Even" ) { s_tr = "Even"; } else { s_tr = "Odd"; } print " " $3 ""; # Category print " " $4 ""; # Value print ""; next; } { # Show data of a run. # Format of the input is: #:
"; } }' single_run="${single_run}" t="${TOP_URL}" u="${TABLE_TAG}" # When sorting the logdata, we want to preserve the order of the data within each single run. # As we sort descending, we use - . # First determine the total_line_nr: total_cnt="$(wc -l <${TMP_FILE})" # 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 log file, most recent run first, # within the run keep the data in the order of the log file. log_date=$1; log_time=$2; gsub( "-", "", log_date ); gsub( /\./, "", log_time ); printf( "%s:%s:%010.10d:%s\n", log_date, log_time, total - NR, $0 ); }' total="${total_cnt}" ${TMP_FILE} | sort -r | sed -e 's/^[0-9]*:[0-9]*:[0-9]*://' | awk -F":" 'BEGIN { first_log_entry = 1; } /: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 "
"; if ( first_log_entry ) { print "
"; first_log_entry=0; } printf( "

%sBack    ", u, $1, $2, $1, $2 ); printf( "Differences at: %s %s

\n", $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 or ctx for unchanged data with context diff # $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 "

"; print "
";
					prev_class=class;
				}
				if ( change == "ctx" )
				{
					printf( "	", change );
				}
				else
				{
					printf( "%s:	", change, 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 } print "
"; if ( first_log_entry == 0 ) # Have any log-entries been printed? { print "
"; # Mark the end of all log-entries. } }' u="${TOP_URL}" rm -f ${TMP_FILE} echo "

Generated by SCC (© QNH) on $(date)

\n" echo ""; echo "" echo "" exit 0 scc/scc-run/opt/scc/bin/scc-plugin010050000000000000003000000054241167217303400171460ustar00rootsys00000000000000#!/bin/sh # Shell script for plugins for SCC. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc-plugin $ # ID: $Id: scc-plugin 4778 2011-09-01 20:26:52Z siemkorteweg $ 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}/scc_modules/scc_utils # Start the code for the plugin. # Notice: # - all output lines should start with "fix:", "var:" or "hlp:". # - refer to scc_utils for the functions that are provided. # When called by scc-collect, the following file(names) are available: # ${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. # When called by scc-collect, the following environment variables are available: # SCC_MODULE name of the current module # 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-snap2html010050000000000000003000000454111167217303400175600ustar00rootsys00000000000000#!/bin/sh # Shell script to convert collected configuration data to HTML-format. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc-snap2html $ # ID: $Id: scc-snap2html 4790 2011-11-12 21:04:22Z siemkorteweg $ set -u 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 # Perform the security settings before calling any program. PATH=/sbin:/usr/sbin:/usr/bin:/bin; export PATH umask 077 cd ${SCC_TMP} standalone="" if [ "X${1}" = "X--standalone" -o "X${1}" = "X-s" ] then standalone="yes" shift 1 fi if [ $# -ne 1 ] then echo "Syntax error, use ${ProgName} [ -s|--standalone ] " >&2 exit 1 fi . ${SCC_BIN}/scc_modules/scc_utils export TMP_FILE=${SCC_TMP}/scc_html_$$ export TMP_STATS=${SCC_TMP}/scc_tmp_stats_$$ export IND_FILE=${SCC_TMP}/scc_ind_$$ export HLP_CLASSES=${SCC_TMP}/scc_help_c_$$ export HLP_USED=${SCC_TMP}/scc_help_u_$$ export STAT_DATA=${SCC_TMP}/scc_stats_$$ trap "rm -f ${TMP_FILE} ${TMP_STATS} ${IND_FILE} ${HLP_CLASSES} ${HLP_USED} ${STAT_DATA}" 0 trap "exit 2" 1 2 3 15 pre_process_data() { # 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 '/^fix:|^var:|^hlp:/ { print; next } { print "fix:unexpected data::" $0 }' } prepare_stats() { # Input is regular snapshot data. # Count lines starting with "fix" or "var". # Count the number and percentage of lines with the first and the second classification. awk -F: '/^fix/ { fix_cnt+=1; } /^var/ { var_cnt+=1; } /^hlp/ { next } # hlp-info is excluded from statistics. { c=sprintf( "%s:%s", $2, $3 ); main_cnt[ $2 ] += 1; sub_cnt[ c ] += 1; } END { total = fix_cnt + var_cnt; printf( "%s::%d:%d:%d:%d\n", "fix", total, 100, fix_cnt, 0.5 + ( 100 * fix_cnt ) / total ); printf( "%s::%d:%d:%d:%d\n", "var", total, 100, var_cnt, 0.5 + ( 100 * var_cnt ) / total ); for ( s in sub_cnt ) { split( s, part, ":" ); main_counter = main_cnt[ part[ 1 ] ]; # Use a separate, temporary file for the statistics as the process generating the # statistics requires first the "fix" and then the "var" statistics. # Use broad, fixed width numbers to enable usage of busybox sort to order the data. printf( "%010.10d:%010.10d:%s:%d:%d\n", main_counter, sub_cnt[ s ], s, 0.5 + ( 100 * main_counter ) / total, 0.5 + ( 100 * sub_cnt[ s ]) / main_counter ) >>tmp; } }' tmp=${TMP_STATS} sort -r ${TMP_STATS} rm -f ${TMP_STATS} # Format of the output: # fix/var:::100:: # ::::: } TOP_NAME="" TOP_URL="Top    " # Generate the heading of the HTML file. gen_header() { echo '' echo "" echo "" if [ -z "${standalone}" ] then echo '' else if [ -f "${SCC_DATA}/style.css" ] then echo '" fi fi echo "Configuration: ${1}" echo "" echo "" echo "
"; echo "${TOP_NAME}" echo "

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

" echo "
"; # DO NOT CHANGE THE FOLLOWING HTML-CODE WITHOUT CONSULTING scc.cgi IN scc-srv echo "

" if [ -z "${standalone}" ] then echo " Home    " echo " Logbook    " fi echo " Statistics    " echo " Legend" echo "

" echo "
"; } prepare_help() { # Get all the help classifications from the snap-shot. sed -n \ -e 's/::.*//' \ -e 's/\\/_/g' \ -e '/^hlp:/p' ${TMP_FILE} 2>/dev/null | sort -u >${HLP_CLASSES} } # Initialize the file containing the classifications of the help-info that is referenced. >${HLP_USED} # Generate the entire hierarchical menu from the classifications in the data gen_menu() { 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]:" | sed -e 's/^var://' \ -e 's/^fix://' \ -e 's/::.*//' \ -e 's/\\/_/g' | awk -F: '{ # Make sure that each classification is treated once if ( done[ $0 ] ) { next; } done[ $0 ] = 1; # Format of the input is (for level 3 classification): # a:b:c # Generate: # - level 1 menu item: a # - level 2 menu item: a:b # - level 3 menu item: a:b:c # Each line of output has the following format: # ::: for ( level = 1; level <= NF; level++ ) { if ( level == 1 ) { prev_id = 11; class = $1; } else { prev_id = id[ class ]; class = sprintf( "%s:%s", class, $level ); } if ( ! id[ class ] ) { # One line may cause several new submenus. id[ class ] = ( 10 * NR ) + level; # Use broad, fixed width numbers to enable usage of busybox sort to order the data. printf( "%03.3d:%010.10d:%010.10d:%s\n", level, prev_id, NR, class ); } } }' - | sort | awk -F: '/^hlp:/ { # Format of the data is: # hlp::: class = $2; for ( i = 3; ( i <= NF ) && ( length( $i ) > 0 ); i++ ) { class = sprintf( "%s_%s", class, $i ); } gsub( /[^A-Za-z0-9_.-]/, "_", class ); # W3C restrictions and no ":". help_avail[ class ] = 1; next; } { # Format of the data is: # ::: if ( $1 != prev_level ) { prev_level=$1; if ( NR > 1 ) { print "
"; } } if ( ( $1 > 1 ) && ( $2 != prev_menu ) ) { # Produce the heading of a submenu (name, top-reference, optional help, label). print "

" # Produce the name of this submenu. url = $4; for ( i = 5; i < NF; i++ ) { url = sprintf( "%s_%s", url, $i ); } gsub( /[^A-Za-z0-9_.-]/, "_", url ); # W3C restrictions and no ":". printf( " \n", url ); print " " u; # Reference to TOP if ( help_avail[ url ] ) { printf( " Help    ", url ); print "hlp_" url >>t; # Indicate that this help-info is referenced. } # Produce references to parent menus. url = "cfg" for ( i = 4; i < ( NF - 1 ); i++ ) { url = sprintf( "%s_%s", url, $i ); gsub( /[^A-Za-z0-9_.-]/, "_", url ); # W3C restrictions and no ":". printf( " %s - \n", url, $i ); } print " " $i; print "

" prev_menu = $2; } url = $4; for ( i = 5; i <= NF; i++ ) { url = sprintf( "%s_%s", url, $i ); } gsub( /[^A-Za-z0-9_.-]/, "_", url ); # W3C restrictions and no ":". printf( " %s
\n", url, $NF ); }' \ t="${HLP_USED}" \ u="${TOP_URL}" \ ${HLP_CLASSES} \ - echo "
"; } # Generate all the data gen_data() { help_classes="${1}" data="${2}" echo "
"; # The entire menu-structure has been built. # Show all the data. # To "group" all data per classification, we rewrite the snapshot. # - each "new" classification 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. ( cat "${help_classes}" awk -F":" '/^fix:|^var:/ { # Get the classification, ignore the first part: fix/var. class = $2; for ( i = 3; ( i <= NF ) && ( length( $i ) > 0 ); i++ ) { class = sprintf( "%s - %s", class, $i ); } if ( ! id[ class ] ) { id[ class ] = NR; printf( "%010.10d:%010.10d:%s:%s", NR, 0, class, $2 ); for ( i = 3; ( i <= NF ) && ( length( $i ) > 0 ); i++ ) { printf( ":%s", $i ); } print ""; } # Use broad, fixed width numbers to enable usage of busybox sort to order the data. printf( "%010.10d:%010.10d:%s\n", id[ class ], NR, $0 ); }' "${data}" | sort ) | awk -F":" '\ /^hlp/ { # Syntax of each line: #hlp: help_avail[ $0 ]=1; next; } /^[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 ); # Check whether help-info is available. class="hlp"; for ( i = 4; ( i <= NF ) && ( length( $i ) > 0 ); i++ ) { class=sprintf( "%s:%s", class, $i ); } if ( help_avail[ class ] ) { gsub( /[^A-Za-z0-9_.-]/, "_", class ); # W3C restrictions and no ":". printf( "Help    ", class ); print class >>t; } class=$4; for ( i = 5; ( i <= NF ) && ( length( $i ) > 0 ); i++ ) { class=sprintf( "%s_%s", class, $i ); } gsub( /[^A-Za-z0-9_.-]/, "_", class ); # W3C restrictions and no ":". printf( "", class ); # Produce the name of this sub-menu/data # References to all previous menus in the hierarchy. tag = ""; sep = ""; for ( depth = 4; ( depth < NF ) && ( length( $(depth + 1) ) > 0 ); depth++ ) { tag = sprintf( "%s_%s", tag, $depth ); gsub( /[^A-Za-z0-9_.-]/, "_", tag ); # W3C restrictions and no ":". printf( "%s%s\n", sep, tag, $depth ); sep = " - "; } print " " sep $depth; print "

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

		# Format is: ::::
		if ( $3 == "hlp" )
		{
			next;	# help-info is processed later in this program.
		}

		# Show var-data in a different color.
		var_font_start=""
		var_font_end=""
		if ( ( $3 != "fix" ) && ( c != "no_color" ) )
		{
			var_font_start=sprintf( "" );
			var_font_end=""
		}

		if ( general )
		{
			# Format of the data is:
			#::fix_or_var:general::
" }' t="${HLP_USED}" \ u="${TOP_URL}" \ - echo "
"; } # Generate the statistics gen_stats() { # Calculate and show the statistics. echo "
"; echo "
" echo "

${TOP_URL}Statistics

" echo "

Help-info is excluded from the statistics.

" # The first two lines of the input contain the statistics concerning the fix and var lines. # These are shown in a separate table. awk -F: '/^fix:/ { print "" print ""; print ""; print " "; print " "; print " "; print ""; print ""; print ""; print ""; print " "; print " "; print " "; print ""; next; } /^var:/ { print ""; print " "; print " "; print " "; print ""; print ""; print " "; print " "; print " "; print ""; print ""; print "
CategoryCountPercentage
" $1 "" $5 "" $6 "
" $1 "" $5 "" $6 "
" "total" "" $3 "" $4 "
" next; } { if ( header_done == 0 ) { s_tr="Odd"; print "
" print "" print ""; print ""; print " " print " " print " " print " " print " " print " " print "" print ""; header_done = 1; print ""; } # Format of the data: # ::::: if ( $3 != prev ) { if ( s_tr != "Even" ) { s_tr = "Even"; } else { s_tr = "Odd"; } # Print the main-count and the main-perc url = $3; gsub( /[^A-Za-z0-9_.-]/, "_", url ); # W3C restrictions and no ":". print ""; printf( " \n", url, $3 ); print " "; sub( "^0*", "", $1 ); # Required for awk by busybox printf( " \n", $1 ); printf( " \n", $5 ); print " "; print " "; print ""; prev = $3; } if ( length( $4 ) > 0 ) { if ( s_tr != "Even" ) { s_tr = "Even"; } else { s_tr = "Odd"; } # Print the sub-count and the sub-perc url = sprintf( "%s_%s", prev, $4 ); gsub( /[^A-Za-z0-9_.-]/, "_", url ); # W3C restrictions and no ":". print ""; print " "; sub( "^0*", "", $4 ); # Required for awk by busybox printf( " \n", url, $4 ); print " "; print " "; printf( " \n", $2 ); printf( " \n", $6 ); print ""; } }' echo ""; echo "
Main classSub classMain cntMain percSub cntSub perc
%s   %d%d    
  %s     %d%d
"; echo "
"; } # Show all the help-info gen_help() { # Determine the available classes. echo "
"; awk -F: '\ /^hlp_/ { hlp_used[ $0 ] = 1; next; } /^hlp:/ { class=$0; sub( /::.*/, "", class ); gsub( /[^A-Za-z0-9_.-]/, "_", class ); # W3C restrictions and no ":". if ( ! hlp_used[ class ] ) { next; } if ( class != prev_class ) { if ( length( prev_class ) ) { print ""; # Some config files can be checked more than once. # Show the helpinfo only once to avoid double definition of NAME entry. hlp_used[ prev_class ] = 0; } prev_class=class; print "
"; printf( "\n", class ); printf( "

%s", u ); back="cfg"; for ( i = 2; ( i <= NF ) && ( length( $i ) > 0 ); i++ ) { back=sprintf( "%s_%s", back, $i ); } gsub( /[^A-Za-z0-9_.-]/, "_", back ); # W3C restrictions and no ":". printf( "Back    ", back ); printf( "%s", $2 ); for ( i = 3; ( i <= NF ) && ( length( $i ) > 0 ); i++ ) { printf( " - %s", $i ); } print "

"; print "
"
				}

				# Ignore the classification.
				for ( i = 1; ( i <= NF ) && ( length( $i ) > 0 ); i++ )
				{ }
				i++;		# skip ::

				data=$i
				for ( i++; i <= NF; i++ )
				{
					data=sprintf( "%s:%s", data, $i );
				}
				print data;
			}
		END	{
				if ( length( prev_class ) )
				{
					print "
" } }' u="${TOP_URL}" echo "
"; } # Generate the legend and terminate the html file gen_trailer() { echo "
" echo "

${TOP_URL}Legend

" echo "

" echo "Fix data in the snapshot has a default color." echo "Variable data in the snapshot has a specific color." echo "

" echo "
" echo "

Generated by SCC (© QNH) on $(date)

\n" echo "
"; echo "" echo "" } pre_process_data >${TMP_FILE} prepare_stats <${TMP_FILE} >${STAT_DATA} prepare_help <${TMP_FILE} >${HLP_CLASSES} # Generate the entire HTML file: ( gen_header ${1} # No input required gen_menu <${TMP_FILE} # also writes in ${HLP_USED} gen_data "${HLP_CLASSES}" "${TMP_FILE}" gen_stats <${STAT_DATA} cat ${HLP_USED} ${TMP_FILE} | gen_help gen_trailer # No input required ) exit 0 scc/scc-run/opt/scc/bin/scc_modules/004075500000000000003000000000003777777777700175345ustar00rootsys00000000000000scc/scc-run/opt/scc/bin/scc_modules/scc_0000_s_general010050000000000000003000000340651167217303400226330ustar00rootsys00000000000000#!/bin/sh # Shell script to collect general data. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc_modules/scc_0000_s_general $ # ID: $Id: scc_0000_s_general 4778 2011-09-01 20:26:52Z siemkorteweg $ set -u . ${SCC_BIN}/scc_modules/scc_utils ## START: GENERAL echo "fix:general::layout-version:1.17.23" echo "fix:general::hostname:${HOSTNAME}" if [ -x /bin/dnsdomainname ] then DOMAIN=$(/bin/dnsdomainname 2>/dev/null) elif [ -x /bin/domainname -a "${OS_NAME}" = "Darwin" ] then DOMAIN=$(/bin/domainname) # Indicated by Antoine Davous. fi if [ -z "${DOMAIN:-}" ] then DOMAIN=${hostname#*.} if [ "${DOMAIN}" = "${hostname}" -a -f /etc/resolv.conf ] then DOMAIN=$(awk '/^domain/ { print $2 }' /etc/resolv.conf 2>/dev/null | tail -n 1) fi if [ "${DOMAIN}" = "${hostname}" ] then ns_exe="$(which nslookup 2>/dev/null)" if [ -x "${ns_exe}" ] then DOMAIN=$(nslookup ${hostname} 2>/dev/null | sed -n "s/^Name.*${hostname}\.//p") else DOMAIN="" fi fi fi echo "fix:general::domain:${DOMAIN}" echo "fix:general::nodename:$(uname -n)" scc_check_file /etc/nodename "fix:general::/etc/nodename:" "#" 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)" elif [ "${OS_NAME}" = "SunOS" ] then echo "fix:general::model:$(uname -i | sed -e 's/.*,//')" elif [ "${OS_NAME}" = "AIX" ] then # Contributed by Doug Probst. echo "fix:general::model:$(lsattr -El sys0 -a modelname | cut -d"," -f2 | cut -d" " -f1)" elif [ -x /sbin/hwmgr ] then # TRU64 echo "fix:general::model:$(/sbin/hwmgr get attribute -id 1 2>&1 | sed -n -e 's/^ *name = //p')" elif [ -x /usr/sbin/dmidecode ] then model="$(/usr/sbin/dmidecode 2>/dev/null | grep -vi \ -e 'Not Specified' \ -e 'Not Applicable' \ -e 'Not Available' \ -e 'To Be Filled By O.E.M' \ -e 'None' \ -e 'unknown' | awk '/^[ ]*System Information/ { started = 1; next } /^[ ]*Manufacturer/ { if ( started ) { sub( ".*Manufacturer.[ ]*", "" ); man = $0; prd=""; ver=""; } next } /^[ ]*Product Name/ { if ( started ) { sub( ".*Product Name.[ ]*", "" ); prd = $0 } next } /^[ ]*Version/ { if ( started ) { sub( ".*Version.[ ]*", "" ); ver = $0 } next } /^Handle/ { started = 0; next } END { data = sprintf( "%s %s %s", man, prd, ver ); gsub( "[ ][ ]*", " ", data ); print data; }')" if [ "${model}" != " " ] # Two spaces separating 3 empty attributes then echo "fix:general::model:${model}" fi elif [ -x /usr/bin/lshal ] then #system.hardware.version = '1.2' (string) #system.hardware.product = 'VirtualBox' (string) #system.hardware.vendor = 'innotek GmbH' (string) model="$(lshal -l -u /org/freedesktop/Hal/devices/computer 2>/dev/null | sed -e "s/'//g" \ -e '/Not Specified/d' | awk '/system.hardware.version/ { ver=$3; next } /system.hardware.product/ { prod=$3; next } /system.hardware.vendor/ { vendor=$3; next } END { data = sprintf( "%s %s %s", vendor, prod, ver ); gsub( "[ ][ ]*", " ", data ); print data; }')" if [ "${model}" != " " ] # Two spaces separating 3 empty attributes then echo "fix:general::model:${model}" fi elif [ -f /var/run/dmesg.boot ] then # For BSD systems, example line: #bios0: VMware, Inc. VMware Virtual Platform # Get the last line starting with bios0 and ignore the ROM list sed -n -e '/ ROM /d' -e 's/^bios0: /fix:general::model:/p' /var/run/dmesg.boot | tail -n 1 fi if [ -x /usr/bin/hostid ] then echo "var:general::hostid:$(/usr/bin/hostid 2>/dev/null)" elif [ "${OS_NAME}" = "AIX" ] then # Doug Probst: get the serial number of the CEC, needed for all service calls. echo "fix:general::serial number:$(lsattr -El sys0 -asystemid | cut -d"," -f2 | cut -d" " -f1)" elif [ "${OS_NAME}" != "Linux" ] then echo "fix:general::serial number:$(uname -i 2>/dev/null)" fi if [ "${OS_NAME}" = "HP-UX" ] then if [ -x /usr/contrib/bin/machinfo ] then /usr/contrib/bin/machinfo | sed -n -e 's/.*machine serial number = /fix:general::System Serial Number:/p' else scc_help_info "fix:general::" <<-_X_ The System Serial can be retrieved fast by means of machinfo. When this program is absent, it is obtained via stm in the hardware module. At the next run of scc it is present under class "general". _X_ serial="$(grep "fix:general::System Serial Number:" ${SCC_KEEP_CONFIG} | tail -n 1)" if [ "${serial}" ] then echo "${serial}" >>${SCC_KEEP_NEW} echo "${serial}" fi fi elif [ "${OS_NAME}" = "OSF1" ] then # Contributed by Mattijs de Ruijter. echo "fix:general::System Serial Number:$(consvar -g sys_serial_num 2>/dev/null | awk '{ print $3 }')" 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 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 [ -f /proc/cpuinfo ] then cpu_cnt="$(grep -c "^processor" /proc/cpuinfo)" 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 -n 1 /proc/interrupts | wc -w) elif [ -x /usr/sbin/sizer ] then cpu_cnt=$(/usr/sbin/sizer -p) else cpu_cnt="?" if [ -x /sbin/sysctl ] # BSD systems then sysctl_cpu_cnt="$(/sbin/sysctl -n hw.ncpu 2>/dev/null)" if [ "${sysctl_cpu_cnt}" ] then cpu_cnt="${sysctl_cpu_cnt}" fi fi fi echo "fix:general::cpu_cnt:${cpu_cnt##* }" if [ "${OS_NAME}" = "HP-UX" ] then my_model="$(/usr/bin/model | awk -F/ '{ print $NF }')" grep "^${my_model}[ ]*" /usr/sam/lib/mo/sched.models /usr/lib/sched.models 2>/dev/null | head -n 1 | sed -e 's/^/fix:general::cpu-type:/' speed="$(echo "itick_per_usec/${HPUX_ADB_NMBR_FORMAT}" | adb ${HPUX_KERNEL} /dev/kmem 2>/dev/null | awk '/[0-9]$/ { print $2 }')" if [ -n "${speed}" ] then echo "fix:general::cpu-speed:${speed} Mhz" fi elif [ "${OS_NAME}" = "AIX" ] then prtconf 2>/dev/null | awk -F: '/CPU Type/ { print prefix "cpu-type:" $2, "(" l ")" } /Processor Type/ { l = $2; } /Processor Clock Speed/ { print prefix "cpu-speed:" $2 }' prefix="fix:general::" elif [ -f /proc/cpuinfo ] then awk '/^cpu.*H[zZ]/ { print "var:general::cpu-speed:" $4, $2; # MHz or GHz exit; }' /proc/cpuinfo elif [ -x /sbin/sysctl ] then sysctl_cpu_type="$(/sbin/sysctl -n hw.model 2>/dev/null)" if [ "${sysctl_cpu_type}" ] then echo "fix:general::cpu-type::${sysctl_cpu_type}" fi elif [ -x /usr/sbin/psrinfo ] then # CPU speed can be variable on OpenSolaris. /usr/sbin/psrinfo -v | sed -n -e 's/,//' \ -e 's/.*operates at /var:general::cpu-speed:/p' | head -n 1 fi echo "fix:general::OS-name:${OS_NAME}" echo "fix:general::license:$(uname -l 2>/dev/null)" if [ -x /usr/bin/oslevel ] then # Doug Probst: added -r to display maintenance level. release=$(/usr/bin/oslevel -r 2>/dev/null) else if [ -x /usr/sbin/sizer ] then # TRU64: sizer -v returns more detailled data. release="$(/usr/sbin/sizer -v | awk '{ if ( $3 ~ "^V" ) { print $3 } else { print $4 } }')" elif [ "${OS_NAME}" = "Linux" ] then echo "fix:general::linux kernel version:$(uname -r)" else release=$(uname -r) fi fi if [ "${OS_NAME}" != "Linux" ] then echo "fix:general::OS-release:${release}" fi echo "fix:general::OS-version-level:$(uname -v)" if [ -x /usr/bin/sw_vers ] then # Darwin: Mac OS X /usr/bin/sw_vers 2>/dev/null | sed -e 's/^/fix:general::sw_vers:/' fi 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 distro_class="fix:general:" if [ -n "${SCC_LINUX_DISTRO}" ] # Determined in scc-collect! then echo "${distro_class}:linux distro name:${SCC_LINUX_DISTRO}" fi scc_linux_distro "${distro_class}:linux distro" if [ "${OS_NAME}" = "SunOS" ] then scc_check_file /etc/release "fix:general::/etc/release:" "#" # Solaris fi 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/timezone ] then # On Sabayon this file does not contain a CR. ( cat /etc/timezone; echo ) | sed -e '/^$/d' \ -e 's/^/fix:general::timezone:/' elif [ -f /etc/sysconfig/clock ] then sed -e 's/[ ]*#.*//' \ -e '/^$/d' \ -e 's@^@fix:general::timezone:/etc/sysconfig/clock: @' /etc/sysconfig/clock elif [ -h /etc/localtime ] then scc_time_zone="$(ls -l /etc/localtime | sed -e 's@.*/@@')" echo "fix:general::timezone:/etc/localtime:${scc_time_zone}" else date '+%Z' | sed -e 's/^/fix:general::timezone:date:/' fi if [ "${scc_time_zone}" ] then # Keep for system-module echo "fix:general::timezone:${scc_time_zone}" >>${SCC_KEEP_NEW} fi if [ -x /sbin/hwclock ] then /sbin/hwclock -r 2>/dev/null | sed -e 's/^/var:general::hwclock:/' fi if [ -x /sbin/runlevel ] then echo "fix:general::run level:$(/sbin/runlevel 2>/dev/null)" elif [ -x /sbin/getrunlvl ] then echo "fix:general::run level:$(/sbin/getrunlvl)" else case "${OS_NAME}" in *BSD) echo "fix:general::run level:$(sysctl kern.securelevel 2>/dev/null)" ;; *) echo "fix:general::run level:$(who -r 2>/dev/null | awk '{ print $3 }')" ;; esac fi # Edit scc-localize to change the default setting of this variable. # There is not much use for a variable checksum of the root-passwd. # Do not add the checksum of the password to the snapshot when this variable is set to "var". if [ "${SCC_ROOT_PW:-}" != "var" ] then if [ -f /tcb/files/auth/system/default -a -r /tcb/files/auth/system/default ] then # HP-UX trusted system grep ":u_pwd" /tcb/files/auth/r/root elif [ -f /etc/shadow -a -r /etc/shadow ] then # default shadow password file grep "^root:" /etc/shadow elif [ -f /etc/master.passwd -a -r /etc/master.passwd ] then # FreeBSD, NetBSD and OpenBSD grep "^root:" /etc/master.passwd else # old-fashioned password file grep "^root:" /etc/passwd 2>/dev/null fi | scc_crypt | sed -e "s/^/fix:general::superuser password:/" fi 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/${HPUX_ADB_NMBR_FORMAT}" | 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 -n 1)" if [ "${memory}" ] then echo "fix:general::memory real:${memory}" echo "fix:general::memory available:$(dmesg | grep '^avail mem =' | tail -n 1)" else echo "fix:general::memory real:$(prtconf 2>/dev/null | sed -n -e 's/^Memory size: //p')" fi elif [ "$OS_NAME" = "AIX" ] then # bootinfo should have worked but does not, this does (Doug Probst). echo "fix:general::memory real:$(lsattr -El mem0 -a goodsize | awk '{ print $2 }') MB" elif [ -x /usr/bin/free ] then busybox_check free if [ $? -eq 0 ] # a real program then echo "fix:general::memory real:$(free -b | awk '/^Mem/ { print $2 / ( 1024 * 1024 ) }') MB" else # the busybox substitue echo "fix:general::memory real:$(free | awk '/Mem:/ { print $2 / 1024 }') MB" fi elif [ -f /proc/meminfo ] then echo "fix:general::memory:$(awk '/^MemTotal:/ { $1=""; print }' /proc/meminfo 2>/dev/null)" elif [ -x /sbin/hwmgr ] then echo "fix:general::memory:$(/sbin/hwmgr get attribute -id 1 2>&1 | sed -n -e 's/^memory//p')" fi if [ -x /usr/bin/pagesize ] then echo "fix:general::memory pagesize:$(/usr/bin/pagesize)" fi echo "var:general::uptime:$(uptime 2>/dev/null | sed -e 's/.* up //' -e 's/,.*//' -e 's/^ *//')" boot_time="$(who -b 2>/dev/null)" if [ "${boot_time}" ] then echo "var:general::boot time:${boot_time}" fi 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_boot010050000000000000003000000370531167217303400221620ustar00rootsys00000000000000#!/bin/sh # Shell script to collect boot data. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc_modules/scc_0100_s_boot $ # ID: $Id: scc_0100_s_boot 4778 2011-09-01 20:26:52Z siemkorteweg $ set -u . ${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/bootparams "fix:boot:config:/etc/bootparams::" "#" scc_check_file /boot/loader.rc "fix:boot:config:/boot/loader.rc::" "#" scc_check_file /etc/init.d/boot.local "fix:boot:config:/etc/init.d/boot.local::" "#" scc_check_file /etc/init.d/halt.local "fix:boot:config:/etc/init.d/halt.local::" "#" for file in /etc/init.d/.depend.* # Suse: paralel starting/stopping of services do scc_check_file "${file}" "fix:boot:config:${file}::" "#" done for file in /etc/init/* # Google Chrome OS do scc_check_file "${file}" "fix:boot:config:${file}::" "#" done scc_check_file /etc/rc.config "fix:boot:config:/etc/rc.config::" "#" scc_check_file /etc/rc.conf "fix:boot:config:/etc/rc.conf::" "#" scc_check_file /etc/rc.securelevel "fix:boot:config:/etc/rc.securelevel::" "#" scc_check_file /etc/rc.local "fix:boot:config:/etc/rc.local::" "#" scc_check_file /etc/rc.d/rc.local "fix:boot:config:/etc/rc.d/rc.local::" "#" scc_check_file /etc/rc.d/rc.sysinit "fix:boot:config:/etc/rc.d/rc.sysinit::" "#" scc_check_file /etc/rc.lkm "fix:boot:config:/etc/rc.lkm::" "#" scc_check_file /etc/rc.subr "fix:boot:config:/etc/rc.subr::" "#" scc_check_file /etc/sysctl.conf "fix:boot:config:/etc/sysctl.conf::" "#" scc_check_file /stand/bootconf "fix:boot:config:/stand/bootconf::" "#" scc_check_file /etc/rc.shutdown "fix:boot:config:/etc/rc.shutdown::" "#" scc_check_file /etc/shutdown.allow "fix:boot:config:/etc/shutdown.allow::" "#" | sort scc_check_file /bosinst.data "fix:boot:install:/bostinst.data::" "#" for file in /etc/rc.d/*.conf do scc_check_file "${file}" "fix:boot:install:${file}::" "#" done if [ -x /usr/sbin/beadm ] then # Display BootEnvironment data for OpenSolaris. # Most of it is variable. Need to split into fix and var? /usr/sbin/beadm list -H | sed -e 's/;/ /g' | while read item uuid remainder do echo "fix:boot:beadm:${item}::uuid: ${uuid}" /usr/sbin/beadm list -d "${item}" | sed -e "s/^/var:boot:beadm:${item}::dataset: /" /usr/sbin/beadm list -s "${item}" | sed -e "s/^/var:boot:beadm:${item}::snapshot: /" done fi if [ -x /usr/sbin/bootinfo ] then # Contributed by Doug Probst. echo "fix:boot:devices::IPL Device: $(bootinfo -b )" bootlist -m normal -o | awk 'BEGIN { printf( "fix:boot:devices::bootlist:" ); } { printf( " %s", $0 ); } END { printf( "\n" ); }' fi for file in /etc/insserv.conf /etc/insserv.conf.d/* /etc/insserv/overrides/* do scc_check_file "${file}" "fix:boot:insserv:${file}::" "#" done if [ -x /usr/sbin/lustatus -a "${OS_NAME}" = "SunOS" ] then /usr/sbin/lustatus 2>/dev/null | sed -e 's/^/fix:boot:boot environment:lustatus::/' # Example output of lustatus: #Boot Environment Is Active Active Can Copy #Name Complete Now On Reboot Delete Status #-------------------- -------- ------ --------- ------ ---------- #disk_a_S7 yes yes yes no - /usr/sbin/lustatus 2>/dev/null | awk '{ if ( NR > 3 ) print }' | while read BE do /usr/sbin/lufslist "${BE}" 2>/dev/null | sed -e "s/^/fix:boot:boot environment:lufslist ${BE}::/" done fi if [ -x /usr/bin/lifcp -o -x /usr/sbin/idisk ] then raw_boot="" if [ -x /usr/sbin/vxdctl ] then raw_boot="$(/usr/sbin/vxdctl list 2>/dev/null | sed -n -e 's@.*disk \([^ ]*\) .*@/dev/rdsk/\1@p')" fi if [ -f /etc/lvmtab ] then boot=$(/sbin/lvlnboot -v 2>&1 | awk '/Disk/ { print $1 } ') raw_boot="${raw_boot} $(echo "${boot}" | sed -e 's/dsk/rdsk/' -e 's/ .*//')" fi for b in ${raw_boot} do if [ ! -c "${b}" ] then continue fi if [ -x /usr/bin/lifcp ] then /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: @" fi if [ -x /usr/sbin/idisk ] then /usr/sbin/idisk "${b}" 2>/dev/null | sed -e "s@^@fix:boot:device:${b}::idisk: @" fi if [ -x /usr/sbin/efi_ls ] then # Remove the date and time. This reduces the amount of # differences when comparing snapshots of different systems. /usr/sbin/efi_ls -d "${b}" 2>/dev/null | awk '/^total/ { printf( "fix:boot:device:%s::efi_ls: %s\n", b, $0 ); next; } { data = ""; if ( NF > 1 ) { data = sprintf( "%-40s %s", $1, $(NF) ); } printf( "fix:boot:device:%s::efi_ls: %s\n", b, data ); }' b="${b}" fi done if [ -f /etc/lvmtab ] then # 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/vxdctl ] then /usr/sbin/vxdctl list 2>/dev/null | sed -e 's/^/fix:boot:info::vxdctl: /' fi fi if [ -x /usr/sbin/dmesg -a "${OS_NAME}" = "SunOS" ] then /usr/sbin/dmesg | grep "^root on" | tail -n 1 | sed -e 's/^/fix:boot:root-device::/' fi # On *BSD systems, the boot-messages are preserved in a seperate file. # Each reboot adds data to this file. On hard reboots it is initialized. scc_check_file "/var/run/dmesg.boot" "var:boot:/var/run/dmesg.boot::" "#" if [ -x "/usr/platform/$(uname -m 2>/dev/null)/sbin/eeprom" ] then /usr/platform/$(uname -m 2>/dev/null)/sbin/eeprom 2>/dev/null | sed -e 's/^/fix:boot:eeprom::/' fi for file in /etc/rc.config.d/* /etc/conf.d/* /etc/rc.conf.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 } { printf( "%s", p ); print; 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 if [ -x /sbin/rcorder ] then # List all boot scripts in the proper order and list the dependencies. # We separate the order and the dependencies to make changes of boot order more clear in the logbook. ( cd /etc/rc.d rcorder * 2>/dev/null | awk '{ printf( "fix:boot:rcorder:survey::%03d %s\n", NR, $0 ) }' ) for file in /etc/rc.d/* do if [ -f "${file}" ] then # The dependencies are marked by a comment line with a capitol keyword. sed -n -e "s@^\(# [A-Z][A-Z][A-Z]*: .*\)@fix:boot:rcorder:${file}::\1@p" "${file}" fi done fi if [ "${OS_NAME}" = "AIX" ] then for file in /etc/rc.* do scc_check_file "${file}" "fix:boot:rc-file:${file}::" "#" done fi if [ -x /sbin/startpar ] then for parm in boot start stop do # Data in these files is not sorted. Sort to avoid "extra" changes. scc_check_file "/etc/init.d/.depend.${parm}" "fix:boot:/etc/init.d/.depend.${parm}::" "#" | sort done fi if [ -d /etc/systemd ] then for entry in system user do scc_check_file /etc/systemd/${entry}.conf "fix:boot:systemd:${entry}:/etc/systemd/${entry}.conf::" "#" for sub_entry in /etc/systemd/${entry}/* do if [ -h ${sub_entry} ] then ls -l ${sub_entry} | sed -e "s@.*${sub_entry}@fix:boot:systemd:${entry}:dependencies:general::${sub_entry}@" elif [ -d ${sub_entry} ] then ls -l ${sub_entry}/* | sed -e "s@.*${sub_entry}/@fix:boot:systemd:${entry}:dependencies:${sub_entry}::@" fi done unit_dir="" if [ -x /usr/bin/pkg-config ] then unit_dir="$(/usr/bin/pkg-config systemd --variable=systemd${entry}unitdir 2>/dev/null)" fi if [ ! -d "${unit_dir}" ] then if [ -d /lib/systemd/${entry} ] then unit_dir=/lib/systemd/${entry} elif [ -d /usr/lib/systemd/${entry} ] then unit_dir=/usr/lib/systemd/${entry} fi fi for file in "${unit_dir}"/* do scc_check_file "${file}" "fix:boot:systemd:${entry}:unit:${file}::" "#" done done fi # On Server Optimized Linux /usr/local/etc is a symlink to /etc. Do not follow this symlink. if [ ! -h /usr/local/etc ] then for entry in /usr/local/etc/* do if [ -d "${entry}" ] then # Ignore ssh as it also contains the private key file. # Ignore rc.d as it contains the start-stop scripts itself (for FreeBSD). # Ingore codepages for FreeBSD. if [ "${entry}" != "/usr/local/etc/ssh" -a \ "${entry}" != "/usr/local/etc/rc.d" -a \ "${entry}" != "/usr/local/etc/codepages" ] then for f in ${entry}/* do scc_check_file "${f}" "fix:boot:rc-file:${entry##*/}/${f##*/}::" "#" done fi else # OSF1: Do not record the profiles of the users. name="${entry##*/}" if [ "${name%.*}" != "profile" ] then scc_check_file "${entry}" "fix:boot:rc-file:${entry##*/}::" "#" fi fi done fi # Ignore scripts, php and html files; we are not interested in code. # Ignore networking files as they are handled by the networking module. find /etc/sysconfig -type f 2>/dev/null | sed -e '/scripts\//d' \ -e '/\/networking\//d' \ -e '/\.php$/d' \ -e '/\.html$/d' | sort | while read file do scc_check_file "${file}" "fix:boot:sysconfig:${file}::" "#" done for file in /etc/default/* /etc/defaults/* do scc_check_file "${file}" "fix:boot:defaults:${file}::" "#" done if [ -x /usr/sbin/prtconf ] then if [ "$OS_NAME" = "AIX" ] then # Contributed by Doug Probst. echo "fix:boot:firmware::prtconf:$(/usr/sbin/prtconf 2>/dev/null | awk -F, '/Firmware Version/ {print $2}')" else /usr/sbin/prtconf -V 2>/dev/null | sed -e 's/^/fix:boot:firmware::prtconf: /' fi fi scc_check_file /etc/inittab "fix:boot:file:/etc/inittab::" "#" # Support for Grub1 and Grub2 grub_base=/igelleroot/boot/grub if [ ! -d "${grub_base}" ] then grub_base=/boot/grub fi if [ -d "${grub_base}" ] then for file in "${grub_base}"/*cfg "${grub_base}"/*map "${grub_base}"/*lst "${grub_base}"/*conf do scc_check_file "${file}" "fix:boot:grub:${file}::" "#" done fi if [ -x /sbin/lilo ] then /sbin/lilo -q -v 2>/dev/null | sed -e 's/^/fix:boot:lilo:lilo::/' scc_check_file /etc/lilo.conf "fix:boot:lilo:/etc/lilo.conf::" "#" fi scc_check_file /etc/milo.conf "fix:boot:file:/etc/milo.conf::" "#" # Alpha boot scc_check_file /etc/silo.conf "fix:boot:file:/etc/silo.conf::" "#" # SPARC boot scc_check_file /etc/palo.conf "fix:boot:file:/etc/palo.conf::" "#" # Palo boot manager scc_check_file /proc/cmdline "fix:boot:kernel /proc/cmdline::" "#" for dir in /sbin/rc*.d /etc/rc?.d /etc/rc.d/rc?.d /etc/rc.d/boot.d /etc/runlevels/* 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:run level:${dir}::@" done # Server Optimized Linux: SOL scc_check_file /etc/rc.d/runlevel.xml "fix:boot:run level:/etc/rc.d/runlevel.xml::" "#" for file in /etc/rc.d/cfg/* do scc_check_file "${file}" "fix:boot:run level:${file}::" "#" done for file in /etc/rc.d/rc.? do # Slackware if [ -h "${file}" ] then ls -l "${file}" | sed -e "s/.* -> /fix:boot:run level:${file##*/}::${file##*/} -> /" else scc_check_file "${file}" "fix:boot:run level:${file##*/}::" "#" fi done if [ -f /etc/rc.d./init.d ] then ls -l /etc/rc.d/init.d | awk '{ printf( "fix:boot:run level:/etc/rc.d/init.d::%-20s %s %s %s %s %s\n", $NF, $1, $2, $3, $4, $5 ); }' fi if [ -x /bin/rc-status ] then /bin/rc-status --list show | sed -e "s/^/fix:boot:rc runlevels::/" fi if [ -x /sbin/rc-update ] then # Do not use rc-status for Gentoo, as it show the current status of rc-scripts. rc-update -v show | sed -e "s/^/fix:boot:run level:rc-update::/" elif [ -x /bin/rc-status ] then /bin/rc-status -a -nc 2>/dev/null | sed -e "s/^/fix:boot:rc-status::/" fi if [ -x /usr/bin/lssrc ] then # AIX /usr/bin/lssrc -a | sed -e 's/^/var:boot:System Resource:survey::/' /usr/bin/lssrc -S | awk -F: '{ if ( NR == 1 ) { # Record the labels for the fields in the next lines. for ( i = 1; i < NF; i++ ) { label[ i ] = $i; } next; } # First field is the name of the subsystem, the field before the last colon is the group. group = $(NF-1); if ( length( group ) == 0 ) { group = "_NONE_" } for ( i = 2; i < ( NF - 1 ); i++ ) { printf( "fix:boot:System Resource:group %s:%s::%-20s: %s\n", group, $1, label[ i ], $i ); } }' | sort fi if [ -x /usr/bin/svcs ] then # SunOS /usr/bin/svcs -a 2>/dev/null | awk '/svc:/ { print $3 }' | sort | while read entry do # Example of entry: svc:/network/rpc/keyserv:default # The contract_id is incremented at each restart of the service: ignore. # The state_time is variable data, but can be usefull. # The logfile and alt_logfile are also variable. label=${entry#svc:/} /usr/bin/svcs -l "${entry}" 2>/dev/null | sed -e "/^contract_id/d" \ -e "s@^@${label}: @" \ -e "s@:@::@" \ -e "s@/@:@" | sed -e "s/^/fix:boot:svcs:/" \ -e "s/^fix:\(.*[ ]state_time[ ]\)/var:\1/" \ -e "s/^fix:\(.*[ ]logfile[ ]\)/var:\1/" \ -e "s/^fix:\(.*[ ]alt_logfile[ ]\)/var:\1/" done fi if [ -x /sbin/chkconfig ] then /sbin/chkconfig --list 2>/dev/null | sed -e '/^xinetd based services/,$d' | sort | sed -e 's/^/fix:boot:run level:chkconfig::/' fi if [ -x /usr/sbin/setboot ] then /usr/sbin/setboot 2>&1 | sed -e 's/^/fix:boot:stable-storage::/' fi if [ -x /sbin/consvar ] then /sbin/consvar -l 2>&1 | sed -e 's/^/fix:boot:firmware::/' fi for file in /etc/readahead.d/* do scc_check_file "${file}" "fix:boot:readahead:${file}::" "#" done scc_check_file /etc/zipl.conf "fix:boot:Z S/390:/etc/zipl.conf::" "#" exit 0 scc/scc-run/opt/scc/bin/scc_modules/scc_0200_s_hardware010050000000000000003000001573771167217303400230310ustar00rootsys00000000000000#!/bin/sh # Shell script to collect hardware data. # Copyright (C) 2001-2004 Open Challenge B.V. # Copyright (C) 2004-2005 OpenEyeT Professional Services. # Copyright (C) 2005-2011 QNH. # # 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, # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # Contact information: http://sourceforge.net/projects/sysconfcollect/support # This is a system module of scc, to call it separately in the # proper environment, use: scc-collect -i -e # SCC-release: 1.17.23 # URL: $URL: https://sysconfcollect.svn.sourceforge.net/svnroot/sysconfcollect/scc/trunk/scc_modules/scc_0200_s_hardware $ # ID: $Id: scc_0200_s_hardware 4778 2011-09-01 20:26:52Z siemkorteweg $ set -u . ${SCC_BIN}/scc_modules/scc_utils if [ -x /sbin/natacontrol ] then /sbin/natacontrol list 2>/dev/null | sed -e 's/^/fix:hardware:natacontrol::/' elif [ -x /sbin/atacontrol ] then # Do not call atacontrol on a system with natacontrol. It will hang. /sbin/atacontrol list 2>/dev/null | sed -e 's/^/fix:hardware:atacontrol::/' fi 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 " ${SCC_MODULE}: end of AutoRAID" fi if [ -x /usr/sbin/cfgadm ] then # Replace the value in the "busy" column to avoid differences. # Erase the dates to avoid differences. # Tape info is variable. cfgadm -lav 2>/dev/null | sed -e 's/ [ny] / - /' \ -e 's/^[A-Z][a-z][a-z] [0-9 ][0-9] [0-9][0-9][0-9][0-9]/ /' | awk '/^[^:][^:]*::rmt\// { print "var:hardware:cfgadm::" $0; next } { print "fix:hardware:cfgadm::" $0; next }' fi if [ -x /usr/sbin/consadm ] then /usr/sbin/consadm -p 2>/dev/null | sed -e 's/^/fix:hardware:consadm::/' fi if [ -x /usr/sbin/psrinfo ] then # CPU frequency is variable data on OpenSolaris. /usr/sbin/psrinfo -v | sed -e '/^Status/d' \ -e '/since/d' \ -e 's/^/fix:hardware:cpu psrinfo::/' | sed -e 's/^fix:\(.*processor operates at \)/var:\1/' fi sed -e "s@^@fix:hardware:cpu /proc/cpuinfo::@" /proc/cpuinfo 2>/dev/null | sed -e 's/fix:\(.*:cpu MHz\)/var:\1/' \ -e 's/fix:\(.*user unaligned acc\)/var:\1/' \ -e 's/fix:\(.*timebase\)/var:\1/' \ -e 's/fix:\(.*:bogomips\)/var:\1/' if [ -x /usr/sbin/lsdev -a "${OS_NAME}" = "AIX" ] then /usr/sbin/lsdev -Cc processor | sort | while read cpu status do echo "fix:hardware:cpu:${cpu}::${status}" /usr/sbin/lsattr -E -l ${cpu} 2>/dev/null | sed -e "s/^/fix:hardware:cpu:${cpu}::/" \ -e 's/^fix:\(.*\)frequency/var:\1frequency/' done fi if [ -x /usr/sbin/schedo ] then /usr/sbin/schedo -L 2>/dev/null | sed -e 's/^/fix:hardware:cpu scheduler tunable parameters::/' fi if [ -x /usr/sbin/sizer ] then echo "fix:hardware:cpu type::$(/usr/sbin/sizer -c 2>/dev/null)" echo "fix:hardware:cpu family::$(/usr/sbin/sizer -implver 2>/dev/null)" fi scc_check_file /proc/devices "fix:hardware:/proc/devices::" "#" scc_check_file /proc/dma "fix:hardware:DMA /proc/dma::" "#" scc_check_file /etc/ddr.dbase "fix:hardware:/etc/ddr.dbase::" "#" scc_check_file /etc/discover.conf "fix:hardware:/etc/discover.conf::" "#" if [ -x /opt/hparray/bin/amdsp ] then rm -f ${TMP1_FILE} # Indicator file for presence of hardware. /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} # Hardware found /opt/hparray/bin/amdsp -l -S ${id} | awk -F: '{ if ( $5 == 0 ) { next; } printf( "fix:%s::%d:LunState : %s\n", l, $4, $6 ); printf( "fix:%s::%d:CacheState : %s\n", l, $4, $7 ); printf( "fix:%s::%d:Capacity : %s\n", l, $4, $8 ); printf( "var:%s::%d:Controller : %s\n", l, $4, $9 ); printf( "fix:%s::%d:RaidLevel : %s\n", l, $4, $10 ); printf( "fix:%s::%d:SegmentSize: %s\n", l, $4, $11 ); printf( "fix:%s::%d:DiskGroup : %s\n", l, $4, $12 ); printf( "fix:%s::%d:nDisks : %s\n", l, $4, $13 ); printf( "fix:%s::%d:Channel : %s\n", l, $4, $14 ); printf( "fix:%s::%d:CME : %s\n", l, $4, $16 ); printf( "fix:%s::%d:CWOB : %s\n", l, $4, $17 ); printf( "fix:%s::%d:RCD : %s\n", l, $4, $18 ); printf( "fix:%s::%d:WCA : %s\n", l, $4, $19 ); printf( "fix:%s::%d:RCA : %s\n", l, $4, $20 ); printf( "fix:%s::%d:IsUtm : %s\n", l, $4, $21 ); printf( "fix:%s::%d:UtmLunState: %s\n", l, $4, $22 ); }' l="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 " ${SCC_MODULE}: end of FC60-array" fi if [ -x /usr/bin/graphinfo -a -c /dev/crt ] then graphinfo /dev/crt 2>/dev/null | 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/sbin/biosdecode ] then /usr/sbin/biosdecode 2>/dev/null | strings | sed -e 's/^/fix:hardware:biosdecode::/' fi if [ -x /usr/sbin/dmidecode ] then # We have to cope with the following formats of the dmidecode output: #Handle 0x0000, DMI type 0, 20 bytes. # and (old format): #Handle 0x0400 # DMI type 4, 35 bytes. # In the first case, we display one line, in the other case we display two lines. /usr/sbin/dmidecode 2>/dev/null | sed -e 's/^ //' \ -e 's/^ //' \ -e 's/^ //' \ -e 's/^ //' | awk '/^[ ]*$/ { next } /^# dmidecode/ { class = "hardware:dmidecode:general"; } /^Handle.*DMI type/ { line_1 = $0; line_2 = ""; prev_line_dmi_type = 1; next } /^Handle/ { line_1 = $0; line_2 = ""; next } /DMI type/ { line_2 = $0; prev_line_dmi_type = 1; next } { if ( prev_line_dmi_type == 1 ) { prev_class = class; prev_line_dmi_type = 0; class = sprintf( "hardware:dmidecode:%s", $0 ); if ( class == prev_class ) { printf( "fix:%s::\n", class ); } printf( "fix:%s::%s\n", class, line_1 ); if ( length( line_2 ) ) { printf( "fix:%s::%s\n", class, line_2 ); } printf( "fix:%s::\n", class ); start_node = 0; next; } prefix = "fix"; if ( $0 ~ "MHz" ) { prefix = "var"; # Speed is variable data. } printf( "%s:%s::%s\n", prefix, class, $0 ); }' fi scc_check_file /etc/hal/hald.conf "fix:hardware:/etc/hal/hald.conf::" "#" if [ -x /usr/sbin/lshw ] then # The CPU speed in MHz is variable. /usr/sbin/lshw 2>/dev/null | sed -e 's/^/fix:hardware:lshw::/' \ -e 's/fix:\(.*size: .*MHz\)/var:\1/' elif [ -x /usr/sbin/hwinfo ] then # The CPU speed in MHz is variable. /usr/sbin/hwinfo --short 2>/dev/null | sed -e 's/^/fix:hardware:hwinfo::/' \ -e 's/fix:\(.*CPU.*MHz\)/var:\1/' fi 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/bin/lparstat ] then /usr/bin/lparstat -i 2>/dev/null | sed -e 's/^/fix:hardware:lparstat::/' \ -e 's/^fix:\(.*Variable\)/var:\1/' \ -e 's/^fix:\(.*Online\)/var:\1/' \ -e 's/^fix:\(.*Active\)/var:\1/' fi # AIX workload partitions if [ -x /usr/sbin/lswpar ] then # Survey contains status and is therefore variable data /usr/sbin/lswpar 2>/dev/null | sed -e 's/^/var:hardware:wpar:survey::/' /usr/sbin/lswpar -q 2>/dev/null | sort | while read wpar state type remainder do prefix="fix" if [ "${type}" = "A" ] then # Type A (application) wpars are transient and disappear after completing their job. prefix="var" fi /usr/sbin/lswpar -G ${wpar} 2>/dev/null | sed -e "s/^/${prefix}:hardware:wpar:${wpar}:general::/" /usr/sbin/lswpar -R ${wpar} 2>/dev/null | sed -e "s/^/var:hardware:wpar:${wpar}:resource control::/" \ -e "s/^var:\(.*Limit\)/${prefix}:\1/" \ -e "s/^var:\(.*Max\)/${prefix}:\1/" /usr/sbin/lswpar -T ${wpar} 2>/dev/null | sed -e "s/^/var:hardware:wpar:${wpar}:operation::/" /usr/sbin/lswpar -D ${wpar} 2>/dev/null | sed -e "s/^/var:hardware:wpar:${wpar}:device::/" /usr/sbin/lswpar -M ${wpar} 2>/dev/null | sed -e "s/^/var:hardware:wpar:${wpar}:mount::/" /usr/sbin/lswpar -I ${wpar} 2>/dev/null | sed -e "s/^/var:hardware:wpar:${wpar}:network routes::/" /usr/sbin/lswpar -N ${wpar} 2>/dev/null | sed -e "s/^/var:hardware:wpar:${wpar}:network::/" /usr/sbin/lswpar -S ${wpar} 2>/dev/null | sed -e "s/^/${prefix}:hardware:wpar:${wpar}:security privilege::/" done fi # HP-UX nPar partition information if [ -x /usr/sbin/parstatus ] then # Hendrik Visage: There are cases when this does execute, but with errors, so prevent further errors by testing exit code /usr/sbin/parstatus 2>/dev/null >${TMP1_FILE}; error_state=$? if [ -s ${TMP1_FILE} -a ${error_state} -eq 0 ] then # NOTE: No action specified. Default behavior is display all. # Example data: #[Complex] #Complex Name : xxxxxxxx #Complex Capacity awk 'BEGIN { label="Notes"; # prevent global::: errors in HP/UX 11.31 } /^\[.*\]$/ { sub( "\[", "" ); sub( "\]", "" ); label=$0; next } { # This is the global data of the complex. # Label it as variable to avoid changes for other nodes. print "var:hardware:parstatus:global:" label "::" $0; }' ${TMP1_FILE} partition="$(awk '/'$(hostname)' *$/ { print $1 }' ${TMP1_FILE} )" /usr/sbin/parstatus -p ${partition} -V 2>/dev/null | awk '/^\[.*\]$/ { sub( "\[", "" ); sub( "\]", "" ); label=$0; next; } { print "fix:hardware:parstatus:partition " p ":" label "::" $0; }' p="${partition}" # Determine which cells are part of the partition. awk '/cell.*active.* '"${partition}"'$/ { sub( "cab", "", $1 ); sub( "cell", "", $1 ); sub( ",", "/", $1 ); print $1; }' ${TMP1_FILE} | while read cell do /usr/sbin/parstatus -c "${cell}" -V 2>/dev/null | awk '/^\[.*\]$/ { sub( "\[", "" ); sub( "\]", "" ); label=$0; next; } { print "fix:hardware:parstatus:cell " c ":" label "::" $0; }' c="${cell}" done fi rm -f ${TMP1_FILE} fi # HP-UX vPar partition information (Hendrik Visage) if [ -x /usr/sbin/vparstatus ] then # There are cases when this does execute, but with errors, so prevent further errors by testing exit code /usr/sbin/vparstatus -w >/dev/null 2>/dev/null; ERR_STAT=$? if [ $ERR_STAT -eq 0 ] then # We need to distinguish between sx3000's OA and the previous non-OA based vPars # I still need a more fool proof check, and I wasn't in the mood for # awking in machinfo, so lets check something that we know is not OA supported ;) /usr/sbin/vparstatus -m 2>/dev/null; OA=$? VPARTYPE="" versions_option="-P" if [ $OA -ne 0 ] then VPARTYPE="-OA" # To tag the "new" OA based vpars versions_option="-r" fi /usr/sbin/vparstatus | awk 'BEGIN { label="Notes"; # This is to prevent global::: errors in HP/UX 11.31 } /^\[.*\]$/ { sub( "\[", "" ); sub( "\]", "" ); label=$0; next } { # This is the global data of the complex. # Label it as variable to avoid changes for other nodes. print "var:hardware:vparstatus" t ":summary:" label "::" $0; }' t="${VPARTYPE}" if [ $OA -eq 0 ] then # No equivalent info on OA systems /usr/sbin/vparstatus -m 2>/dev/null | sed -e 's/^/fix:hardware:vparstatus:monitor::/' fi /usr/sbin/vparstatus -d 2>/dev/null | sed -e "s/^/fix:hardware:vparstatus${VPARTYPE}:CPU configuration::/" /usr/sbin/vparstatus -A 2>/dev/null | sed -e "s/^/var:hardware:vparstatus${VPARTYPE}:available resources::/" /usr/sbin/vparstatus ${version_option} | sed -e "s/^/fix:hardware:vparstatus${VPARTYPE}:versions::/" partition="$(/usr/sbin/vparstatus -w -M 2>/dev/null)" if [ "${partition}" ] then /usr/sbin/vparstatus -v -p "${partition}" 2>/dev/null | awk '/^\[.*\]$/ { sub( "\[", "" ); sub( "\]", "" ); label=$0; next; } { print "fix:hardware:vparstatus" t ":local:" p ":" label "::" $0; }' t="${VPARTYPE}" p="${partition}" # The first cut is for non-OA, the last for OA for other_partition in $(/usr/sbin/vparstatus -M | cut -f1 -d":" | cut -f1 -d";" | grep -v ${partition}) do /usr/sbin/vparstatus -v -p "${other_partition}" 2>/dev/null | awk '/^\[.*\]$/ { sub( "\[", "" ); sub( "\]", "" ); label=$0; next; } { print "fix:hardware:vparstatus" t ":siblings:" p ":" label "::" $0; }' t="${VPARTYPE}" p="${other_partition}" done fi fi fi scc_check_file /etc/multipath.conf "fix:hardware:multipath:/etc/multipath.conf::" "#" if [ -x /sbin/multipath ] then /sbin/multipath -v 1 -ll 2>/dev/null | sed -e '/ /d' | while read mp do /sbin/multipath -ll ${mp} 2>/dev/null | sed -e "s/^/fix:hardware:multipath:${mp}::/" done fi if [ -x /usr/sbin/sizer ] then /usr/sbin/sizer -P 2>/dev/null | sed -e 's/^/fix:hardware:partitions::/' fi if [ -x /usr/sbin/prtfru ] then # The output consists of detailed data that changes frequently. # To avoid too many changes in the logbook, we mark all data variable. /usr/sbin/prtfru -c 2>/dev/null | sed -e 's/^/var:hardware:prtfru:data::/' /usr/sbin/prtfru -l 2>/dev/null | sed -e 's/^/fix:hardware:prtfru:hierarchy::/' 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 HP Storage Works Secure Path if [ -x /sbin/spmgr ] then /sbin/spmgr display | grep -v -i -e "report created:" | sed "s/^/fix:hardware:hp secure path::/" fi if [ -x /usr/sbin/lsrset ] then /usr/sbin/lsrset -av | sed -e 's/^/fix:hardware:lsrset::/' fi ## Added by Paul te Vaanholt for EMC Symmetrix machines # When this software is not installed in its'default directory (refer to scc-localize), # edit scc-localize and change the contents of the variable SCC_PATH. # This replaces the variable SYMCLI used for previous versions of the software. EMC="hardware:EMC symmetrix" symdev_exe="$(which symdev 2>/dev/null)" if [ -x "${symdev_exe}" ] then "${symdev_exe}" list 2>&1 | sed -e "s/^/fix:${EMC}:devices::/" fi symdg_exe="$(which symdg 2>/dev/null)" if [ -x "${symdg_exe}" ] then symdg list 2>/dev/null | sed -e "s/^/fix:${EMC}:symdg list::/" symdg list 2>/dev/null | grep -v -e "D E V I C E" -e "Num.* of" -e "Symmetrix" | awk 'NF > 5 { print $1 }' | while read DG do # The structure of the output of this command is general data followed by several categories. #Group Name: # general data ... # category # { # category-data # } symdg show "${DG}" 2>/dev/null | awk '/^Group Name/ { category = "general"; next; } /^[ ]*$/ { next; } /^[ ]*\{/ { category = prev_line; sub( "^[ ]*", "", category ); gsub( "[\(][^\)]*[\)]", "", category ); # no text in brackets sub( "[ ]*:*$", "", category ); gsub( " ", " ", category ); } { if ( length( prev_line ) > 0 ) { print prefix category "::" prev_line; } prev_line = $0; } END { print prefix category "::" prev_line; }' prefix="fix:${EMC}:${DG}:" >${TMP1_FILE} symdg -f ${TMP1_FILE} export "${DG}" 2>/dev/null sed -e "s/^/fix:${EMC}:${DG}:export::/" <${TMP1_FILE} rm -f ${TMP1_FILE} if [ -x symrdf ] then symrdf -g "${DG}" query 2>/dev/null | sed -e "s/^/fix:${EMC}:${DG}:query::/" fi if [ -x symmir ] then symmir -g "${DG}" -rdf query 2>/dev/null | sed -e "s/^/fix:${EMC}:${DG}:mirror state::/" fi done fi syminq_exe="$(which syminq 2>/dev/null)" if [ -x "${syminq_exe}" ] then "${syminq_exe}" 2>/dev/null | sed -e "s/^/fix:${EMC}:syminq::/" fi # Sun Storedge if [ -x /usr/sbin/sccli ] then /usr/sbin/sccli -l 2>/dev/null | awk '/^\/dev\// { print $1, $NF }' | while read device id do /usr/sbin/sccli "${device}" show configuration ${TMP1_FILE} 2>/dev/null # The contents of the output file are: # # * # # # Some data appears to "change" for each run of scc. Tag this data variable. # inquiry-data:: Page D0 Fibre Channel Address: A7 (id 40) # inquiry-data:: Page D0 Port Name: 216000C0FF884D85 # peripheral-device-status data is variable: temperature and voltage (indicated by Nico van Leeuwen). awk '/^[ ]*$/ { if ( class_cnt < 1 ) next } /^\* / { class = $2; prefix = "var"; if ( class != "enclosure-status" ) { prefix = "fix"; } class_cnt = 0; next; } { print prefix ":hardware:Sun Storedge:" i ":" class "::" $0; class_cnt += 1; }' i="${id}" ${TMP1_FILE} | sed -e 's@^fix:\(.*:peripheral-device-status::\)@var:\1@' \ -e 's@^fix:\(.*:inquiry-data:: Page D.* Fibre Channel Address\)@var:\1@' \ -e 's@^fix:\(.*:inquiry-data:: Page D.* Port Name\)@var:\1@' \ -e '/controller-date::Current time/d' rm -f ${TMP1_FILE} done fi if [ -x /usr/sbin/lspath ] then # No example data analysed, keep all data variable. /usr/sbin/lspath 2>/dev/null | sed -e 's/^/var:hardware:lspath::/' fi if [ -x /sbin/sysctl ] then case "${OS_NAME}" in *BSD) LABEL="hw" ;; *) LABEL="dev" ;; esac sed -n \ -e "s/^${LABEL}\.acpi.battery/var:hardware:sysctl::${LABEL}.acpi.battery/p" \ -e "s/^${LABEL}\.usermem/var:hardware:sysctl::${LABEL}.usermem/p" \ -e "s/^${LABEL}\.cpuspeed/var:hardware:sysctl::${LABEL}.cpuspeed/p" \ -e "s/^${LABEL}\.clockrate/var:hardware:sysctl::${LABEL}.clockrate/p" \ -e "s/^${LABEL}\./fix:hardware:sysctl::${LABEL}./p" \ <${SYSCTL_DATA} | sort fi if [ -x /opt/fcms/bin/fcmsutil ] then for dev in /dev/fcms* /dev/td* do if [ -c "${dev}" ] then class="hardware:TACHYON-interface:${dev}" /opt/fcms/bin/tdutil "${dev}" read 0x008 pci 2>/dev/null | sed -e "s@^@fix:${class}:tdutil::@" /opt/fcms/bin/fcmsutil "${dev}" 2>/dev/null | awk '/^[ ]*$/ { next } { prefix="fix"; } /Number of Assisted IOs/ { prefix="var" } /Number of Active Login/ { prefix="var" } { print prefix ":" l $0 }' l="${class}:fcmsutil::" # The following data (control register) changes frequently: var. /opt/fcms/bin/fcmsutil "${dev}" read_cr 2>/dev/null | sed -e '/^[ ]*$/d' \ -e "s@^@var:${class}:registers::@" /opt/fcms/bin/fcmsutil "${dev}" stat 2>/dev/null | sed -e '/^[ ]*$/d' \ -e "s@^@var:${class}:status::@" fi done fi if [ -x /opt/fcms/bin/fcdutil ] then for dev in /dev/fcd* do if [ -c "${dev}" ] then class="hardware:FibreChannel-interface:${dev}" /opt/fcms/bin/fcdutil "${dev}" vpd 2>/dev/null | awk '/^[ ]*$/ { next } { print "fix:" l $0 }' l="${class}:Vital Product Data::" /opt/fcms/bin/fcdutil "${dev}" get_int_delay 2>/dev/null | sed -e "s@^@fix:${class}:get_int_delay::@" /opt/fcms/bin/fcdutil "${dev}" 2>/dev/null | awk '/^[ ]*$/ { next } { print "fix:" l $0 }' l="${class}:fcdutil::" # The following data (control register) changes frequently: var. /opt/fcms/bin/fcdutil "${dev}" read_cr 2>/dev/null | sed -e '/^[ ]*$/d' \ -e "s@^@var:${class}:registers::@" fi done fi if [ -x /usr/sbin/icod_stat ] then # The status line contains the current date (reported by Hendrik Visage). /usr/sbin/icod_stat 2>/dev/null | sed -e 's/^/fix:hardware:Instant Capacity on Demand::/' \ -e 's/^fix:\(.*\) Status /var:\1 Status /' fi if [ -x /usr/sbin/chcod ] then /usr/sbin/chcod 2>/dev/null | sed -e 's/^/fix:hardware:capacity on demand::/' fi scc_check_file /etc/iscsi/iscsid.conf "fix:hardware:scsi:/etc/iscsi/iscsid.conf::" "#" scc_check_file /etc/iscsi/initiatorname.iscsi "fix:hardware:scsi:/etc/iscsi/initiatorname.iscsi::" "#" 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/bin/sg_map ] then /usr/bin/sg_map -i 2>/dev/null | sed -e 's/^/fix:hardware:scsi:sg_map::/' fi if [ -x /usr/bin/scsiinfo ] then # List all scsi devices and then retrieve the results from the Inquiry command. /usr/bin/scsiinfo -l 2>/dev/null | while read device remainder do /usr/bin/scsiinfo -i ${device} 2>/dev/null | sed -e '/^[ ]*$/d' \ -e "s@^@fix:hardware:scsi:${device}::@" done fi 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::/' for d in $(ls /dev/es/* 2>/dev/null ) do /usr/sbin/luxadm inq "${d}" 2>/dev/null | sed -e "s@^@fix:hardware:SENA:${d}::@" done /usr/sbin/luxadm probe 2>/dev/null | sed -n -e 's/^S.*Name:\([^ ]*\) .*/\1/p' | sort | while read enclosure remainder do /usr/sbin/luxadm display ${enclosure} | sed -e "/Temperature [sS]ensors/,/ temperatures /d" \ -e "/Interconnect assembly/,/Language/d" \ -e "s/^/fix:hardware:SENA:${enclosure}:display::/" done fi if [ -d /sys/block ] then find /sys/block -type f 2>/dev/null | sed -e '/\/stat$/d' \ -e '/\/ram/d' | sort -u -f | while read file do if [ -r "${file}" ] then dev=${file#/sys/block/} cat=${dev#*/} dev=${dev%%/*} sed -e "s@^@fix:hardware:block devices:/sys/block/${dev}::${cat} :@" "${file}" 2>/dev/null fi done find /sys/block -type l 2>/dev/null | grep "/holders/" | sort -u -f | sed -e "s@^/sys/block/@@" \ -e "s@^@fix:hardware:block devices:@" \ -e "s@/holders/@::holders: @" 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/minor_perm "fix:hardware:devices:/etc/minor_perm::" "#" scc_check_file /etc/driver_classes "fix:hardware:devices:/etc/driver_classes::" "#" scc_check_file /etc/driver_aliases "fix:hardware:devices:/etc/driver_aliases::" "#" 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 RedHat and *BSD systems, there are too many device files. if [ "${OS_NAME}" = "HP-UX" -o "${OS_NAME}" = "SunOS" -o "${OS_NAME}" = "OSF1" ] 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 and pseudo-terminal devices on SunOS. find /dev -type b -o -type c | fgrep -v "/dev/fd/" | fgrep -v "/dev/pts/" if [ -d /devices ] # SunOS then # There ware way too many pseudo devices, ignore them. find /devices -type b -o -type c | fgrep -v "/pseudo/" 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 ); next; } } # 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 scc_check_file /etc/devfsd.conf "fix:hardware:device-files:/etc/devfsd.conf::" "#" if [ -x /sbin/dsfmgr ] then # Erase all dates from the output. /sbin/dsfmgr -s -x 2>/dev/null | sed -e 's/ [A-Z][a-z][a-z] [0-9][0-9] [0-9][0-9][0-9][0-9] / /' \ -e 's/ [A-Z][a-z][a-z] [0-9] [0-9][0-9][0-9][0-9] / /' \ -e 's/ [A-Z][a-z][a-z] [0-9][0-9] [0-9][0-9]:[0-9][0-9] / /' \ -e 's/ [A-Z][a-z][a-z] [0-9][0-9] [0-9]:[0-9][0-9] / /' \ -e 's/^/fix:hardware:dsfmgr::/' fi if [ -x /usr/bin/raw ] then /usr/bin/raw -qa 2>/dev/null | sed -e 's/^/fix:hardware: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 | if [ "${OS_NAME}" = "SunOS" ] then # Slice 0 (s0) indicates the entire disk, # other slices are used to address parts of the disk. sed -e "/s[1-9]$/d" else cat - fi > ${TMP1_FILE} DISK_COUNT="$(wc -l <${TMP1_FILE})" sort ${TMP1_FILE} | 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 # The format command can disrupt the SAN when there are many disks. if [ ${DISK_COUNT} -lt 250 -a -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/scsictl ] then /usr/sbin/scsictl -a /dev/rdsk/${disk} 2>${TMP1_FILE} | sed -e "s/^/fix:hardware:disk:${disk}::scsictl: /" if [ -s ${TMP1_FILE} ] then # SAN's can use pseudo LUNs, where scsictl fails. Do not collect more info. continue fi 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 -l "find the volume group" ${TMP1_FILE} >/dev/null 2>/dev/null 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" dd bs=8200 skip=1 count=1 if=/dev/dsk/${disk} 2>/dev/null | od -x | awk '{ if ( NR == 1 ) { pvid = sprintf( "%s%s%s%s", $2, $3, $4, $5 ); vgid = sprintf( "%s%s%s%s", $6, $7, $8, $9 ); printf( "fix:hardware:disk:%s::PVID:%s\n", d, toupper( pvid ) ); printf( "fix:hardware:disk:%s::VGID:%s\n", d, toupper( vgid ) ); exit( 0 ); } }' d="${disk}" fi rm -f ${TMP1_FILE} fi done rm -f ${TMP1_FILE} if [ -x /usr/sbin/lsdev -a "${OS_NAME}" = "AIX" ] then /usr/sbin/lsdev -c disk | sort | while read disk remainder do echo "fix:hardware:disk:${disk}::${remainder}" getconf DISK_SIZE /dev/${disk} 2>/dev/null | sed -e "s/^/fix:hardware:disk:${disk}::disksize /" /usr/sbin/lsattr -E -l ${disk} | sed -e "s/^/fix:hardware:disk:${disk}::/" done fi if [ "${OS_NAME}" = "Linux" ] then # Determine the disks of our local filesystems. busybox_check df if [ $? -eq 0 ] then df -l 2>/dev/null # The real thing else df # No -l option available fi | awk '/^\/dev\// { print $1 }' | sort -uf | while read dsk remainder do # The output from parted and fdisk are comparable. # As the output from parted is more readable, we try parted first. if [ -x /sbin/parted -o -x /usr/sbin/parted ] then parted -s ${dsk} print 2>/dev/null | sed -e '/^[ ]*$/d' \ -e "s@^@fix:hardware:disk:${dsk##*/}::parted: @" elif [ -x /sbin/fdisk ] then /sbin/fdisk -l -u ${dsk} 2>/dev/null | sed -e '/^[ ]*$/d' \ -e "s@^@fix:hardware:disk:${dsk##*/}::fdisk: @" fi # SCSI disks are handled by sginfo case "${dsk##*/}" in hd*) /sbin/hdparm -I ${dsk} 2>/dev/null | sed -e "s@^@fix:hardware:disk:${dsk##*/}::hdparm: @" ;; esac done fi if [ -x /sbin/fdisk -a -x /usr/sbin/smartctl ] then /sbin/fdisk -l 2>/dev/null | awk '/^Disk/ { sub( ":", "", $2 ); print $2 }' | sort | while read disk do if [ -b "${disk}" ] then /usr/sbin/smartctl --info --all "${disk}" 2>/dev/null | sed -e '1,/=== START/d' \ -e '/Local Time/d' \ -e "s@^@fix:hardware:disk:${disk}::smartctl @" fi done fi if [ -x /usr/bin/sginfo ] then # Sample output: # sginfo -l # /dev/sr0 /dev/sda /dev/scd0 # /dev/sg0 [=/dev/sda scsi0 ch0 id=0 lun=0] # /dev/sg1 [=/dev/sr0 scsi1 ch0 id=0 lun=0] for disk in $(/usr/bin/sginfo -l 2>/dev/null | head -n 1) do if [ ! -h "${disk}" ] then # Ignore lines indicating unsupported (sub)pages: lines starting with ">>" /usr/sbin/sginfo -A "${disk}" 2>/dev/null | sed -e '/^>>/d' \ -e "s@^@fix:hardware:disk:${disk}::sginfo: @" fi done fi if [ -x /sbin/fdisk -a "${OS_NAME}" = "FreeBSD" ] then ls /dev/ad[0-9] /dev/da[0-9] 2>/dev/null | while read disk do fdisk ${disk} 2>/dev/null | sed -e "s@^@fix:hardware:disk:${disk##*/}::fdisk: @" done fi if [ -x /usr/bin/fio-status ] then # Example output: #[driver] #total_ioDimms=1 #driver_version=2.2.0 #driver_build=82 #driver_version_string=2.2.0.82 sisyphus@824644295bc9 sdk_api_version=44.2.0 # #[ioDimm 1] #control_device=fct0 #client_device=fioa /usr/bin/fio-status -a -fk 2>/dev/null | awk '/^$/ { next } /^\[/ { sub( "^.", "" ); sub( "]$", "" ); label = $0; } { prefix = "fix"; } /_volts=/ { prefix = "var" ; } /_usage_/ { prefix = "var" ; } /_percent=/ { prefix = "var" ; } /_degC=/ { prefix = "var" ; } /_status=/ { prefix = "var" ; } /_read_bytes=/ { prefix = "var" ; } /_written_bytes=/ { prefix = "var" ; } /_ram_usage_/ { prefix = "var" ; } /_endurance_pbytes=/ { prefix = "var" ; } { printf( "%s:%s:%s::%s\n", prefix, class, label, $0 ); }' class="hardware:fio-status" fi if [ -x /sbin/sysctl -a -x /sbin/disklabel ] then # Retrieve all the disknames, ignore floppy and CD-rom. /sbin/sysctl -n hw.disknames 2>/dev/null | tr " ," "\012" | sort | sed -e '/^fd/d' \ -e '/^cd/d' | while read disk do /sbin/disklabel ${disk} /dev/null | sed -e "s/^/fix:hardware:disklabels:${disk}::/" done fi if [ -x /sbin/hwmgr -a -x /sbin/disklabel ] then /sbin/hwmgr show scsi | awk '{ if ( $4 == "disk" ) print $8 }' | while read disk do # Disks can be added to an EMC box without the device files being created. device="/devices/disk/${disk}a" if [ -b "${device}" ] then /sbin/disklabel -r ${device} 2>/dev/null | sed -e "s/^/fix:hardware:disk:${disk}::disklabel: /" fi done fi for d in /proc/ide/hd* do if [ -d "${d}" ] then disk=$(basename "${d}") if [ -x /sbin/ide_info ] then /sbin/ide_info /dev/${disk} 2>/dev/null | sed -e "s/^/fix:hardware:disk:${disk}::ide_info: /" else scc_check_file "${d}/model" "fix:hardware:disk:${disk}::model: " "#" scc_check_file "${d}/driver" "fix:hardware:disk:${disk}::driver: " "#" fi scc_check_file "${d}/geometry" "fix:hardware:disk:${disk}::geometry: " "#" fi done scc_check_file "/proc/ide/drivers" "fix:hardware:disk:/proc/ide/drivers::" "#" scc_check_file "/proc/ide/piix" "fix:hardware:disk:/proc/ide/piix::" "#" scc_check_file "/proc/ide/via" "fix:hardware:disk:/proc/ide/via::" "#" if [ -d /dev/disk ] then for dir in /dev/disk/by-* do if [ -d "${dir}" ] then cat=${dir##*/by-} ls -l ${dir} | sed -n -e "s@.* \([^ ][^ ]*\) -> \.\./\.\./\([^/][^/]*$\)@fix:hardware:disk:\2::${cat} : \1@p" fi done | sort fi if [ -x /usr/sbin/emxmgr ] then for adapter in $(/usr/sbin/emxmgr -d 2>/dev/null | grep emx) do /usr/sbin/emxmgr -t ${adapter} 2>/dev/null | sed -e "s/^/fix:hardware:EMX:${adapter}::/" done fi if [ -x /usr/sbin/lscfg ] then # AIX /usr/sbin/lscfg | awk '/^\+ fcs/ { print $2 }' | sort | while read fc do /usr/sbin/lscfg -vl ${fc} | sed -e "s/^/fix:hardware:Fibre Channel:${fc}::/" done fi 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:RaidManager:/etc/raid/rmparams::" "#" for f in /etc/raidtab /etc/raid?.conf /etc/mdadm.conf /etc/mdadm/mdadm.conf do scc_check_file "${f}" "fix:hardware:software RAID:${f}::" "#" done scc_check_file "/proc/mdstat" "var:hardware:software RAID:/proc/mdstat::" "#" # Status is var data. if [ -x /sbin/mdadm -a -f /proc/mdstat ] then sed -e '/^Personalities/d' \ -e '/^unused/d' \ -e 's/[ ].*//' \ -e '/^$/d' \ /proc/mdstat | while read device do /sbin/mdadm --detail /dev/${device} 2>/dev/null >${TMP1_FILE} sed -e "/ Time /d" \ -e "s@^@fix:hardware:software RAID:/dev/${device}:general::@" \ -e "s/fix:\(.* Events :\) /var:\1/" \ -e "s/fix:\(.* State :\) /var:\1/" \ ${TMP1_FILE} awk '/Major *Minor/ { show = 1; next } { if ( show ) print $NF }' ${TMP1_FILE} | while read disk do /sbin/mdadm --examine ${disk} 2>/dev/null | sed -e "/ Time /d" \ -e "s@^@fix:hardware:software RAID:/dev/${device}:${disk}::@" \ -e "s/fix:\(.* Checksum :\) /var:\1/" \ -e "s/fix:\(.* Events :\) /var:\1/" \ -e "s/fix:\(.* State :\) /var:\1/" done rm -f ${TMP1_FILE} done fi [ ${SCC_PROFILING} ] && scc_timing " ${SCC_MODULE}: end of 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 if [ -d /proc/irq ] then find /proc/irq -type f 2>/dev/null | sed -e "/spurious/d" | sort | while read file do if [ -r "${file}" ] then sed -e "/^count/d" \ -e "s@^@fix:hardware:irq:${file}::@" \ "${file}" fi done fi # This file contains binary data on Gentoo: ignore. # Accessing this file on unity fails: ignore. if [ "${SCC_LINUX_DISTRO}" != "gentoo" -a "${SCC_LINUX_DISTRO}" != "unity" ] then scc_check_file /proc/ioports "fix:hardware:/proc/ioports::" "#" fi scc_check_file /etc/isapnp.conf "fix:hardware:/etc/isapnp.conf::" "#" 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 if [ "$OS_NAME" = "AIX" ] then # Contributed by Doug Probst. getconf_opts="CLK_TCK HARDWARE_BITMODE KERNEL_BITMODE MACHINE_ARCHITECTURE" else getconf_opts="CS_MACHINE_SERIAL CLK_TCK CPU_CHIP_TYPE HW_CPU_SUPP_BITS HW_32_64_CAPABLE KERNEL_BITS" fi for c in ${getconf_opts} 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 2>/dev/null | 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/lsdev ] then /usr/sbin/lsdev | sed -e 's/^/fix:hardware:lsdev::/' fi # Only provide the specs of the system itself. Ignore the devices. if [ -x /usr/bin/lshal ] then /usr/bin/lshal -l -u /org/freedesktop/Hal/devices/computer 2>/dev/null | sed -e "s/^/fix:hardware:lshal computer::/" fi if [ -x /usr/sbin/prtconf -a "${OS_NAME}" = "SunOS" ] then # The following command produces much data that is rather non-descript. # Changes are not very clear. Treat all output as variable. /usr/sbin/prtconf -v 2>/dev/null | sed -e 's/^/var:hardware:prtconf:device-tree::/' /usr/sbin/prtconf -vp 2>/dev/null | sed -n -e 's/^ *idprom:/fix:hardware:prtconf:PROM::idprom:/p' 2>/dev/null fi if [ -f /proc/meminfo ] then grep Total /proc/meminfo | sed -e 's@^@fix:hardware:memory /proc/meminfo::@' fi if [ -f /proc/iomem ] then sed -e 's@^@fix:hardware:memory /proc/iomem::@' \ -e 's/fix:\(.* : [0-9a-f][0-9a-f]*:[0-9a-f][0-9a-f\.:]*\)$/var:\1/' \
/dev/null fi if [ -x /usr/sbin/lscfg ] then /usr/sbin/lscfg -v | awk '/mem/ { print $1 }' | while read card do /usr/sbin/lsattr -EHl ${card} | sed -e "s/^/fix:hardware:memory:${card}::/" done fi if [ -x /usr/sbin/lsmcode ] then /usr/sbin/lsmcode -A | sed -e 's/^/fix:hardware:microcode lsmcode::/' fi file=/etc/X11/XF86Config newer="$(find /etc -type f -name XF86Config -newer ${file} 2>/dev/null)" if [ -f "${newer}" ] then file="${newer}" fi scc_check_file "${file}" "fix:hardware:monitor:${file}::" "#" if [ -x /sbin/hwmgr ] then for cat in name scsi component do /sbin/hwmgr show "${cat}" 2>&1 | awk '{ prefix = "fix"; if ( c == "scsi" && $4 == "tape" ) { # The driver owner seems to change for tapes. prefix = "var"; } printf( "%s:hardware:hwmgr:%s::%s\n", prefix, c, $0 ); }' c="${cat}" done /sbin/hwmgr view devices -category fibre 2>&1 | sed -e "s/^/fix:hardware:hwmgr:fibre::/" for cat in cluster devices hierarchy env do /sbin/hwmgr view "${cat}" 2>&1 | sed -e "s/^/fix:hardware:hwmgr:${cat}::/" done fi if [ -x /sbin/scu ] then /sbin/scu show edt 2>&1 | sed -e 's/^/fix:hardware:scu::/' fi 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 sed -e 's/^/fix:hardware:ioscan::messages: /' ${TMP1_FILE} rm -f ${TMP1_FILE} [ ${SCC_PROFILING} ] && scc_timing " ${SCC_MODULE}: end of ioscan" elif [ -f /etc/sysconfig/hwconf ] then scc_check_file /etc/sysconfig/hwconf "fix:hardware:/etc/sysconfig/hwconf::" "-" fi if [ -x /usr/sbin/mcelog ] then # Display hardware error events: /usr/sbin/mcelog 2>/dev/null | sed -e 's@^@var:hardware:/usr/sbin/mcelog::@' scc_check_file /etc/mcelog.conf "fix:hardware:/etc/mcelog.conf::" "#" 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 scc_check_file /etc/olar.config "fix:hardware:/etc/olar.config::" "-" scc_check_file /etc/olar.config.common "fix:hardware:/etc/olar.config.common::" "-" if [ -x /sbin/lspci ] then /sbin/lspci -vv 2>/dev/null | sed -e 's/^/fix:hardware:pci-devices lspci::/' \ -e 's/^fix:\(.*Address: \)/var:\1/' \ -e 's/^fix:\(.*Control: \)/var:\1/' \ -e 's/^fix:\(.*Latency: \)/var:\1/' \ -e 's/^fix:\(.*Status: \)/var:\1/' \ -e 's/^fix:\(.*Region .* Memory\)/var:\1/' else scc_check_file /proc/pci "fix:hardware:pci-devices /proc/pci::" "#" fi if [ -x /usr/sbin/pciconf ] then /usr/sbin/pciconf -v -l 2>/dev/null | sed -e 's/^/fix:hardware:pciconf::/' fi if [ -x /sbin/lspnp ] then /sbin/lspnp -vv 2>/dev/null | sed -e 's/^/fix:hardware:pnp-devices lspnp::/' else scc_check_file /proc/bus/pnp "fix:hardware:pnp-devices /proc/bus/pnp::" "#" fi scc_check_file /etc/power.conf "fix:hardware:power management::/etc/power.conf: " "#" scc_check_file /etc/genpowerd.conf "fix:hardware:power management::/etc/genpowerd.conf: " "#" # Powermt is a tool buit-in on PowerPath -- a high availability SAN software from EMC. # Suggested by and implemented with the assistance of Eduardo Alvarenga. powermt_exe="" for dir in /sbin /usr/sbin /etc do if [ -x ${dir}/powermt ] then powermt_exe="${dir}/powermt" break fi done if [ -x "${powermt_exe}" ] then "${powermt_exe}" check_registration 2>/dev/null | sed -e 's/^/fix:hardware:powermt:registration::/' "${powermt_exe}" display 2>/dev/null | sed -e 's/^/fix:hardware:powermt:general::/' "${powermt_exe}" display 2>/dev/null | sed -e 's/^/fix:hardware:powermt:options::/' # Default format of data: #Pseudo name=hdiskabc123 #Symmetrix ID=123456789012 #Logical device ID=12AB #state=alive; policy=SymmOpt; priority=0; queued-IOs=0 #============================================================================== #---------------- Host --------------- - Stor - -- I/O Path - -- Stats --- #### HW Path I/O Paths Interf. Mode State Q-IOs Errors #============================================================================== #0 fscsi0 hdisk254 FA 7bA active alive 0 0 #1 fscsi1 hdisk256 FA 9bB active alive 0 0 # Alternative header for Clarion: #CLARiiON ID=123456789012 #Logical device ID=12345678901234567890 #state=alive; policy=CLAROpt; priority=0; queued-IOs=0 # Some versions on HP-UX do not contain the Pseudo name line. # In that case we use the Logical device ID for the classification. # To avoid changes in the logbook, we erase all data concerning queued IO's. "${powermt_exe}" display dev=all 2>/dev/null | if [ "${OS_NAME}" = "HP-UX" ] then # When Pseudo name line is missing, switch the Symmetrix/CLARiion ID and Logical device ID lines. awk '/^Pseudo name=/ { ok="yes" } /^Symmetrix ID|^CLARiiON ID/ { if ( length( ok ) == 0 ) { id=$0; next; } } /^Logical device ID/ { if ( length( ok ) == 0 ) { print; print id; next; } } { print }' else cat fi | awk '/^Pseudo name=/ { class=$0; sub( ".*=", "", class ); next; } /^Logical device ID/ { if ( length( class ) == 0 ) { class=$0; sub( ".*=", "", class ); } } /^[ ]*$/ { class=""; next; } { print "fix:hardware:powermt:" class "::" $0; }' | sed -e 's/queued-IOs=.*//' \ -e 's/Q-IOs //' \ -e 's/ [0-9][0-9]* *\([0-9][0-9]*\)$/ \1/' fi #################################################################################################### # The following code has been developed and contributed by: Erik-Jan Taal (ejtaal at gmail.com) # HP Proliant Support Pack for SCC. psp_base_class="fix:hardware:proliant support pack" ACUCLI="/usr/sbin/hpacucli" if [ -x "${ACUCLI}" ] then class="${psp_base_class}:Disk array layout" if ${ACUCLI} ctrl all show 2> /dev/null | grep -q "Another instance of hpacucli is running" then # Do not wait until the other instance closes. Use the data from the previous run. grep "^${class}::" ${SCC_KEEP_CONFIG} else HPACU_SLOT=0 if ${ACUCLI} ctrl slot=0 show status > /dev/null 2>&1 then HPACU_SLOT=0 elif ${ACUCLI} ctrl slot=1 show status > /dev/null 2>&1 then HPACU_SLOT=1 #else # Is this any higher on other server types? I can only test on DL3[68]0 fi ${ACUCLI} ctrl slot=${HPACU_SLOT} show config 2> /dev/null | sed -e "/^$/d" \ -e "s/^/${class}:slot ${HPACU_SLOT} general::/" ${ACUCLI} ctrl slot=${HPACU_SLOT} show config detail 2> /dev/null | sed -e "/^$/d" \ -e "s/^/${class}:slot ${HPACU_SLOT} detail::/" # Check for MSA external arrays MSASERIAL=$(${ACUCLI} ctrl all show 2> /dev/null | grep ^MSA | head -1 | tr \( , | cut -f 2 -d, | cut -f 2 -d' ') if [ -n "${MSASERIAL}" ] then ${ACUCLI} ctrl sn=${MSASERIAL} show config 2> /dev/null | grep . | sed -e "/^$/d" \ -e "s/^/${class}:sn=${MSASERIAL} general::/" ${ACUCLI} ctrl sn=${MSASERIAL} show config detail 2> /dev/null | sed -e "/^$/d" \ -e "s/^/${class}:sn=${MSASERIAL} detail::/" fi fi | tee -a "${SCC_KEEP_NEW}" fi ASMCLI="/sbin/hpasmcli" if [ -x "${ASMCLI}" ] then class="${psp_base_class}:hardware" # Server layout ${ASMCLI} -s "show server" | sed -e "/^$/d" \ -e "s/^/${class}:motherboard::/" # It shows fan speeds in %, erase them to keep the data fix:'ed ${ASMCLI} -s "show fans" | sed -e 's/..%/__%/' \ -e 's/1__%/ __%/' \ -e "s/^/${class}:fans::/" # Maybe not that interesting as unlikely to change unless you go # soldering ;) Strip out the actual temp values as they'll change. ${ASMCLI} -s "show temp" | awk '{ print $1 " " $2 }' | sed -e "/^[ ]*$/d" \ -e "s/^/${class}:temp sensors::/" # Memory sticks info ${ASMCLI} -s "show dimm" | sed -e "/^$/d" \ -e "s/^/${class}:dimms::/" fi HPONCFG="/sbin/hponcfg" if [ -x "${HPONCFG}" ] then class="${psp_base_class}:iLO" ${HPONCFG} -w ${TMP1_FILE} >/dev/null 2>/dev/null if [ $? -eq 0 ] then sed -e '/" ); if ( x > 0 ) { line = substr( line, x + 3 ); squelch = 0; } else { line = ""; } } } sub(/[ ]*$/, "", pline ); if ( pline != "" ) { print p pline; } next }' c="${3}" \ p="${utils_class}" \ xml=${xml} comment=" and lines starting with character: ${3}" if [ -z "${3}" ] then comment="" fi scc_help_info "${utils_class}" <<-_X_ Contents of file: ${1} Ignore blank lines${comment} _X_ return 0; # indicate logging of data in file. elif [ ${utils_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 ${1}: '${f_type}'" fi fi return 1; # indicate skip of (absent) file. } # Encrypt stdin # Syntax: scc_crypt scc_crypt() { # Encrypt stdin. { # The variable crypt_key is initalized during the first run of scc. # Adding this data avoids that the identical critical data on other systems # have the same md5sum on scc-srv. Indicated by Esther Hanko and Ronald van der Meer. echo "${crypt_key}" cat - echo "${crypt_key}" } | if [ -x /usr/bin/md5sum ] then /usr/bin/md5sum | sed -e 's/ .*//' elif [ -x /sbin/md5 ] then /sbin/md5 elif [ -x /usr/bin/crypt ] then /usr/bin/crypt "${crypt_key}" | scc_checksum | sed -e 's/ .*//' else # no encryption available, ignore data cat >/dev/null fi return 0; } # Add profiling data # Syntax: scc_timing scc_timing() { utils_now=$(date '+%H.%M.%S') utils_hour=${utils_now%%.*} utils_min=${utils_now%.*} utils_min=${utils_min#*.} utils_sec=${utils_now##*.} utils_tick_cur=$(( ${utils_sec#0} + ( 60 * ${utils_min#0} ) + ( 3600 * ${utils_hour#0} ) )) if [ ${utils_tick_cur} -lt ${tick_prev} ] then # Correction when previous measurement was yesterday. utils_runtime=$(( ${utils_tick_cur} + ( 24 * 3600 ) - ${tick_prev} )) else utils_runtime=$(( ${utils_tick_cur} - ${tick_prev} )) fi total_time=$(( ${total_time} + ${utils_runtime} )) echo "${1}" | awk '{ printf( "var:profiling::%s: %4d : %4d :%s\n", u_n, u_r, total, $0 ) }' u_n=${utils_now} u_r=${utils_runtime} total=${total_time} tick_prev=${utils_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; } # Retrieve the Oracle SID's # Requires: # ${ORATAB} or running ora_pmon processes # oraInst.loc # Syntax: # scc_oracle_sids # Output: # # Where is "_" when no user can be determined from the process-list scc_oracle_sids () { # Determine the the oracle_home and oracle_sid combinations: # - from oratab # - via orainventory -> base directories -> init.ora and spfile.ora files (Erik-Jan Taal). # Combine via sort -u and find the oracle user from the proc-file. # Todo: Check owners of init- and sp-files. ( if [ -f "${ORATAB:-}" ] then # Use the oratab to determine a list of ORACLE_SID and ORACLE_HOME sed -e 's/:/ /' \ -e 's/:.*//' \ -e 's/[#*].*//' \ -e '/^[ ]*$/d' \ ${ORATAB} | awk '{ print $2, $1; }' fi # Attempt to find some oracle-home directories and use the init.ora and spfile.ora files # to list the oracle_home and oracle_sid combinations. ( ora_inst="${ORATAB%/*}/oraInst.loc" if [ -f "${ora_inst}" ] then inventory="$(sed -n -e 's/^inventory_loc=//p' "${ora_inst}")/ContentsXML/inventory.xml" if [ -f "${inventory}" ] then # Example data: # sed -n "s/.*HOME.*LOC=\"*//p" "${inventory}" | sed -e "s/\"* .*//" fi fi # Try a default ORACLE_HOME and retrieve sid from init.ora and spfile.ora: # According to OFA: for dir in /opt/oracle /*/app/oracle/product/* do if [ -x "${dir}/bin/sqlplus" ] then echo "${dir}" fi done ) | sort -u | while read ora_home do if [ -d "${ora_home}/dbs" ] then # - dbs/init.ora (spfile=) # - dbs/spfile.ora (strings) # - use an (additional) "?" to avoid faulty output with a 'init.ora' file (Erik-Jan Taal) ls "${ora_home}"/dbs/init?*.ora "${ora_home}"/dbs/spfile?*.ora 2>/dev/null | sed -e '/initdw.ora/d' \ -e 's/\.ora$//' \ -e "s@^.*/dbs/init@${ora_home} @" \ -e "s@^.*/dbs/spfile@${ora_home} @" fi done ) | sort -u -f | while read home sid do # Retrieve the oracle user from the process list. # On AIX a space is appended to the processname (indicated by Rick Veenstra). user="$(sed -n -e "s/^[ ]//" -e "s/ .* ora_pmon_${sid} *$//p" ${PROC_FILE})" if [ -n "${user}" ] then echo "${user} ${sid} ${home}" else echo "_ ${sid} ${home}" fi done return; } # Perform oracle query # Requires: ${ORACLE_HOME} and ${ORACLE_USER} # Syntax: # - scc_oracle_query # - scc_oracle_query scc_oracle_query () { # This routine only works for Oracle 7.3 and later! ORA_USE_PROFILE=${ORA_USE_PROFILE:-0} # We create a shellscript that will be interpreted. # The structure of the shellscript contains a nested here-document: # su ${ORACLE_USER} </dev/null </dev/null < ...) in the output. echo "" # add one CR echo "exit" echo "EOF_QRY" echo "EOF_SU" # the output of the script above, executed by sh below MUST be redirected # to the TMP file, because of strange behavior of Oracle 7 svrmgrl } | sh >${TMP_FILE} 2>/dev/null if [ -z "${force_sqlplus_query:-}" ] then grep -l "^no rows selected" ${TMP_FILE} >/dev/null 2>/dev/null if [ $? -ne 0 ] then 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 's/[ ]*$//' \ -e '/^1 row selected/d' \ -e '/^no rows selected/d' \ -e '/^[0123456789]* rows selected/d' ${TMP_FILE} fi else cat ${TMP_FILE} fi rm ${TMP_FILE} return 0; } # Record Linux distribution # Syntax: # - no arguments: set variable SCC_LINUX_DISTRO # - : show contents of release file of Linux distribution scc_linux_distro() { export SCC_LINUX_DISTRO="" if [ "${OS_NAME}" != "Linux" ] then return 0 fi # Usually we trust /etc/lsb-release, however some distro record their base-distro in that file. # Check the following distro's first. while read file distro do if [ -f "${file}" ] then export SCC_LINUX_DISTRO="${distro}" if [ $# -eq 1 ] then echo "${1} file:${file}" if [ -x "${file}" ] then "${file}" 2>/dev/null else cat "${file}" fi | sed -e "s@^@${1} details:@" fi return 0 fi done <<-_X_ /etc/crunchbang-lsb-release crunchbang /etc/sabayon-edition sabayon /etc/SuSE-release SuSe /etc/pardus-release Pardus /etc/unity-release unity /etc/zevenos_version zevenos _X_ # Alpine 2.0 contains a broken symlink file=/etc/alpine-release if [ -h ${file} ] then export SCC_LINUX_DISTRO=alpine if [ -f ${file} -a $# -eq 1 ] then echo "${1} file:${file}" sed -e "s@^@${1} details:@" ${file} fi return 0 fi # Now for the default file. LSB_FILE=/etc/lsb-release if [ -f ${LSB_FILE} ] then SCC_LINUX_DISTRO="$(sed -n -e 's/"//g' -e 's/.*DISTRIB_ID=//p' "${LSB_FILE}")" if [ $# -eq 1 ] then sed -n -e 's/"//g' -e 's/.*DISTRIB_RELEASE=/fix:general::linux distro version:/p' "${LSB_FILE}" echo "${1} file:${LSB_FILE}" sed -e "s@^@${1} details:@" "${LSB_FILE}" fi return 0 fi # Scientific Linux is RedHat based and uses the redhat-release file if [ -f /etc/redhat-release ] then grep "Scientific Linux" /etc/redhat-release >/dev/null 2>/dev/null if [ $? -eq 0 ] then SCC_LINUX_DISTRO="scientific" if [ $# -eq 1 ] then echo "${1} file:/etc/redhat-release" sed -e "s@^@${1} details:@" /etc/redhat-release fi return 0 fi fi if [ -f /etc/aLinux ] then SCC_LINUX_DISTRO="aLinux" if [ $# -eq 1 ] then echo "${1} file:/etc/aLinux" awk '{ print l $1, $2 }' l="${1} details:" /etc/aLinux fi return 0 fi if [ -f /etc/VERSION ] then SCC_LINUX_DISTRO="T2" if [ $# -eq 1 ] then awk '{ print "fix:general::linux distro version:" $3; exit( 0 )}' /etc/VERSION echo "${1} file:/etc/VERSION" sed -e "s@^@${1} details:@" /etc/VERSION fi return 0 fi if [ -f /etc/pki/rpm-gpg/clearos-gpg-key -a -f /etc/release ] then SCC_LINUX_DISTRO="clearos" if [ $# -eq 1 ] then echo "${1} file:/etc/release" sed -e "s@^@${1} details:@" "/etc/release" fi return 0 fi if [ -f /etc/dreamlinux/dreaminstalled -a -f /usr/local/etc/dli.yaml ] then SCC_LINUX_DISTRO="DreamLinux" if [ $# -eq 1 ] then echo "${1} file:/usr/local/etc/dli.yaml" sed -n -e "s@^dl_version@${1} details:dl_version@p" /usr/local/etc/dli.yaml fi return 0 fi # Check for Feather: no version (at the moment): check before debian. if [ -f /usr/local/bin/feather-custom-install ] then export SCC_LINUX_DISTRO=feather if [ $# -eq 1 ] then echo "${1} file:/usr/local/bin/feather-custom-install" fi return 0 fi # Several distro's are based on others and have more than one release/version file. # First check for derived distro's and stop after the first match. while read file distro do if [ -f "${file}" ] then export SCC_LINUX_DISTRO="${distro}" if [ $# -eq 1 ] then echo "${1} file:${file}" if [ -x "${file}" -a "${file%/*}" = "/usr/bin" ] then "${file}" 2>/dev/null else cat "${file}" fi | sed -e "s@^@${1} details:@" fi return 0 fi done <<-_X_ /etc/asianux-release asianux /etc/e-smith-release sme /etc/caos-release caos /etc/tinyme-release tinyme /etc/pclinuxos-release pclinuxos /etc/goblinx-version goblinx /etc/dragora-version dragora /etc/distro-release rPath /etc/frugalware-release frugalware /etc/sun-release SunJDS /etc/mepis-release mepis /etc/yellowdog-release yellowdog /etc/mandriva-release mandriva /etc/mandrakelinux-release mandrake /etc/zenwalk-version zenwalk /etc/altlinux-release AltLinux /usr/share/doc/tc/release.txt tinycore /usr/bin/crux CRUX /usr/share/doc/dsl/release.txt DSL /etc/GoboLinuxVersion GoboLinux /etc/SLOX-release SLOX /etc/idms-release idms /etc/sinux-release sinux /etc/slax-version slax /etc/vector-version vector /etc/linuxconsole linuxconsole /usr/bin/deli deli /etc/finnix-version finnix /etc/debris-release debris /etc/debian_version debian /etc/engarde-release engarde /etc/fedora-release fedora /etc/gentoo-release gentoo /etc/lunar.release lunar /etc/mandrake-release mandrake /etc/momonga-release momonga /etc/pld-release pld /media/ploplinux/ploplinux ploplinux /etc/linuxmint/info Mint /etc/nutyx-version nutyx /etc/bulinux-release bulinux /etc/redhat-release redhat /etc/rms-version rms /etc/syn3-version syn3 /etc/sms-version sms /etc/slackware-version slackware /etc/slitaz-release slitaz /etc/turbolinux-release turbolinux /etc/unraid-version unRAID /etc/UnitedLinux-release UnitedLinux /etc/vima-release VIMA /etc/vma-release VMA /etc/vmware-release VMware /etc/yoper-release Yoper _X_ # And now some distro's that require some extra work to determine the details. if [ -x /usr/sbin/kpkg -a -d /usr/shware/kwort/kpkg ] then # No details: export SCC_LINUX_DISTRO="kwort" return 0 fi if [ -f /etc/arch-release ] then if [ -s /etc/arch-release ] then grep ConnochaetOS /etc/arch-release >/dev/null 2>/dev/null if [ $? -eq 0 ] then export SCC_LINUX_DISTRO="ConnochaetOS" else export SCC_LINUX_DISTRO="archlinux" fi if [ $# -eq 1 ] then echo "${1} file:/etc/arch-release" 2>/dev/null sed -e "s@^@${1} details:@" /etc/arch-release 2>/dev/null fi return 0 fi # This file does not contain additional info. # Firefly is based on archlinux, search for the specific product directory: version="$(find /var/lib/pacman/local -type d 2>/dev/null | sed -n -e 's/.*firefly-branding-//p')" if [ "${version}" ] then export SCC_LINUX_DISTRO="firefly" if [ $# -eq 1 ] then echo "${1} details:${version}" fi return 0 fi export SCC_LINUX_DISTRO="archlinux" # Now try archlinux distro itself: version="$(find /var/lib/pacman/sync/extra -type d 2>/dev/null | sed -n -e 's/.*archlinux-installer-//p')" if [ "${version}" ] then if [ $# -eq 1 ] then echo "${1} details:${version}" fi return 0 fi fi if [ -d /etc/endian ] then export SCC_LINUX_DISTRO="endian" if [ $# -eq 1 ] then echo "${1} file:/etc/release" 2>/dev/null sed -e "s@^@${1} details:@" /etc/release 2>/dev/null fi return 0 fi # Check for Astaro appliances grep "Astaro" /etc/product >/dev/null 2>/dev/null if [ $? -eq 0 ] then export SCC_LINUX_DISTRO="$(sed -n -e 's/.$//' -e 's/.*ID.*=> *.//p')" if [ $# -eq 1 ] then echo "${1} file:/etc/product" sed -e "s@^@${1} details:@" /etc/product if [ -f /etc/version ] then echo "${1} file:/etc/version" sed -e "s@^@${1} details:@" /etc/version fi fi return 0 fi # Check for ipcop if [ -x /usr/local/bin/ipcopbkcfg -a -d /var/ipcop ] then export SCC_LINUX_DISTRO=ipcop if [ $# -eq 1 ] then if [ -f /etc/issue ] then echo "${1} file:/etc/issue" sed -e "s@^@${1} details:@" /etc/issue fi fi return 0 fi # Check for PuppyLinux puppy_file="/etc/puppy" if [ -f /etc/puppyversion ] then puppy_file=/etc/puppyversion fi if [ -z "${SCC_LINUX_DISTRO}" -a -f "${puppy_file}" ] then export SCC_LINUX_DISTRO=PuppyLinux if [ $# -eq 1 ] then echo "${1} file:${puppy_file}" echo "${1} details:$(head -n 1 "${puppy_file}")" fi return 0 fi # Check for ttylinux: tty_file=/etc/rc.d/rc.sysinit if [ -z "${SCC_LINUX_DISTRO}" -a -f "${tty_file}" ] then # Example data: # echo -e "\t\t\t-=#\tttylinux 5.3\t#=-" grep -l ttylinux "${tty_file}" 2>/dev/null >/dev/null if [ $? -eq 0 ] then export SCC_LINUX_DISTRO=ttylinux if [ $# -eq 1 ] then echo "${1} file:${tty_file}" echo "${1} details:ttylinux $(sed -n -e 's/.*ttylinux //p' "${tty_file}" | sed -e 's/[^0-9.]//g')" fi return 0 fi fi if [ -f /etc/system-release ] then # Example data: # IPFire 2.5 - core36 export SCC_LINUX_DISTRO=$(sed -e 's/[ ].*//' /etc/system-release) if [ $# -eq 1 ] then echo "${1} file:/etc/system-release" sed -e "s@^@${1} details:@" /etc/system-release fi return 0 fi # Check for Syllable Syllable_file=/proc/sys/kernel/osrelease if [ -f "${Syllable_file}" ] then grep Syllable "${Syllable_file}" >/dev/null 2>/dev/null if [ $? -eq 0 ] then export SCC_LINUX_DISTRO=Syllable # No details: the file indicates the kernel version and not the distro release. return 0 fi fi if [ -f /etc/issue ] then details="$(sed -n -e 's/.*paldo \([^ ][^ ]*\) .*/paldo \1/p' /etc/issue)" if [ "${details}" ] then export SCC_LINUX_DISTRO=paldo if [ $# -eq 1 ] then echo "${1} file:/etc/issue" echo "${1} details:#{details}" fi return 0 fi fi return 0; } # On some systems, there is no "strings", replace the functionality by a function. strings_exe="$(which strings 2>/dev/null)" if [ ! -x "${strings_exe}" ] then strings() { # Replace all binary nuls by a linefeed to avoid lines that are too long. # Then delete all non-printables. if [ $# -eq 0 ] then tr -s "\000" "\012" else tr -s "\000" "\012" <$1 fi | tr -d -c "[_a-zA-Z0-9 \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. utils_what_exe="$(which what 2>/dev/null)" if [ ! -x "${utils_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 # Add PPID to output of BusyBox ps # Syntax: # - no arguments busybox_ps() { # BusyBox ps does not show PPID. # Get all PPID's from the status files in /proc and add them to the output of ps. ps >${TMP_FILE} find /proc -name status 2>/dev/null | grep "^/proc/[0-9]*/status" | xargs ${AWK} '/^PPid|^Pid/ { print "awk", $0 }' 2>/dev/null | ${AWK} '/^awk Pid/ { pid = $3; next } /^awk PPid/ { ppid[ pid ] = $3; next } /^ PID/ { printf( "%s", substr( $0, 0, 14 ) ); printf( "%6s", "PPID" ); printf( "%s\n", substr( $0, 15 ) ); next; } { printf( "%s", substr( $0, 0, 14 ) ); printf( "%6s", ppid[ $1 ] ); printf( "%s\n", substr( $0, 15 ) ); }' - ${TMP_FILE} rm -f ${TMP_FILE} return; } # Check whether program is implemented by busybox. # Currently only works for programs in /bin # Syntax: # - program to check # Return value: # - 0 program NOT implemented by busybox # - 1 program implemented by busybox busybox_check() { if [ -x /bin/busybox ] then # Program is either a symbolic or hardlink to /bin/busybox. prog_e="$(which ${1} 2>/dev/null)" if [ -f "${prog_e}" ] then if [ -h "${prog_e}" ] then # Check whether the file links to program busybox. target="$(ls -l "${prog_e}" | sed -e 's@.*[ ][ ]*@@' -e 's@.*/@@')" if [ "${target}" = "busybox" ] then return 1; # Program is symbolic link to /bin/busybox fi else # Check for identical inodes (hard link). b_i="$(ls -li /bin/busybox | ${AWK} '{ print $1 }')" p_i="$(ls -li "${prog_e}" | ${AWK} '{ print $1 }')" if [ "${b_i}" -eq "${p_i}" ] then return 1; # Program is a hard link to busybox. fi fi fi fi return 0; } # Do not exit scc/scc-run/opt/scc/doc/004075500000000000003000000000003777777777700152315ustar00rootsys00000000000000scc/scc-run/opt/scc/doc/COPYING010040000000000000003000000431151167217303500162060ustar00rootsys00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.html010040000000000000003000000140011167217303500167420ustar00rootsys00000000000000 Manpage of scc

scc(4)




NAME

       scc - file formats used by SCC


RELEASE

       scc  1.17.23


DESCRIPTION

       SCC  stores  configuration data from systems in flat files called snap-
       shots. All configuration data is structured  by	prefixing  it  with  a
       fixed-variable  indication and with a hierarchical classification.  The
       indication, all elements of the classification  and  the	 configuration
       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 snap-
       shot 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 is at least  one	 level
       of  hierarchical classifications of the remaining data. The classifica-
       tion and the data are separated by two consecutive colons.

       When this file is altered (uucp should not run cron-jobs), the  missing
       line is reported in the logbook.	 The reported data contains the change
       itself (uucp)  and  the	classification	of  the	 altered  data	(soft-
       ware:cron:configuration::/var/adm/cron/cron.allow:).  Without the clas-
       sification 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::", indicat-
       ing 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 follow-
       ing 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.  This kind of errors  is  detected	and  reported  in  the
       snapshot by scc-collect.


LOGBOOK

       Two consecutive snapshots are compared using diff. 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 administrivia, finally  the	actual
       change  is  reported. The keyword old indicates that this data was only
       present in the old snapshot. So it has been removed  from  the  current
       configuration of the system.


KEEP-FILE

       The  keep-file is used to store data that is obtained from running pro-
       cesses, that might not be running during the next run of scc.  To avoid
       changes	in  the	 logbook  any time such a process 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-2004 Open Challenge B.V., 2004-2005 OpenEyeT Profes-
       sional Services, 2005-2011 QNH.


SEE ALSO

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


VERSION

       $Revision: 4592 $



scc/scc-run/opt/scc/doc/scc-5.html010040000000000000003000000340631167217303500167550ustar00rootsys00000000000000 Manpage of scc

scc(5)




NAME

       scc - introduction SCC


RELEASE

       scc  1.17.23


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 file system 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 file system will not be reported in the log-
       book, but the extension of a file system 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
       - Volume Management
       - 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  add-
       ons like MCServiceGuard and OmniBack.


INSTALLATION

       SCC  is	available  as  HPUX depot, Solaris package, RPM, *BSD package,
       Debian package and source tarball.  The software from the  depots/pack-
       ages/rpms   on	the   website  is  NOT	relocatable,  it  installs  in
       /opt/scc/bin Data- and temporary files are located in /var/opt/scc  and
       config  files in /etc/opt/scc It is possible to install the software in
       other directories.  Unpack the source tarball, edit and use  the	 relo-
       cate  script  and  generate the required depot/package/rpm.  Throughout
       this documentation only the default directories are mentioned.

       During the pre-install phase, the software runs	a  possibly  installed
       version	of SCC to capture the changes in configuration just before the
       installation.  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 9.0, 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.5.32 on HP-UX, use the commands:
	    swinstall -s $(pwd)/scc-1.5.32.hpux-1x.depot scc
       To register this file as a depot, use the command:
	    swreg -l depot $(pwd)/scc-1.5.32.hpux-1x.depot
       To add this file to an existing depot, use the command:
	    swcopy -s $(pwd)/scc-1.5.32.hpux-1x.depot scc @/your/depot
       To install release 1.5.32 of the SunOS package, use the commands:
	    pkgadd -d ./scc-1.5.32.sunos.pkg -a none scc
       You will be prompted for the execution of the pre/post-install scripts.

       To install release 1.5-32 of the RPM package, use the command:
	    rpm -U ./scc-1.5-32.rpm

       To install release 1.5-32 of the Debian package, use the command:
	    dpkg -i ./scc-1.5-32_all.deb

       To install release 1.5.32 of the source package, use the commands:
	    tar xf scc-1.5.32.src.tar
	    cd scc-1.5.32
	    ./scc-install

       To install release 1.5.32 of the FreeBSD package, use the command:
	    pkg_add scc-1.5.32.FreeBSD.tgz

       To upgrade from release 1.5.31, use the command:
	    pkg_delete scc-1.5.31
	    pkg_add scc-1.5.32.FreeBSD.tgz

       To install release 1.5.32 of the NetBSD package, use the command:
	    pkg_add scc-1.5.32.NetBSD.tgz

       To upgrade, use the command:
	    pkg_add -u scc-1.5.32.NetBSD.tgz

       To install release 1.5.32 of the OpenBSD package, use the command:
	    pkg_add scc-1.5.32-OpenBSD.tgz


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 has been
       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 hard-
       ware or software error on the system.  Running SCC is some  kind	 of  a
       health check 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,  sum-
       maries of the SCC-data are generated and all data is accessible through
       a web-interface.

       To mark the completion of certain changes you performed	on  a  system,
       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


CUSTOMIZING/EXTENDING SCC

       scc-collect(1) and its modules use sensible defaults to avoid that many
       systems	require	 a configuration file.	When the defaults are insuffi-
       cient, check the code for a reference  of  scc-localize.	  This	script
       contains	 several  environment variables that influence the behavior of
       scc.   To  adjust  scc,	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.

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

       DBA's  will only be interested in part of the SCC-data of a system.  By
       using the file /etc/opt/scc/conf/scc-split.conf it is possible to split
       the snapshot in several parts.  Each Oracle SID can have its' own snap-
       shot and logfile.  When these snapshots are  send  to  the  scc-server,
       they  can  be  added to a separate realm that only contains SCC-data of
       Oracle SID's.  Refer to	/etc/opt/scc/newconfig/scc-split.conf  and  to
       scc-log(1) for examples and more details.

       SCC ships with several user modules that are not run by default.	 Check
       the directory /opt/scc/bin/scc_modules for scripts containing "_u_"  in
       their  name.   These are user-modules that can be activated by means of
       the -e option of scc.  Refer to the manual page of  scc-collect(1)  and
       scc(1) for a more detailed description of the use of modules.

       To  add or modify specific user modules for all your systems, customize
       the depot/rpm and packages.  This can  be  achieved  by	unpacking  the
       source  tarball	and adding/modifying the required files.  Refer to the
       README file in the source tree for more	details	 concerning  producing
       the depot/rpm/package.


PERFORMANCE

       Usually	scc  completes	its runs within minutes.  When you notice that
       runs of scc on a system take very long to complete,  you	 can  use  the
       profiling  data	to  determine  the cause.  Edit /etc/opt/scc/conf/scc-
       localize to activate the variable SCC_PROFILING and run scc.  When this
       file does not exist, you can copy it from /etc/opt/scc/newconfig.  Pro-
       filing data is added to the snapshot and can be found in the  html-file
       under the classification: "profiling".  Each line of the profiling data
       consists of the following fields:
       - timestamp
       - seconds since previous stamp
       - seconds since start of run
       - comment
       Look for large values in the second column to locate the	 code  of  scc
       that is causing this performance problem.  An example of profiling data
       is:
       var:profiling::11.20.10:	   0 :	  0 :start of run
       var:profiling::11.20.10:	   0 :	  0 :start of run:    scc_0000_s_general
       var:profiling::11.20.13:	   3 :	  3 :end of run: scc_0000_s_general
       var:profiling::11.20.13:	   0 :	  3 :start of run:     scc_0100_s_boot
       var:profiling::11.20.17:	   4 :	  7 :end of run:      scc_0100_s_boot
       var:profiling::11.20.17:	   0 :	  7 :start of run:     scc_0200_s_hardware
       var:profiling::11.20.18:	   1 :	  8 :end of: hardware: AutoRAID
       var:profiling::11.20.18:	   0 :	  8 :end of: hardware: FC60-array
       var:profiling::11.21.43:	  85 :	 93 :end of: hardware: disk
       var:profiling::11.21.54:	  11 :	104 :end of: hardware: ioscan
       var:profiling::11.22.18:	  24 :	128 :end of: hardware: stm
       var:profiling::11.22.18:	 121 :	128 :end of run:      scc_0200_s_hardware
       var:profiling::11.22.18:	   0 :	128 :start of run:     scc_0300_s_kernel
       var:profiling::11.22.25:	   7 :	135 :end of run:       scc_0300_s_kernel
       var:profiling::11.22.25:	   0 :	135 :start of run:     scc_0400_s_vol_mngt
       var:profiling::11.22.34:	   9 :	144 :end of: Volume Management: file systems
       var:profiling::11.22.43:	  18 :	153 :end of run:       scc_0400_s_vol_mngt
       var:profiling::11.22.43:	   0 :	153 :start of run:     scc_0500_s_network
       var:profiling::11.26.43:	 240 :	393 :end of run:       scc_0500_s_network
       var:profiling::11.26.43:	   0 :	393 :start of run:     scc_0500_u_named
       var:profiling::11.26.44:	   0 :	393 :end of run:       scc_0500_u_named
       var:profiling::11.26.44:	   1 :	394 :start of run:     scc_0600_s_software
       var:profiling::11.28.14:	  90 :	484 :end of: software: ignite
       var:profiling::11.43.28: 1004 : 1398 :end of run:      scc_0600_s_software
       var:profiling::11.43.28:	   0 : 1398 :start of run:     scc_0700_s_hp_ov
       var:profiling::11.43.31:	   3 : 1401 :end of run:       scc_0700_s_hp_ov
       var:profiling::11.43.31:	   0 : 1401 :start of run:     scc_0700_u_hp_ovou_srv
       var:profiling::11.43.31:	   0 : 1401 :end of run:       scc_0700_u_hp_ovou_srv
       var:profiling::11.43.31:	   0 : 1401 :start of run:     scc_0800_s_oracle
       var:profiling::11.43.32:	   1 : 1402 :end of run:       scc_0800_s_oracle
       var:profiling::11.43.32:	   0 : 1402 :start of run:     scc_0900_s_system
       var:profiling::11.43.35:	   3 : 1405 :end of run:       scc_0900_s_system
       var:profiling::11.43.35:	   0 : 1405 :start of run:     scc_1000_s_users
       var:profiling::11.43.40:	   5 : 1410 :end of run:       scc_1000_s_users
       var:profiling::11.43.40: 1410 : 1410 :end of run
       var:statistics::profiling

       The software module used 1004  seconds  to  complete  after  collecting
       ignite  data.   After adding some more calls to the profiling function,
       it appeared that the SD-UX commands took way too long.  Further	inves-
       tigation	 indicated  the	 source	 of the problem.  After correcting the
       problem, scc ran much faster.


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-2004 Open Challenge B.V., 2004-2005 OpenEyeT Profes-
       sional Services, 2005-2011 QNH.


SEE ALSO

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


VERSION

       $Revision: 4592 $



scc/scc-run/opt/scc/doc/scc-cmp.html010040000000000000003000000052101167217303300173560ustar00rootsys00000000000000 Manpage of scc-cmp

scc-cmp(1)



NAME


	scc-cmp - compare two SCC-snapshots

RELEASE


	scc	1.17.23

SYNOPSIS


	scc-cmp <prev> <new> <remark> <ignore>

DESCRIPTION


	This program compares the current and new snapshots, ignoring some
	data by means of the sed-expressions <ignore>. The results of the 
	compare are written to stdout.

	Do not signal all changes when new and previous snapshots are less 
	than 20% of each other or when the number of differences execeeds 20.000
	lines. Reduce the differences to the count of all classes of the
	differences.

ARGUMENTS


	<prev>          The snapshot of the previous run. Absence of this file
	                indicates a (re)start.
	<new>          	The snapshot of the current run.
	<remark>       	Remark to be added to logbook.
	<ignore>       	Sed-statements ignoring certain data.

OPTIONS


	None.

DIAGNOSTICS


	This program writes the following messages to stderr:

	Syntax error, use: scc-cmp <prev> <new> <remark> <ignore>
	A syntax error has been detected and reported.

	scc-cmp: cannot access file <new>
	The new snapshot cannot be found.

EXTERNAL INFLUENCES


	This program is part of the SCC client, but is also used by the
	SCC server.

	This program will not work correctly when diff is implemented by busybox.
	The SCC client checks for this dependency before calling this program, the
	SCC server software not.

RETURN VALUE


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

		0 successful completion
		1 Syntax error
		2 Runtime error

COPYRIGHT


	scc-cmp is free software under the terms of the GNU General Public 
	License. Copyright (C) 2001-2004 Open Challenge B.V.,
	2004-2005 OpenEyeT Professional Services, 2005-2011 QNH.

FILES


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

SEE ALSO


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

VERSION


	$Revision: 4778 $

scc/scc-run/opt/scc/doc/scc-collect.html010040000000000000003000000163221167217303300202320ustar00rootsys00000000000000 Manpage of scc-collect

scc-collect(1)



NAME


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

RELEASE


	scc	1.17.23

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 all system modules and the user-module to catch 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 system modules and 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 will be made before the 
	next run.

	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.

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, specify:

		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 in scc-localize to add
	timing data to the snapshot. This enables you to locate possible performance 
	bottlenecks. The default value activates profiling and performance
	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: Syntax error, missing argument for option <option>
	The indicated option is missing argument(s).

	scc-collect: use -i option to run interactive
	Avoid immediately running all collection scripts interactively.
	
	scc-collect: insufficient access to data directory: <data_dir>
	To run this program, log in as the owner of the directory.

	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-2004 Open Challenge B.V.,
	2004-2005 OpenEyeT Professional Services, 2005-2011 QNH.

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-cmp(1), scc-collect(1), scc-log(1), scc-log2html(1),
	scc-plugin(1), scc-snap2html(1), scc(4), scc(5)

VERSION


	$Revision: 4784 $

scc/scc-run/opt/scc/doc/scc-log.html010040000000000000003000000216341167217303400173710ustar00rootsys00000000000000 Manpage of scc-log

scc-log(1)



NAME


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

RELEASE


	scc	1.17.23

SYNOPSIS


	scc-log [ -c|--comment <remark> ]
		[ -e|--extra <mod> ]
		[ -m|--max_age <max> ]
		[ -r|--reset ]
		[ -u|--uninstall ]
		[ --upgrade ]
		[ -v|--virtual <host> ]

DESCRIPTION


	This program calls scc-collect to create a SCC-snapshot and compares
	it with a previous snapshot. All differences are added to a logbook.
	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.

	scc-collect runs system and user modules. Each module collects
	specific configuration data. You can extend the "reach" of scc by
	writing and scheduling your own user modules. Refer to scc-collect(1)
	for a detailed description of modules and how to schedule and maintain
	them.

	The data in the snapshot can be split into several, partial snapshots. 
	This is done before comparing it with a previous snapshot. The mechanism
	can be used to provide Oracle DBA's with a snapshot for each Oracle 
	instance. It can also be used to separate each package in a ServiceGuard
	cluster. The partial snapshots of these packages can be compared on the
	scc-srv. This avoids many changes in the logbooks of a cluster, when a
	package "switches".
	Refer to the file /etc/opt/scc/newconfig/scc-split.conf for more details.

	The contents of the data generated by the modules are tested to 
	check their format. Lines with unknown formats are prefixed with the
	classification: "fix:messages::". The philosophy of scc is to collect
	data, not to interpret it. scc signals when it is unable to collect
	configuration data. Any interpretation of the correctness of the
	data can be done by the program scc-rules of scc-srv.

	In rare occasions, scc-collect "hangs". Use the following command
	to find the child processes 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 log file 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. To avoid massive
	changes in the logbook during the pre-install run and the run after the
	install, the rpm data is taken from a "keep" file. Each run of scc that
	is not performed during install, records all rpm data not only in the
	snapshot, but also in the keep file. This mechanism does not work for
	the initial install of scc as the keep file does not yet exist. In that case
	all rpm changes are ignored and this is recorded with a specific remark
	in the logbook.

	This mechanism is also used for packages on BSD systems.

	On AIX systems, the installed rpm packages are also listed as AIX
	installp packages. To avoid changes in the logbook for each install of
	scc, the above mechanism is extended to AIX packages when rpm packages
	have been installed.

ARGUMENTS


	None.

OPTIONS


	-c|--comment <remark>   Add a remark to the logbook, indicating a "specific" 
	                        reason to run scc. For instance to mark the successful
	                        configuration/change of a system.
	-e|--extra <mod>        scc-collect runs user module <mod> when collecting data.
	-m|--max_age <max>      Entries in the log-file, that are older than <max>
	                        months, are deleted
	-r|--reset              Remove the current snapshot to avoid comparing it with
	                        the new (incompatible/incomplete) snapshot.
	-u|--uninstall          Remove all snapshots, logbooks en html-files and exit
	--upgrade               Implies -r and -c options.
	-v|--virtual <host>     Do not use the hostname of the system, as base for all
	                        scc-files, use <host> instead. This option should be
	                        used to run specific user modules with frequently
	                        changing data using the -e option. This avoids
	                        "changes" in the scc-data of the system itself.
	                        Note that no system modules run when the -v option is
	                        used. Requires the use of the -e option.

DIAGNOSTICS


	This program writes the following messages to stderr:

	Syntax error, use: scc-log [ -c|--comment <remark> ]
		[ -e|--extra <mod> ] [ -m|--max_age <max> ]
		[ -r|--reset | -u|--uninstall ] [ --upgrade ]
		[ -v|--virtual <host> ]
	A syntax error has been detected and reported.

	scc-log: Syntax error, missing argument for option <option>
	The indicated option is missing argument(s).

	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 lock file contains the PID of scc-log. When the lock-file exists and
	the process with the PID does not exist, the lock file is removed and 
	scc-log continues to run. Remove the lock file 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.

	scc-log: use -e option with -v option
	The -v option can only be used when the -e option is used.

EXTERNAL INFLUENCES


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

	When diff is implemented via busybox, the logbook will be left empty
	and all compares should be done on the scc-srv.

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-2004 Open Challenge B.V.,
	2004-2005 OpenEyeT Professional Services, 2005-2011 QNH.

FILES


	/var/opt/scc/tmp - directory for temporary files
		scc.lock - lock file to indicate that SCC runs
	/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-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
			This symbolic link is used to detect whether the
			name of the system has changed. When this is the
			case, all scc.<hostname>.* files are renamed.
		index.html - compatibility for snapshot on scc-srv
		plugin_data/ - directory with snapshots from plugins

	/etc/opt/scc/conf/scc-split.conf - specification to split the
		data of the snapshot into several files of pseudo hosts.
		This file can be used to provide each Oracle instance with
		its own snapshot. The file is installed in the subdirectory
		newconfig to avoid that your changes are erased by an upgrade.
		This file is ignored when the -v option is used.

SEE ALSO


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

VERSION


	$Revision: 4797 $

scc/scc-run/opt/scc/doc/scc-log2html.html010040000000000000003000000047401167217303300203360ustar00rootsys00000000000000 Manpage of scc-log2html

scc-log2html(1)



NAME


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

RELEASE


	scc	1.17.23

SYNOPSIS


	scc-log2html [ -s|--standalone ] <name>

DESCRIPTION


	This program reads a SCC-logbook from stdin and converts it to HTML-
	format on stdout. Refer to scc(4) for a detailed description of 
	SCC-logbook. An empty logbook results in an empty html-file.

	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.

	The logbook contains DIV-tags with the following nested classes:
	    - SCC_LOG
	        - SCC_LOG_NAV
	        - SCC_LOG_SUMMARY
	        - SCC_LOG_STATS
	        - SCC_LOG_ENTRY

OPTIONS


	-s|--standalone embed the stylesheet in the html-data and do not
	                show "externel" links to snapshot and index.html.
	                Use this option before transferring the html
	                version of the logbook to a user.

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 [ -s|--standalone ] <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-2004 Open Challenge B.V.,
	2004-2005 OpenEyeT Professional Services, 2005-2011 QNH.

FILES


	/var/opt/scc/data/style.css - stylesheet
	/var/opt/scc/tmp - directory for temporary files

SEE ALSO


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

VERSION


	$Revision: 4795 $

scc/scc-run/opt/scc/doc/scc-plugin.html010040000000000000003000000047001167217303400201010ustar00rootsys00000000000000 Manpage of scc-plugin

scc-plugin(1)



NAME


	scc-plugin - template for a user module

RELEASE


	scc	1.17.23

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-2004 Open Challenge B.V.,
	2004-2005 OpenEyeT Professional Services, 2005-2011 QNH.

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-cmp(1), scc-collect(1), scc-log(1), scc-log2html(1),
	scc-plugin(1), scc-snap2html(1), scc(4), scc(5)

VERSION


	$Revision: 4778 $

scc/scc-run/opt/scc/doc/scc-snap2html.html010040000000000000003000000052751167217303400205230ustar00rootsys00000000000000 Manpage of scc-snap2html

scc-snap2html(1)



NAME


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

RELEASE


	scc	1.17.23

SYNOPSIS


	scc-snap2html [ -s|--standalone ] <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 detailed description of a SCC-snapshot.

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

	Variable data is shown with a different color. The default color 
	for variable data is "purple", but this can be changed by editing 
	the style.css in /var/opt/scc/data.

	The snapshot contains DIV-tags with the following nested classes:
	    - SCC_SNAP
	        - SCC_SNAP_NAV
	        - SCC_SNAP_MENU
	        - SCC_SNAP_ENTRY
	        - SCC_SNAP_STATS
	        - SCC_SNAP_HELP

OPTIONS


	-s|--standalone embed the stylesheet in the html-data and do not
	                show "externel" links to logbook and index.html.
	                Use this option before transferring the html
	                version of the snapshot to a user.

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 [ -s|--standalone ] <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-2004 Open Challenge B.V.,
	2004-2005 OpenEyeT Professional Services, 2005-2011 QNH.

FILES


	/var/opt/scc/tmp - directory for temporary files
	/var/opt/scc/data/style.css - stylesheet for snapshot (and logbook)

SEE ALSO


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

VERSION


	$Revision: 4790 $

scc/scc-run/opt/scc/doc/scc.html010040000000000000003000000351411167217303400166100ustar00rootsys00000000000000 Manpage of scc

scc(1)



NAME


	scc - collect and send snapshot-files to server

RELEASE


	scc	1.17.23

SYNOPSIS


	scc [ -a|--alternate <alt> ] [ -c|--comment <remark> ] [ -d|--delay <delay> ]
	        [ -e|--extra <mod> ] [ -f|--fqdn ]
	        [ -F|--from <from> ] [ -i|--smtp <smtp> ]
	        [ -I|--ident <ident> ] [ -k|--key <key> ]
		[ -m|--max_age <max> ] [ -n|--norun ] [ -p|--prog <prog> ]
	        [ -P|--port <port> ] [ -r|--restart ]
	        [ -s|--destination <dest> ] [ -t|--test ]
	        [ -u|--user <user> ] [ -v|--virtual <host> ] [ -V|--version ]

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 ftp, 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. The default value activates profiling and performance
	data is added to the snapshot.

	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.

OPTIONS


	-a|--alternate <alt>      Use <alt> as directory where from snapshots
	                          and logbooks of alternate systems are to
	                          be transferred to the scc-server.
	                          The -f option is ignored. The program
	                          that produces the alternate snapshots is
	                          responsible for the correct format and
	                          contents of the scc-data.
	                          When the files are symbolic links, they are
	                          removed after transferring their contents.
	                          For each system <s>, this directory should
	                          contain the files: scc.<s>.cur, scc.<s>.log,
	                          scc.<s>.html and scc.<s>.log.html
	-c|--comment <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 <delay>        Maximum delay (in seconds) to wait before the
	                          files are transmitted to <dest>. Default delay
	                          is 300 seconds.
	-e|--extra <mod>          scc-collect runs user module <mod> when
	                          collecting data.
	-f|--fqdn                 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.
	-F|--from <from>          Mail-address used as sender of mailed data.
	                          Default value is <root@host.domain.com>.
	-i|--smtp <smtp>          SMTP-server to connect to; implies "-p smtp".
	                          Use the -F option when the SMTP-server does
	                          not allow relaying and the domain of the system
	                          differs from the domain of the SMP-server.
	                          Check the logfile in /var/opt/scc/data.
	-I|--ident <ident>        Identity file for scp; implies "-p scp"
	-k|--key <key>            File containing public key of scc-server;
	                          used to encrypt the data that is sent via 
	                          mail/smtp.
	-m|--max_age <max>        Entries in the log-file, that are older
	                          than <max> months, are deleted
	-n|--norun                Do not collect new SCC-data. Send the files
	                          right away.
	-p|--prog <prog>          Use <prog> to send the files in a specific
	                          packaged bundle to scc-server. Default value
	                          for <prog> is mail. Supported values are:
	                            cp      copy to local directory <dest>
	                            ftp     transfer to <dir> on <host> by using ~/.netrc
	                            mail    email to scc-server
	                            pull    local transfer to /var/opt/scc/data/transfer;
	                                    transfer is done later by scc-srv.
	                                    Implies -d 0 and ignores -s options.
	                            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. Optionally use the port
	                                    specified with the -P option.
	                                    Logfile in /var/opt/scc/data/smtp.log
	-P|--port <port>          The non-default port for -p scp|smtp.
	-r|--restart              Restart collection by removing the existing/current
	                          snapshot. This option is usefull for systems with
	                          frequent changes where you want the latest snapshot
	                          on scc-srv.
	-s|--destination <dest>   Destination to send the files to. The format 
	                          depends upon the transfer program:
	                            cp          local directory: /var/opt/scc/data
	                            ftp         destination: <host>:<dir>
	                            mail|smtp   email-address: scc@myserver.com
	                                        With smptp, use the -F option when
	                                        the domain of <dest> differs from the
	                                        domain of the SMTP-server (-i option).
	                            rcp|scp     destination: <user>@<host>:<dir>
	                                        The <user> and <dir> parts are optional.
			                        Optional use the port for scp specified
                                             with the -P option.
	-t|--test                 Test connectivity by sending empty files, no delay 
	                          is used (implies -d 0).
	-u|--user <user>          To be used with -p pull option. The files can be 
	                          transferred by <user>.
	-v|--virtual <host>       Do not use the hostname of the system, as base for
	                          all scc-files, use <host> instead. This option should
	                          be used to run specific user modules with frequently
	                          changing data using the -e option. This avoids
	                          "changes" in the scc-data of the system itself.
	                          Note that no system modules run when the -v option is
	                          used. Requires the -e option.
	-V|--version              Print version of program and exit

ARGUMENTS


	None.

DIAGNOSTICS


	The program issues the following messages to stderr:

	Syntax error, use: scc <options>
	A syntax error has been detected and reported.

	scc: Syntax error, missing argument for option <option>
	The indicated option is missing argument(s).

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

	scc: wrong format with of mail-address: <address>
	The mail-address (supplied with the -F or the -s option) does not 
	start with "<" or does not end with ">".

	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 scc data to scc-srv. 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.

	scc: cannot find nc and telnet to transfer data
	One of these programs is used to send data via smtp to scc-srv.

	scc: scp not found
	This program is used to send the scc data to scc-srv.

	scc: cannot use -t option combined with -a option
	Do not combine the -a and the -t option.

	scc: cannot access target directory: <dest>
	The target directory for the copy does not exist.

	scc: cannot determine domainname
	The domainname cannot be determined while using the -f option.

	scc: cannot access <alt>
	The directory for scc-data of alternate systems cannot be accessed.

	scc: cannot access identity_file <ident>
	The identity file for scp cannot be accessed.

	scc: unknown user: <user>
	The supplied username is not a known user.

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@otherserver.mydom>"

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

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

	Refer to the manual page of scc-srv 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 of scc-srv for the setup of the scc-server.

	The files that are send to the server, do not contain the style.css
	and main index.html file as this transfer to the sever is meant to
	process the data from the client.

	This program uses gzip or compress to compress the data.
	It uses uuencode to transfer the data through email.
	Either netcat (nc) or telnet are used with transfer via smtp.

COPYRIGHT


	scc is free software under the terms of the GNU General Public 
	License. Copyright (C) 2001-2004 Open Challenge B.V.,
	2004-2005 OpenEyeT Professional Services, 2005-2011 QNH.

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
		smtp.log - logfile for transport with -p smtp
	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.
	- /var/opt/scc/data/transfer - directory for pull

	When the file /etc/opt/scc/conf/scc-split.conf is present, the
	data of the snapshot is split according to the specifications in
	this file. Refer to the manual page of scc-log for more details.

SEE ALSO


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

VERSION


	$Revision: 4778 $

scc/scc-run/opt/scc/man/004075500000000000003000000000003777777777700152375ustar00rootsys00000000000000scc/scc-run/opt/scc/man/man1/004075500000000000003000000000003777777777700160735ustar00rootsys00000000000000scc/scc-run/opt/scc/man/man1/scc-cmp.1010040000000000000003000000037671167217303300174330ustar00rootsys00000000000000.TH scc-cmp 1 "SCC" .nf .SH NAME .nf scc-cmp - compare two SCC-snapshots .SH RELEASE .nf scc 1.17.23 .SH SYNOPSIS .nf scc-cmp .SH DESCRIPTION .nf This program compares the current and new snapshots, ignoring some data by means of the sed-expressions . The results of the compare are written to stdout. Do not signal all changes when new and previous snapshots are less than 20% of each other or when the number of differences execeeds 20.000 lines. Reduce the differences to the count of all classes of the differences. .SH ARGUMENTS .nf The snapshot of the previous run. Absence of this file indicates a (re)start. The snapshot of the current run. Remark to be added to logbook. Sed-statements ignoring certain data. .SH OPTIONS .nf None. .SH DIAGNOSTICS .nf This program writes the following messages to stderr: Syntax error, use: scc-cmp A syntax error has been detected and reported. scc-cmp: cannot access file The new snapshot cannot be found. .SH EXTERNAL INFLUENCES .nf This program is part of the SCC client, but is also used by the SCC server. This program will not work correctly when diff is implemented by busybox. The SCC client checks for this dependency before calling this program, the SCC server software not. .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-cmp is free software under the terms of the GNU General Public License. Copyright (C) 2001-2004 Open Challenge B.V., 2004-2005 OpenEyeT Professional Services, 2005-2011 QNH. .SH FILES .nf /var/opt/scc/tmp - directory for temparary files .SH SEE ALSO .nf scc(1), scc-cmp(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5) .SH VERSION .nf $Revision: 4778 $ scc/scc-run/opt/scc/man/man1/scc-collect.1010040000000000000003000000146671167217303300203020ustar00rootsys00000000000000.TH scc-collect 1 "SCC" .nf .SH NAME .nf scc-collect - collect system configuration in a SCC-snapshot .SH RELEASE .nf scc 1.17.23 .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 all system modules and the user-module to catch 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 system modules and 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 will be made before the next run. 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. .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, specify: 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 in scc-localize to add timing data to the snapshot. This enables you to locate possible performance bottlenecks. The default value activates profiling and performance 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: Syntax error, missing argument for option