Advertisement
Guest User

Untitled

a guest
Apr 4th, 2016
1,816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 105.50 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # @(#) $Id: cfg2html-linux.sh,v 6.42 2015/04/06 08:47:28 ralph Exp $
  4. # -----------------------------------------------------------------------------------------
  5. # (c) 1997-2015 by Ralph Roth -*- http://rose.rult.at -*- Coding: ISO-8859-15
  6.  
  7. # If you change this script, please mark your changes with for example
  8. # ## <username> and send your diffs from the actual version to my mail
  9. # address: cfg2html*hotmail.com -- details see in the documentation
  10.  
  11. CFGSH=$_
  12. # unset "-set -vx" for debugging purpose, after the exec 2> statement all debug info will go the errorlog file (*.err)
  13. #set -vx
  14. #*vim:numbers:ruler
  15.  
  16. # ---------------------------------------------------------------------------
  17. # NEW VERSION - v6/github/GPL
  18. # __ ____ _ _ _ _ _
  19. # ___ / _| __ _|___ \| |__ | |_ _ __ ___ | | | (_)_ __ _ ___ __
  20. # / __| |_ / _` | __) | '_ \| __| '_ ` _ \| |_____| | | '_ \| | | \ \/ /
  21. # | (__| _| (_| |/ __/| | | | |_| | | | | | |_____| | | | | | |_| |> <
  22. # \___|_| \__, |_____|_| |_|\__|_| |_| |_|_| |_|_|_| |_|\__,_/_/\_\
  23. # |___/
  24. # system collector script
  25. #
  26. # ---------------------------------------------------------------------------
  27.  
  28. ## /usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
  29. PATH=$PATH:/sbin:/bin:/usr/sbin:/opt/omni/bin:/opt/omni/sbin ## this is a fix for wrong su root (instead for su - root)
  30.  
  31. _VERSION="cfg2html-linux version $VERSION " # this a common stream so we don?t need the "Proliant stuff" anymore
  32.  
  33. #
  34. # getopt
  35. #
  36. #
  37.  
  38. while getopts ":o:shcSTflkenaHLvhpPA:2:10" Option ## -T -0 -1 -2 backported from HPUX
  39. do
  40. case $Option in
  41. o ) OUTDIR=$OPTARG;;
  42. v ) echo $_VERSION"// "$(uname -mrs); exit 0;; ## add uname output, see YG MSG 790 ##
  43. h ) echo $_VERSION; usage; exit 0;;
  44. s ) CFG_SYSTEM="no";;
  45. c ) CFG_CRON="no";;
  46. S ) CFG_SOFTWARE="no";;
  47. f ) CFG_FILESYS="no";;
  48. l ) CFG_LVM="no";;
  49. k ) CFG_KERNEL="no";;
  50. e ) CFG_ENHANCEMENTS="no";;
  51. n ) CFG_NETWORK="no";;
  52. a ) CFG_APPLICATIONS="no";;
  53. H ) CFG_HARDWARE="no";;
  54. L ) CFG_STINLINE="no";;
  55. p ) CFG_HPPROLIANTSERVER="yes";;
  56. P ) CFG_PLUGINS="yes";;
  57. A ) CFG_ALTIRISAGENTFILES="no";;
  58. 2 ) CFG_DATE="_"$(date +$OPTARG) ;;
  59. 1 ) CFG_DATE="_"$(date +%d-%b-%Y) ;;
  60. 0 ) CFG_DATE="_"$(date +%d-%b-%Y-%H%M) ;;
  61. T ) CFG_TRACETIME="yes";; # show each exec_command with timestamp
  62. * ) echo "Unimplemented option chosen. Try -h for help!"; exit 1;; # DEFAULT
  63. esac
  64. done
  65.  
  66. shift $(($OPTIND - 1))
  67. # Decrements the argument pointer so it points to next argument.
  68.  
  69. #
  70. # linux port
  71. MAILTO="&#106;&#101;&#114;&#111;&#101;&#110;&#46;&#107;&#108;&#101;&#101;&#110;&#64;&#104;&#112;&#46;&#99;&#111;&#109;"
  72. MAILTORALPH="cfg2html&#64;&#104;&#111;&#116;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;"
  73. # changed/added 08.07.2003 (13:04) by Ralph Roth
  74.  
  75.  
  76. #####################################################################
  77. # @(#)Cfg2Html (c) by ROSE SWE, Dipl.-Ing. Ralph Roth, cfg2html@hotmail.com
  78. # HP Proliant Server Module Integrated by Jeroen.Kleen@hp.com
  79. #####################################################################
  80.  
  81. # cfg2html-linux ported (c) by Michael Meifert, SysAdm from HP-UX version
  82. # using Debian potato, woody
  83.  
  84. # This is the "Swiss army knife" for the ASE, CE, sysadmin etc. I wrote it to
  85. # get the needed information to plan an update, to perform basic trouble
  86. # shooting or performance analysis. As a bonus cfg2html creates a nice HTML and
  87. # plain ASCII documentation. If you are missing something, let me know it!
  88.  
  89. # History
  90. #####################################################################
  91. # 28-jan-1999 initial creation, based on get_config, check_config
  92. # nickel, snapshoot, vim and a idea from a similar
  93. # script i have seen on-site.
  94. #####################################################################
  95. # 11-Mar-2001 initial creation for Debian GNU Linux i386
  96. # based on cfg2html Version 1.15.06/HP-UX by
  97. # by ROSE SWE, Dipl.-Ing. Ralph Roth
  98. # ported to Linux by Michael Meifert
  99. #####################################################################
  100. # 15-May-2006 Common stream for cfg2html-linux and the Proliant version
  101.  
  102.  
  103.  
  104. echo "" # should be a newline, more portable? # rar, 20121230
  105.  
  106. ## test if user = root
  107. check_root
  108.  
  109. # define the HTML_OUTFILE, TEXT_OUTFILE, ERROR_LOG
  110. define_outfile
  111.  
  112. # create our VAR_DIR, OUTDIR before we continue
  113. create_dirs
  114.  
  115. #
  116. if [ ! -d $OUTDIR ] ; then
  117. echo "can't create $HTML_OUTFILE, $OUTDIR does not exist - stop"
  118. exit 1
  119. fi
  120. touch $HTML_OUTFILE
  121. #echo "Starting up $VERSION\r"
  122. [ -s "$ERROR_LOG" ] && rm -f $ERROR_LOG 2> /dev/null
  123. DATE=`date "+%Y-%m-%d"` # ISO8601 compliant date string
  124. DATEFULL=`date "+%Y-%m-%d %H:%M:%S"` # ISO8601 compliant date and time string
  125.  
  126. exec 2> $ERROR_LOG
  127.  
  128. if [ ! -f $HTML_OUTFILE ] ;
  129. then
  130. line
  131. _banner "Error"
  132. _echo "You have not the rights to create the file $HTML_OUTFILE! (NFS?)\n"
  133. exit 1
  134. fi
  135.  
  136. logger "Start of $VERSION"
  137. RECHNER=$(hostname) # `hostname -f`
  138. VERSION_=`echo $VERSION/$RECHNER|tr " " "_"`
  139. typeset -i HEADL=0 # Headinglevel
  140.  
  141. #
  142. # check Linux distribution
  143. #
  144. identify_linux_distribution
  145.  
  146.  
  147. ####################################################################
  148. # needs improvement!
  149. # trap "echo Signal: Aborting!; rm $HTML_OUTFILE_TEMP" 2 13 15
  150.  
  151. ####################################################################
  152.  
  153. #
  154. ######################################################################
  155. # Hauptprogramm mit Aufruf der obigen Funktionen und deren Parametern
  156. ############################# M A I N ##############################
  157. #
  158.  
  159. line
  160. echo "Starting "$_VERSION ## "/"$(arch) - won't work under Debian 5.0.8 ## /usr/bin/cfg2html-linux: line 597: arch: command not found
  161. echo "Path to Cfg2Html "$0
  162. echo "HTML Output File "$HTML_OUTFILE
  163. echo "Text Output File "$TEXT_OUTFILE
  164. echo "Partitions "$OUTDIR/$BASEFILE.partitions.save
  165. echo "Errors logged to "$ERROR_LOG
  166. [[ -f $CONFIG_DIR/local.conf ]] && {
  167. echo "Local config "$CONFIG_DIR/local.conf "( $(grep -v -E '(^#|^$)' $CONFIG_DIR/local.conf | wc -l) lines)"
  168. }
  169.  
  170. echo "Started at "$DATEFULL
  171. echo "WARNING USE AT YOUR OWN RISK!!! :-)) <<<<<"
  172. line
  173. logger "Start of $VERSION"
  174. open_html
  175. inc_heading_level
  176.  
  177. #
  178. # CFG_SYSTEM
  179. #
  180.  
  181.  
  182. if [ "$CFG_SYSTEM" != "no" ]
  183. then # else skip to next paragraph
  184.  
  185. paragraph "Linux System ($distrib)"
  186. inc_heading_level
  187.  
  188. if [ -f $CONFIG_DIR/systeminfo ] ; then
  189. exec_command "cat $CONFIG_DIR/systeminfo" "System description"
  190. fi
  191.  
  192. exec_command "cat /proc/cpuinfo; echo; /usr/bin/lscpu;" "CPU and Model info" # 20.08.2012, 15:59 modified by Ralph Roth #* rar *#
  193. [ -x /usr/bin/cpufreq-info ] && exec_command cpufreq-info "CPU Freq Kernel Information"
  194.  
  195. # Added by Dusan Baljevic (dusan.baljevic@ieee.org) on 15 July 2013
  196. #
  197. CPUPOWER=$(which cpupower)
  198. if [ -n "$CPUPOWER" ] && [ -x "$CPUPOWER" ] ; then
  199. exec_command "$CPUPOWER info" "Processor power related kernel or hardware configuration"
  200. exec_command "$CPUPOWER idle-info" "Processor idle state information" ## closes issue #53 - rr, 20140725
  201. fi
  202.  
  203. exec_command HostNames "uname & hostname"
  204. exec_command "uname -n" "Host alias"
  205. exec_command "uname -sr" "OS, Kernel version"
  206.  
  207. # Added by Dusan Baljevic (dusan.baljevic@ieee.org) on 15 July 2013
  208. #
  209. HOSTNAMECTL=$(which hostnamectl 2>/dev/null)
  210. if [ -n "$HOSTNAMECTL" ] && [ -x "$HOSTNAMECTL" ] ; then
  211. exec_command "$HOSTNAMECTL" "Hostname settings"
  212. fi
  213.  
  214. [ -x /usr/bin/lsb_release ] && exec_command "/usr/bin/lsb_release -a" "Linux Standard Base Version"
  215. for i in /etc/*-release
  216. do
  217. [ -r $i ] && exec_command "cat $i" "OS Specific Release Information ($i)"
  218. done
  219.  
  220. ### Begin changes by Dusan.Baljevic@ieee.org ### 13.05.2014
  221.  
  222. if [ -x /usr/bin/virsh ] ; then
  223. exec_command "/usr/bin/virsh list" "virsh Virtualization Support Status"
  224. exec_command "/usr/bin/virsh sysinfo" "virsh XML Hypervisor Sysinfo"
  225. fi
  226.  
  227. if [ -x /usr/sbin/virt-what ] ; then
  228. exec_command "/usr/sbin/virt-what" "Virtual Machine Check"
  229. fi
  230.  
  231. ### End changes by Dusan.Baljevic@ieee.org ### 14.05.2014
  232.  
  233. ### Begin changes by Dusan.Baljevic@ieee.org ### 31.08.2014
  234.  
  235. if [ -x /usr/bin/machinectl ] ; then
  236. exec_command "/usr/bin/machinectl --version" "Systemd Virtual Machine and Container Version"
  237. exec_command "/usr/bin/machinectl list" "Systemd Virtual Machine and Container Status"
  238. fi
  239.  
  240. if [ -x /usr/bin/VBoxManage ] ; then
  241. exec_command "/usr/bin/VBoxManage -v" "VirtualBox Version"
  242. exec_command "/usr/bin/VBoxManage list systemproperties" "VirtualBox System Properties"
  243. exec_command "/usr/bin/VBoxManage list vms" "VirtualBox VMS"
  244. fi
  245.  
  246. ### End changes by Dusan.Baljevic@ieee.org ### 31.08.2014
  247.  
  248. if [ -x /usr/bin/locale ] ; then
  249. exec_command posixversion "POSIX Standards/Settings"
  250. exec_command "locale" "locale specific information"
  251. export LANG="C"
  252. export LANG_ALL="C"
  253. fi
  254.  
  255. exec_command "ulimit -a" "System ulimit" # 13.08.2007, 14:24 modified by Ralph Roth
  256. exec_command "getconf -a" "System Configuration Variables" ## at least SLES11, # 14.06.2011, 18:53 modified by Ralph Roth #* rar *#
  257. ##### 19-Sept-2006, Ralph #####
  258. if [ -x /usr/bin/mpstat ] ; then
  259. exec_command "mpstat 1 5" "MP-Statistics"
  260. fi
  261. if [ -x /usr/bin/iostat ] ; then
  262. exec_command "iostat" "IO-Statistics"
  263. fi
  264.  
  265. # In "used memory.swap" section I would add :
  266. # free -tl (instead of free, because it gives some more useful infos, about HighMem and LowMem memory regions (zones))
  267. # cat /proc/meminfo (in order to get some details of memory usage)
  268.  
  269. exec_command "free -toml;echo;free -tm;echo; swapon -s" "Used Memory and Swap" # 04.07.2011, 16:13 modified by Ralph Roth #* rar *#
  270. exec_command "cat /proc/meminfo; echo THP:; cat /sys/kernel/mm/transparent_hugepage/enabled" "Detailed Memory Usage (meminfo)" # changed 20131218 by Ralph Roth
  271. exec_command "cat /proc/buddyinfo" "Zoned Buddy Allocator/Memory Fragmentation and Zones" # 09.01.2012 Ralph Roth
  272. AddText "The number on the left is bigger than right (by factor 2)."
  273. AddText "DMA zone is the first 16 MB of memory. DMA64 zone is the first 4 GB of memory on 64-bit Linux. Normal zone is between DMA and HighMem. HighMem zone is above 4 GB of memory." # ripped from Dusan Baljevic ## changed 20131211 by Ralph Roth
  274.  
  275. # TODO
  276. # foreach my $bi ( @BUDDYINFO ) {
  277. # my @biarr = split(/\s+/, $bi);
  278. # $biarr[1] =~ s/,$//g;
  279. # print "$INFOSTR $biarr[0]$biarr[1]: Zone $biarr[3] has\n";
  280. # my $cntb = 1;
  281. # my @who = splice @biarr, 4;
  282. # for my $p (0 .. $#who) {
  283. # print $who[$p], " free ", 2*(2**$cntb), "KB pages\n";
  284. # $cntb++;
  285. # }
  286.  
  287. exec_command "cat /proc/slabinfo" "Kernel slabinfo Statistics" # changed 20131211 by Ralph Roth
  288. AddText "Frequently used objects in the Linux kernel (buffer heads, inodes, dentries, etc.) have their own cache. The file /proc/slabinfo gives statistics."
  289. exec_command "cat /proc/pagetypeinfo" "Additional page allocator information" # changed 20131211 by Ralph Roth
  290. exec_command "cat /proc/zoneinfo" "Per-zone page allocator" # changed 20131211 by Ralph Roth
  291.  
  292. if [ -x /usr/bin/vmstat ] ; then ## <c/m/a> 14.04.2009 - Ralph Roth
  293. exec_command "vmstat 1 10" "VM-Statistics 1 10"
  294. exec_command "vmstat -dn;vmstat -f" "VM-Statistics (Summary)"
  295. fi
  296.  
  297. # sysutils
  298. exec_command "uptime" "Uptime"
  299. # exec_command "sar 1 9" "System Activity Report"
  300. # exec_command "sar -b 1 9" "Buffer Activity"
  301.  
  302. [ -x /usr/bin/procinfo ] && exec_command "procinfo -a" "System status from /proc" # 15.11.2004, 14:09 modified by Ralph Roth
  303. # usage: pstree [ -a ] [ -c ] [ -h | -H pid ] [ -l ] [ -n ] [ -p ] [ -u ]
  304. # [ -G | -U ] [ pid | user]
  305. exec_command "pstree -p -a -l -G -A" "Active Process - Tree Overview" # 15.11.2004/2011, 14:09 modified by Ralph.Roth
  306. exec_command "ps -e -o ruser,pid,args | awk ' (($1+1) > 1) {print $0;} '" "Processes without an named owner" # changed 20131211 by Ralph Roth, # changed 20140129 by Ralph Roth # cmd. line:1: ^ unexpected newline or end of string
  307. AddText "The output should be empty!"
  308.  
  309. ## ps aux --sort=-%cpu,-%mem|head -25 ## 06.03.2015
  310. exec_command "ps -ef | cut -c39- | sort -nr | head -25 | awk '{ printf(\"%10s %s\\n\", \$1, \$2); }'" "Top load processes"
  311. exec_command "ps -e -o 'vsz pid ruser cpu time args' |sort -nr|head -25" "Top memory consuming processes"
  312. exec_command topFDhandles "Top file handles consuming processes" # 24.01.2013
  313. AddText "Hint: Number of open file handles should be less than ulimit -n ("$(ulimit -n)")"
  314.  
  315. [ -x /usr/bin/pidstat ] && exec_command "pidstat -lrud 2>/dev/null||pidstat -rud" "pidstat - Statistics for Linux Tasks" # 10.11.2012 modified by Ralph Roth #* rar *# fix for SLES11,SP2, 29.01.2014
  316.  
  317. exec_command "tuned-adm list" "Tuned Profiles" #06.11.2014, 20:34 added by Dusan Baljevic dusan.baljevic@ieee.org
  318. exec_command "tuned-adm active" "Tuned Active Profile Status" #06.11.2014, 20:34 added by Dusan Baljevic dusan.baljevic@ieee.org
  319. exec_command "numactl --hardware" "NUMA Inventory of Available Nodes on the System" #06.11.2014, 20:34 added by Dusan Baljevic dusan.baljevic@ieee.org
  320.  
  321. if [ -x /usr/bin/journalctl ]
  322. then
  323. exec_command "/usr/bin/journalctl --list-boots --no-pager| tail -25" "Last 25 Reboots" ## changed 20150212 by Ralph Roth
  324. else
  325. exec_command "last -F| grep reboot | head -25" "Last 25 Reboots" ### RR, 2014-12-19 ##CHANGED##FIXED## 20150212 by Ralph Roth
  326. fi
  327. # common stuff, systemd and old style system-v rc
  328. exec_command "last -xF | grep -E 'system|runlevel'" "Last 25 runlevel changes or reboots" ###CHANGED### 20150408 by Ralph Roth
  329.  
  330. ### Begin changes by Dusan.Baljevic@ieee.org ### 13.05.2014
  331. # stderr output from " blame":
  332. # /usr/share/cfg2html/lib/html-functions.sh: line 107: blame: command not found
  333.  
  334. SYSTEMD=$(which systemd-analyze)
  335. if [ -x $SYSTEMD ] ; then
  336. exec_command "$SYSTEMD" "systemd-analyze Boot Performance Profiler"
  337. exec_command "$SYSTEMD blame" "systemd-analyze Boot Sequence and Performance Profiler"
  338. fi
  339.  
  340. [ -r /etc/init/bootchart.conf ] && exec_command "grep -vE '^#' /etc/init/bootchart.conf" "bootchart Boot Sequence and Performance Profiler"
  341. [ -r /etc/systemd/bootchart.conf ] && exec_command "grep -vE '^#' /etc/systemd/bootchart.conf" "bootchart Boot Sequence and Performance Profiler"
  342.  
  343. ### End changes by Dusan.Baljevic@ieee.org ### 13.05.2014
  344.  
  345. exec_command "alias" "Alias"
  346. [ -r /etc/inittab ] && exec_command "grep -vE '^#|^ *$' /etc/inittab" "inittab"
  347. ## This may report NOTHING on RHEL 3+4 ##
  348. [ -x /sbin/chkconfig ] && exec_command "/sbin/chkconfig" "Services Startup" ## chkconfig -A // SLES // xinetd missing
  349. [ -x /sbin/chkconfig ] && exec_command "/sbin/chkconfig --list" "Services Runlevel" # rar, fixed 2805-2005 for FC4
  350. [ -x /sbin/chkconfig ] && exec_command "/sbin/chkconfig -l --deps" "Services Runlevel and Dependencies" #*# Alexander De Bernardi 25.02.2011
  351. [ -x /usr/sbin/service ] && exec_command "/usr/sbin/service --status-all 2> /dev/null" "Services - Status" # 09.11.2011/12022013 by Ralph Roth #* rar *#
  352. [ -x /usr/sbin/sysv-rc-conf ] && exec_command " /usr/sbin/sysv-rc-conf --list" "Services Runlevel" # rr, 1002-2008
  353.  
  354. if [ "$GENTOO" = "yes" ] ; then ## 2007-02-27 Oliver Schwabedissen
  355. [ -x /bin/rc-status ] && exec_command "/bin/rc-status --list" "Defined runlevels"
  356. [ -x /sbin/rc-update ] && exec_command "/sbin/rc-update show --verbose" "Init scripts and their runlevels"
  357. fi
  358.  
  359. ## OpenSUSE 12.x # changed 20140213 by Ralph Roth ##BACKPORT##
  360. [ -x /usr/bin/systemctl ] && exec_command "/usr/bin/systemctl" "Systemd: System and Service Manager"
  361. [ -x /usr/bin/systemctl ] && exec_command "/usr/bin/systemctl list-units --type service" "Systemd: All Services"
  362. [ -x /usr/bin/systemctl ] && exec_command "systemctl list-unit-files" " Systemd: All Unit Files"
  363.  
  364. ## new 20140613 by Ralph Roth
  365. [ -x /usr/bin/journalctl ] && exec_command "/usr/bin/journalctl -b -p 3 --no-pager" "Systemd Journal with Errors and Warnings"
  366.  
  367. if [ "$ARCH" = "yes" ] ; then ## M.Weiller, LUG-Ottobrunn.de, 2013-02-04 ## OpenSUSE also and SLES12?
  368. [ -x /usr/bin/systemctl ] && exec_command "/usr/bin/systemctl --failed" "Systemd: Failed Units"
  369. fi
  370.  
  371. if [ -d /etc/rc.config.d ] ; then
  372. exec_command " grep -v ^# /etc/rc.config.d/* | grep '=[0-9]'" "Runlevel Settings"
  373. fi
  374. [ -r /etc/inittab ] && exec_command "awk '!/#|^ *$/ && /initdefault/' /etc/inittab" "default runlevel"
  375. exec_command "/sbin/runlevel" "current runlevel"
  376.  
  377. ##
  378. ## we want to display the Boot Messages too
  379. ## 30Jan2003 it233 FRU
  380. if [ -e /var/log/boot.msg ] ; then
  381. exec_command "grep 'Boot logging' /var/log/boot.msg" "Last Boot Date"
  382. exec_command "grep -v '|====' /var/log/boot.msg " "Boot Messages, last Boot"
  383. fi
  384.  
  385. # MiMe: SUSE && UNITEDLINUX
  386. # MiMe: until SUSE 7.3: params in /etc/rc.config and below /etc/rc.config.d/
  387. # MiMe; since SUSE 8.0 including UL: params below /etc/sysconfig
  388. if [ "$SUSE" = "yes" ] || [ "$UNITEDLINUX" = "yes" ] ; then
  389. if [ -d /etc/sysconfig ] ; then
  390. # MiMe:
  391. exec_command "find /etc/sysconfig -type f -not -path '*/scripts/*' -exec grep -vE '^#|^ *$' {} /dev/null \; | sort" "Parameter /etc/sysconfig"
  392. fi
  393. if [ -e /etc/rc.config ] ; then
  394. # PJC: added filters for SUSE rc_ variables
  395. # PJC: which were in rc.config in SUSE 6
  396. # PJC: and moved to /etc/rc.status in 7+
  397. exec_command "grep -vE -e '(^#|^ *$)' -e '^ *rc_' -e 'rc.status' /etc/rc.config | sort" "Parameter /etc/rc.config"
  398. fi
  399. if [ -d /etc/rc.config.d ] ; then
  400. # PJC: added filters for SUSEFirewall and indented comments
  401. exec_command "find /etc/rc.config.d -name '*.config' -exec grep -vE -e '(^#|^ *$)' -e '^ *true$' -e '^[[:space:]]*#' -e '[{]|[}]' {} \; | sort" "Parameter /etc/rc.config.d"
  402. fi
  403. fi
  404.  
  405. if [ "$GENTOO" = "yes" ] ; then ## 2007-02-28 Oliver Schwabedissen
  406. exec_command "grep -vE '^#|^ *$' /etc/rc.conf | sort" "Parameter /etc/rc.conf"
  407. exec_command "find /etc/conf.d -type f -exec grep -vE '^#|^ *$' {} /dev/null \;" "Parameter /etc/conf.d"
  408. fi
  409.  
  410. if [ -e /proc/sysvipc ] ; then
  411. exec_command "ipcs" "IPC Status"
  412. exec_command "ipcs -u" "IPC Summary"
  413. exec_command "ipcs -l" "IPC Limits"
  414. ## ipcs -ma ???
  415. fi
  416.  
  417. ### Made by Dusan.Baljevic@ieee.org ### 16.03.2014
  418. if [ -x /usr/sbin/authconfig ] ; then
  419. exec_command "/usr/sbin/authconfig --test" "System authentication resources"
  420. fi
  421.  
  422. if [ -x /usr/sbin/pwck ] ; then
  423. exec_command "/usr/sbin/pwck -r && echo Okay" "integrity of password files"
  424. fi
  425.  
  426. if [ -x /usr/sbin/grpck ] ; then
  427. exec_command "/usr/sbin/grpck -r && echo Okay" "integrity of group files"
  428. fi
  429.  
  430. exec_command "cat /etc/passwd" "Password File" # Added by Dusan.Baljevic@ieee.org 6/11/2014
  431. exec_command "awk -F: 'BEGIN{OFS=FS}{if ( \$2 != \"*\" ) \$2='x'; print \$0}' /etc/shadow" "Shadow File" # Added by Dusan.Baljevic@ieee.org 6/11/2014 (issue #83)
  432. exec_command "cat /etc/sudoers" "Sudo Config" # Added by Dusan.Baljevic@ieee.org 6/11/2014
  433. dec_heading_level
  434.  
  435. fi # terminates CFG_SYSTEM wrapper
  436.  
  437. # -----------------------------------------------------------------------------
  438. # Begin: "Arch Linux spezial section"
  439. ## M.Weiller, LUG-Ottobrunn.de, 2013-02-04
  440. if [ "$ARCH" == "yes" ] ; then
  441. paragraph "Arch Linux spezial"
  442. inc_heading_level
  443.  
  444. exec_command "grep -vE '^#|^ *$' /etc/pacman.conf" "Pacman config"
  445. exec_command "grep -vE '^#|^ *$' /etc/pacman.d/mirrorlist" "Aktiv mirrors for pacman"
  446. exec_command "grep -vE '^#|^ *$' /etc/mkinitcpio.conf" "Build Options"
  447.  
  448. dec_heading_level
  449. fi
  450. # End: "Arch Linux spezial section"
  451. # -----------------------------------------------------------------------------
  452.  
  453. #
  454. # CFG_CRON
  455. #
  456. if [ "$CFG_CRON" != "no" ]
  457. then # else skip to next paragraph
  458. paragraph "Cron and At"
  459. inc_heading_level
  460.  
  461. for FILE in cron.allow cron.deny
  462. do
  463. if [ -r /etc/$FILE ]
  464. then
  465. exec_command "cat /etc/$FILE" "$FILE"
  466. else
  467. exec_command "echo /etc/$FILE" "$FILE not found!"
  468. fi
  469. done
  470.  
  471. ## Linux SUSE user /var/spool/cron/tabs and NOT crontabs
  472. ## 30jan2003 it233 FRU
  473. ## SUSE has the user crontabs under /var/spool/cron/tabs
  474. ## RedHat has the user crontabs under /var/spool/cron
  475. ## UnitedLinux uses /var/spool/cron/tabs (MiMe)
  476. ## Arch Linux has the user crontabs under /var/spool/cron ## M.Weiller, LUG-Ottobrunn.de, 2013-02-04
  477. if [ "$SUSE" == "yes" ] ; then
  478. usercron="/var/spool/cron/tabs"
  479. fi
  480. if [ "$REDHAT" == "yes" ] || [ "$AWS" == "yes" ] ; then
  481. usercron="/var/spool/cron"
  482. fi
  483. if [ "$SLACKWARE" == "yes" ] ; then
  484. usercron="/var/spool/cron/crontabs"
  485. fi
  486. if [ "$DEBIAN" == "yes" ] ; then
  487. usercron="/var/spool/cron/crontabs"
  488. fi
  489. if [ "$GENTOO" == "yes" ] ; then ## 2007-02-27 Oliver Schwabedissen
  490. usercron="/var/spool/cron/crontabs"
  491. fi
  492. if [ "$UNITEDLINUX" == "yes" ] ; then
  493. usercron="/var/spool/cron/tabs"
  494. fi
  495. if [ "$ARCH" == "yes" ] ; then ## M.Weiller, LUG-Ottobrunn.de, 2013-02-04
  496. usercron="/var/spool/cron"
  497. fi
  498. # ##
  499. # alph@osuse122rr:/etc/cron.d> ll
  500. # -rw-r--r-- 1 root root 1754 29. Nov 16:21 -? ## !
  501. # -rw-r--r-- 1 root root 319 1. Nov 2011 ClusterTools2
  502. # -rw-r--r-- 1 root root 1754 29. Nov 16:21 --help ## !
  503.  
  504. # maybe this is generic?
  505. # for user in $(getent passwd|cut -f1 -d:); do echo "### Crontabs for $user ####"; crontab -u $user -l; done
  506. # changed 20140212 by Ralph Roth
  507.  
  508. ls $usercron/* > /dev/null 2>&1
  509. if [ $? -eq 0 ]
  510. then
  511. _echo "\n\n<B>Crontab files:</B>" >> $HTML_OUTFILE_TEMP
  512. for FILE in $usercron/*
  513. do
  514. exec_command "cat $FILE | grep -v ^#" "For user `basename $FILE`"
  515. done
  516. else
  517. echo "No crontab files for user.<br>" >> $HTML_OUTFILE_TEMP
  518. fi
  519.  
  520. ##
  521. ## we do also a listing of utility cron files
  522. ## under /etc/cron.d 30Jan2003 it233 FRU
  523. ls /etc/cron.d/* > /dev/null 2>&1
  524. if [ $? -eq 0 ]
  525. then
  526. _echo "\n\n<br><B>/etc/cron.d files:</B>" >> $HTML_OUTFILE_TEMP
  527. for FILE in /etc/cron.d/*
  528. do
  529. exec_command "cat $FILE | grep -v ^#" "For utility `basename $FILE`"
  530. done
  531. else
  532. echo "No /etc/cron.d files for utlities." >> $HTML_OUTFILE_TEMP
  533. fi
  534.  
  535. if [ -f /etc/crontab ] ; then
  536. exec_command "_echo 'Crontab:\n';cat /etc/crontab | grep -vE '^#|^ *$'" "/etc/crontab"
  537. fi
  538.  
  539. atconfigpath="/etc"
  540. if [ "$GENTOO" == "yes" ] ; then ## 2007-02-27 Oliver Schwabedissen
  541. atconfigpath="/etc/at"
  542. fi
  543.  
  544. for FILE in at.allow at.deny
  545.  
  546. do
  547. if [ -r $atconfigpath/$FILE ]
  548. then
  549. exec_command "cat $atconfigpath/$FILE " "$atconfigpath/$FILE"
  550. else
  551. exec_command "echo $atconfigpath/$FILE" "No $atconfigpath/$FILE"
  552. fi
  553. done
  554.  
  555. ## work around by Ralph for missing at
  556. #(whereis at > /dev/null) || exec_command "at -l" "AT Scheduler"
  557. # sorry - don't work here (Michael)
  558. # now we try this
  559. if [ -x /usr/bin/at ] ; then
  560. exec_command "at -l" "AT Scheduler"
  561. fi
  562.  
  563. #exec_command "_echo 'Crontab:\n';cat /etc/crontab | grep -vE '#|^ *$';_echo '\nAT Scheduler:\n';at -l" "/etc/crontab and AT Scheduler"
  564.  
  565. dec_heading_level
  566. fi #terminate CFG_CRON wrapper
  567. #
  568. # CFG_HARDWARE
  569. #
  570. if [ "$CFG_HARDWARE" != "no" ]
  571. then # else skip to next paragraph
  572.  
  573. paragraph "Hardware"
  574. inc_heading_level
  575.  
  576. RAM=`awk -F': *' '/MemTotal/ {print $2}' /proc/meminfo`
  577. # RAM=`cat /proc/meminfo | grep MemTotal | awk -F\: '{print $2}' | awk -F\ '{print $1 " " $2}'`
  578. exec_command "echo $RAM" "Physical Memory"
  579.  
  580. ## Murray Barton, 14/4/2010
  581. DMIDECODE=`which dmidecode`; if [ -n "$DMIDECODE" ] && [ -x $DMIDECODE ] ; then exec_command "$DMIDECODE 2> /dev/null" "DMI Table Decoder"; fi
  582.  
  583. ### Begin changes by Dusan.Baljevic@ieee.org ### 13.05.2014
  584.  
  585. BIOSDECODE=$(which biosdecode)
  586. if [ -n "$BIOSDECODE" ] && [ -x $BIOSDECODE ] ; then
  587. exec_command "$BIOSDECODE" "biosdecode"
  588. fi
  589.  
  590. ### End changes by Dusan.Baljevic@ieee.org ### 13.05.2014 ### needs cleanup, e.g. 2> /dev/null - 06.04.2015, rr
  591.  
  592. LSCPU=`which lscpu`; if [ -n "$LSCPU" ] && [ -x $LSCPU ] ; then exec_command "$LSCPU" "CPU architecture"; fi # see issue #52
  593. HWINFO=`which hwinfo`; if [ -n "$HWINFO" ] && [ -x $HWINFO ] ; then exec_command "$HWINFO --short 2> /dev/null" "Hardware List (hwinfo)"; fi ## see issue #82, rr, 20150527-rr
  594. LSHW=`which lshw`; if [ -n "$LSHW" ] && [ -x $LSHW ] ; then exec_command "$LSHW" "Hardware List (lshw)"; fi ## 13.12.2004, 15:53 modified by Ralph Roth
  595. LSDEV=`which lsdev`; if [ -n "$LSDEV" ] && [ -x $LSDEV ] ; then exec_command "$LSDEV" "Hardware List (lsdev)"; fi
  596. LSHAL=`which lshal`; if [ -n "$LSHAL" ] && [ -x $LSHAL ] ; then exec_command "$LSHAL" "List of Devices (lshal)"; fi
  597. LSUSB=`which lsusb`; if [ -n "$LSUSB" ] && [ -x $LSUSB ] ; then exec_command "$LSUSB" "List of USB devices"; fi ## SUSE? # 12.11.2004, 15:04 modified by Ralph Roth
  598.  
  599. LSPCI=`which lspci`
  600. if [ -n "$LSPCI" ] && [ -x $LSPCI ] ; then
  601. exec_command "$LSPCI -v" "PCI devices"
  602. else
  603. if [ -f /proc/pci ] ; then
  604. exec_command "cat /proc/pci" "PCI devices"
  605. fi
  606. fi
  607.  
  608. PCMCIA=`grep pcmcia /proc/devices | cut -d" " -f2`
  609. if [ "$PCMCIA" = "pcmcia" ] ; then
  610. if [ -x /sbin/cardctl ] ; then
  611. exec_command "/sbin/cardctl status;/sbin/cardctl config;/sbin/cardctl ident" "PCMCIA"
  612. fi
  613. fi
  614. [ -r /proc/acpi/info ] && exec_command "cat /proc/acpi/info" "ACPI" # 06.04.2006, 17:44 modified by Ralph Roth
  615.  
  616. if [ -f /etc/kbd/default.kmap.gz ] ; then
  617. exec_command "zcat /etc/kbd/default.kmap.gz | head -1 | sed s/#//" "Keymap"
  618. fi
  619. exec_command "cat /proc/ioports" "IoPorts"
  620. exec_command "cat /proc/interrupts" "Interrupts"
  621. if [ -f /proc/scsi/scsi ] ;then
  622. exec_command "find /proc/scsi" "SCSI Components" # 22.11.2004, 16:08 modified by Ralph.Roth
  623. exec_command "cat /proc/scsi/scsi" "SCSI Devices"
  624. fi
  625.  
  626. if [ -x /usr/bin/lsscsi ]
  627. then
  628. # Debian 6.06 # 24.01.2013, doesn't have -p option yet!
  629. # -p, --protection Output additional data integrity (protection) information.
  630. exec_command "/usr/bin/lsscsi -lv" "SCSI Devices (long, details)" ## rr, 16. March 2011
  631. exec_command "/usr/bin/lsscsi -s" "SCSI Devices (size)" ## rr, 16. March 2011, 27 May 2015
  632. fi
  633.  
  634. if [ -x "${FDISKCMD}" -a -x "${GREPCMD}" -a -x "${SEDCMD}" -a -x "${AWKCMD}" -a -x "${SMARTCTL}" ]
  635. then
  636. exec_command DoSmartInfo "SMART disk drive features and information"
  637. fi
  638.  
  639. ## rar, 13.02.2004
  640. ## Changed 15.05.2006 (09:30) by Peter Lindblom, HP, STCC EMEA, changed title from SCSI Devices SCSI Disk Devices
  641. [ -x /usr/sbin/lssd ] && exec_command "/usr/sbin/lssd" "SCSI Disk Devices"
  642.  
  643. ## Added 15.05.2006 (09:30) by Peter Lindblom, HP, STCC EMEA
  644. [ -x /usr/sbin/lssg ] && exec_command "/usr/sbin/lssg" "Generic SCSI Devices"
  645.  
  646. ## rar, 13.02.2004
  647. ## Added 15.05.2006 (09:30) by Peter Lindblom, HP, STCC EMEA, Added the echo between the command to get a new line and move it down below lssg and lssd.
  648. [ -x /usr/sbin/adapter_info ] && exec_command "/usr/sbin/adapter_info;echo;/usr/sbin/adapter_info -v" "Adapterinfo/WWN"
  649. ### ------------------------------------------------------------------------------
  650.  
  651. #### Start of Fibre HBA info. added 12.05.2006 (15:13) by Peter Lindblom, HP, STCC EMEA
  652.  
  653. if [ -f /tmp/fibrehba.txt ]
  654. then
  655. rm /tmp/fibrehba.txt
  656. fi
  657.  
  658. # capture /proc/scsi/qla2200
  659.  
  660. if [ -d /proc/scsi/qla2200 ]
  661. then
  662. for file in /proc/scsi/qla2200/*
  663. do
  664. mcat $file >>/tmp/fibrehba.txt
  665. done
  666. fi
  667.  
  668. # capture /proc/scsi/qla2300
  669.  
  670. if [ -d /proc/scsi/qla2300 ]
  671. then
  672. for file in /proc/scsi/qla300/*
  673. do
  674. mcat $file >>/tmp/fibrehba.txt
  675. done
  676. fi
  677.  
  678. # capture /proc/scsi/qla2xxx
  679.  
  680. if [ -d /proc/scsi/qla2xxx ]
  681. then
  682. for file in /proc/scsi/qla2xxx/*
  683. do
  684. mcat $file >>/tmp/fibrehba.txt
  685. done
  686. fi
  687.  
  688.  
  689. # capture /proc/scsi/lpfc
  690.  
  691. if [ -d /proc/scsi/lpfc ]
  692. then
  693. for file in /proc/scsi/lpfc/*
  694. do
  695. mcat $file >>/tmp/fibrehba.txt
  696. done
  697. fi
  698.  
  699. if [ -f /tmp/fibrehba.txt ]
  700. then
  701. exec_command "cat /tmp/fibrehba.txt" "Fibre Channel Host Bus Adapters"
  702. rm /tmp/fibrehba.txt
  703. fi
  704.  
  705. #### End of Fibre HBA info.
  706.  
  707.  
  708. ## rar, 13.02.2004
  709. [ -x /usr/sbin/spmgr ] && exec_command "/usr/sbin/spmgr display" "SecurePath - Manager"
  710. [ -r /etc/CPQswsp/sppf ] && exec_command "cat /etc/CPQswsp/sppf" "SecurePath - Bindings"
  711. [ -r /etc/CPQswsp/hsx.conf ] && exec_command "cat /etc/CPQswsp/hsx.conf" "SecurePath - Preferred Path Settings"
  712. [ -r /etc/CPQswsp/swsp.conf ] && exec_command "cat /etc/CPQswsp/swsp.conf" "SecurePath - Path, Load Balance & Auto restore settings"
  713. [ -r /etc/CPQswsp/notify.ini ] && exec_command "cat /etc/CPQswsp/notify.ini" "SecurePath - email address notification settings"
  714. [ -r /etc/CPQswsp/spmgr_alias ] && exec_command "cat /etc/CPQswsp/spmgr_alias" "SecurePath - Alias Name file"
  715. [ -r /etc/CPQswsp/spmgr_stop_list ] && exec_command "cat /etc/CPQswsp/spmgr_stop_list" "SecurePath - reserved key word settings file"
  716. [ -r /etc/CPQswsp/clients ] && exec_command "cat /etc/CPQswsp/clients" "SecurePath - spmgr password information"
  717.  
  718. ## Changed 15.05.2006 (09:30) by Peter Lindblom, HP, STCC EMEA, Moved from the Proliant section.
  719. [ -f /var/log/sp_log ] && exec_command "cat /var/log/sp_log" "Secure path installation log"
  720.  
  721. ## Changed 15.05.2006 (09:30) by Peter Lindblom, HP, STCC EMEA, Moved from the Proliant section.
  722. [ -f /root/sp_install_results.log ] && exec_command "cat /root/sp_install_results.log" "Secure path installation log (backup)"
  723. if [ -e /proc/sound ] ; then
  724. exec_command "cat /proc/sound" "Sound Devices"
  725. fi
  726. if [ -e /proc/asound ] ; then
  727. [ -f /proc/asound/version ] && exec_command "cat /proc/asound/version" "Asound Version"
  728. [ -f /proc/asound/modules ] && exec_command "cat /proc/asound/modules" "Sound modules"
  729. [ -f /proc/asound/cards ] && exec_command "cat /proc/asound/cards" "Sound Cards"
  730. [ -f /proc/asound/sndstat ] && exec_command "cat /proc/asound/sndstat" "Sound Stats"
  731. [ -f /proc/asound/timers ] && exec_command "cat /proc/asound/timers" "Sound Timers"
  732. [ -f /proc/asound/devices ] && exec_command "cat /proc/asound/devices" "Sound devices"
  733. [ -f /proc/asound/pcm ] && exec_command "cat /proc/asound/pcm" "Sound pcm"
  734. fi
  735. exec_command "cat /proc/dma" "DMA Devices"
  736. if [ -f /proc/tty/driver/serial ] ; then
  737. exec_command "grep -v unknown /proc/tty/driver/serial" "Serial Devices"
  738. fi
  739. # test this - please report it
  740. if [ -e /proc/rd ] ; then
  741. exec_command "cat /proc/rd/c*/current_status" "RAID controller"
  742. fi
  743.  
  744. # get serial information
  745.  
  746. SETSERIAL=`which setserial`
  747. if [ -n "$SETSERIAL" ] && [ -x $SETSERIAL ]; then
  748. exec_command "$SETSERIAL -a /dev/ttyS0" "Serial ttyS0"
  749. exec_command "$SETSERIAL -a /dev/ttyS1" "Serial ttyS1"
  750. fi
  751.  
  752. # get IDE Disk information
  753. HDPARM=`which hdparm`
  754. # if hdparm is installed (DEBIAN 4.0)
  755. # -i display drive identification
  756. # -I detailed/current information directly from drive
  757.  
  758. # -i display drive identification (SUSE 10u1)
  759. # -I detailed/current information directly from drive
  760. # --Istdin reads identify data from stdin as ASCII hex
  761. # --Istdout writes identify data to stdout as ASCII hex
  762.  
  763. # Sep 23 19:12:47 hp02 root: Start of cfg2html-linux version 1.63-2009-08-27
  764. # Sep 23 19:13:03 hp02 kernel: hda: drive_cmd: status=0x51 { DriveReady SeekComplete Error }
  765. # Sep 23 19:13:03 hp02 kernel: hda: drive_cmd: error=0x04Aborted Command
  766. # Sep 23 19:13:18 hp02 root: End of cfg2html-linux version 1.63-2009-08-27
  767.  
  768. # Anpassung auf hdparm -i wegen Fehler im Syslog (siehe oben, cfg1.63)
  769. # Ingo Metzler 23.09.2009
  770.  
  771. if [ $HDPARM ] && [ -x $HDPARM ]; then
  772. exec_command "\
  773. if [ -e /proc/ide/hda ] ; then _echo -n \"read from drive\"; $HDPARM -i /dev/hda;fi;\
  774. if [ -e /proc/ide/hdb ] ; then echo; _echo -n \"read from drive\"; $HDPARM -i /dev/hdb;fi;\
  775. if [ -e /proc/ide/hdc ] ; then echo; _echo -n \"read from drive\"; $HDPARM -i /dev/hdc;fi;\
  776. if [ -e /proc/ide/hdd ] ; then echo; _echo -n \"read from drive\"; $HDPARM -i /dev/hdd;fi;"\
  777. "IDE Disks"
  778.  
  779. if [ -e /proc/ide/hda ] ; then
  780. if grep disk /proc/ide/hda/media > /dev/null ;then
  781. exec_command "$HDPARM -t -T /dev/hda" "Transfer Speed"
  782. fi
  783. fi
  784. if [ -e /proc/ide/hdb ] ; then
  785. if grep disk /proc/ide/hdb/media > /dev/null ;then
  786. exec_command "$HDPARM -t -T /dev/hdb" "Transfer Speed"
  787. fi
  788. fi
  789. if [ -e /proc/ide/hdc ] ; then
  790. if grep disk /proc/ide/hdc/media > /dev/null ;then
  791. exec_command "$HDPARM -t -T /dev/hdc" "Transfer Speed"
  792. fi
  793. fi
  794. if [ -e /proc/ide/hdd ] ; then
  795. if grep disk /proc/ide/hdd/media > /dev/null ;then
  796. exec_command "$HDPARM -t -T /dev/hdd" "Transfer Speed"
  797. fi
  798. fi
  799. else
  800. # if hdparm not available
  801. exec_command "\
  802. if [ -e /proc/ide/hda/model ] ; then _echo -n \"hda: \";cat /proc/ide/hda/model ;fi;\
  803. if [ -e /proc/ide/hdb/model ] ; then _echo -n \"hdb: \";cat /proc/ide/hdb/model ;fi;\
  804. if [ -e /proc/ide/hdc/model ] ; then _echo -n \"hdc: \";cat /proc/ide/hdc/model ;fi;\
  805. if [ -e /proc/ide/hdd/model ] ; then _echo -n \"hdd: \";cat /proc/ide/hdd/model ;fi;"\
  806. "IDE Disks"
  807. fi
  808.  
  809. if [ -e /proc/sys/dev/cdrom/info ] ; then
  810. exec_command "cat /proc/sys/dev/cdrom/info" "CDROM Drive"
  811. fi
  812.  
  813. if [ -e /proc/ide/piix ] ; then
  814. exec_command "cat /proc/ide/piix" "IDE Chipset info"
  815. fi
  816.  
  817. # Test HW Health
  818. # MiMe
  819. if [ -x /usr/bin/sensors ] ; then
  820. if [ -e /proc/sys/dev/sensors/chips ] ; then
  821. exec_command "/usr/bin/sensors" "Sensors"
  822. fi
  823. fi
  824.  
  825. if [ -x /usr/sbin/xpinfo ]
  826. then
  827. XPINFOFILE=$OUTDIR/`hostname`_xpinfo.csv
  828. /usr/sbin/xpinfo -d";" | grep -v "Scanning" > $XPINFOFILE
  829.  
  830. AddText "The XP-Info configuration was additionally dumped into the file <b>$XPINFOFILE</b> for further usage"
  831.  
  832. # remarked due to enhancement request by Martin Kalmbach, 25.10.2001
  833. # exec_command "/usr/sbin/xpinfo|grep -v Scanning" "SureStore E Disk Array XP Mapping (xpinfo)"
  834.  
  835. exec_command "/usr/sbin/xpinfo -r|grep -v Scanning" "SureStore E Disk Array XP Disk Mechanisms"
  836. exec_command "/usr/sbin/xpinfo -i|grep -v Scanning" "SureStore E Disk Array XP Identification Information"
  837. exec_command "/usr/sbin/xpinfo -c|grep -v Scanning" "SureStore E Disk Array XP (Continuous Access and Business Copy)"
  838. # else
  839. # [ -x /usr/contrib/bin/inquiry256.ksh ] && exec_command "/usr/contrib/bin/inquiry256.ksh" "SureStore E Disk Array XP256 Mapping (inquiry/obsolete)"
  840. fi
  841.  
  842. ### Begin changes by Dusan.Baljevic@ieee.org ### 13.05.2014
  843.  
  844. if [ -x /usr/sbin/evainfo ]
  845. then
  846. AddText "Hint: evainfo displays a maximum of 1024 paths on Linux-based hosts"
  847. exec_command "/usr/sbin/evainfo -a -l 2>/dev/null" "HP P6000/EVA Disk Array LUNs"
  848. exec_command "/usr/sbin/evainfo -g -W 2>/dev/null" "HP P6000/EVA Disk Array Status with Generic Device Names"
  849. fi
  850.  
  851. if [ -x /usr/bin/HP3PARInfo ]
  852. then
  853. exec_command "/usr/bin/HP3PARInfo -i 2>/dev/null" "HP 3PAR Disk Array Status"
  854. exec_command "/usr/bin/HP3PARInfo -f 2>/dev/null" "HP 3PAR Disk Array LUNs"
  855. fi
  856.  
  857. ### End changes by Dusan.Baljevic@ieee.org ### 13.05.2014
  858.  
  859. dec_heading_level
  860.  
  861. fi # terminates CFG_HARDWARE wrapper
  862.  
  863. ######################################################################
  864.  
  865. ##### ToDo: check for Distribution #####
  866.  
  867. if [ "$CFG_SOFTWARE" != "no" ]
  868. then # else skip to next paragraph
  869.  
  870. paragraph "Software"
  871. inc_heading_level
  872.  
  873. # Debian
  874. if [ "$DEBIAN" = "yes" ] ; then
  875. dpkg --get-selections | awk '!/deinstall/ {print $1}' > /tmp/cfg2html-debian.$$
  876. exec_command "column /tmp/cfg2html-debian.$$" "Packages installed"
  877. rm -f /tmp/cfg2html-debian.$$
  878. AddText "Hint: to reinstall this list use:"
  879. AddText "awk '{print \$1\"\\n\"\$2}' this_list | dpkg --set-selections"
  880. exec_command "dpkg -C" "Misconfigured Packages"
  881. # # { changed/added 25.11.2003 (14:29) by Ralph Roth }
  882. if [ -x /usr/bin/deborphan ] ; then
  883. exec_command "deborphan" "Orphaned Packages"
  884. AddText "Hint: deborphan | xargs aptitude -y purge" # rar, 16.02.04
  885. fi
  886. exec_command "dpkg -l" "Detailed list of installed Packages"
  887. AddText "$(dpkg --version|grep program)"
  888. exec_command "grep -vE '^#|^ *$' /etc/apt/sources.list" "Installed from"
  889. [ -x /usr/bin/dpigs ] && exec_command "/usr/bin/dpigs" "Largest installed packages"
  890. fi
  891. # end Debian
  892.  
  893. # SUSE
  894. # MiMe: --last tells date of installation
  895. if [ "$SUSE" = "yes" ] || [ "$UNITEDLINUX" = "yes" ] ; then
  896. exec_command "rpm -qa --last" "Packages installed (last first)" #*# Alexander De Bernardi //09.03.2010/rr
  897. exec_command "rpm -qa | sort -d -f" "Packages installed (sorted)" #*# Alexander De Bernardi //09.03.2010/rr
  898. exec_command "rpm -qa --queryformat '%{NAME}\n' | sort -d -f" "Packages installed, Name only (sorted)" #*# Alexander De Bernardi //21.04.2010/rr
  899. exec_command "rpm -qa --queryformat '%-50{NAME} %{VENDOR}\n' | sort -d -f" "Packages installed, Name and Vendor only (sorted)" #*# Alexander De Bernardi //21.04.2010/rr
  900. exec_command "rpm --querytags" "RPM Query Tags" #*# Alexander De Bernardi //21.04.2010/rr
  901. if [ -x /usr/bin/zypper ]
  902. then
  903. # #TODO:#BUG:# stderr output from "zypper ls; echo ''; zypper pt":
  904. # System management is locked by the application with pid 1959 (/usr/lib/packagekitd).
  905. # Close this application before trying again.
  906. if [ -r /etc/zypp/zypp.conf ] ## fix for JW's SLES 10, backported to 2.91
  907. then
  908. exec_command "zypper -n ls; echo ''; echo | zypper -n pt " "zypper: Services and Patterns" #*# Ralph Roth, Mittwoch, 16. March 2011
  909. exec_command "zypper -n ps" "zypper: Processes which need restart after update" #*# Alexander De Bernardi 17.02.2011
  910. exec_command "zypper -n lr --details" "zypper: List repositories" #*# Alexander De Bernardi 17.02.2011
  911. exec_command "zypper -n lu" "zypper: List pending updates" #*# Alexander De Bernardi 17.02.2011
  912. exec_command "zypper -n lp" "zypper: List pending patches" #*# Alexander De Bernardi 17.02.2011
  913. exec_command "zypper -n pa" "zypper: List all available packages" #*# Alexander De Bernardi 17.02.2011
  914. exec_command "zypper -n pa --installed-only" "zypper: List installed packages" #*# Alexander De Bernardi 17.02.2011
  915. exec_command "zypper -n pa --uninstalled-only" "zypper: List not installed packages" #*# Alexander De Bernardi 17.02.2011
  916. else
  917. AddText "zypper found, but it is not configured!"
  918. fi
  919. fi
  920. fi
  921. # end SUSE
  922.  
  923. # REDHAT
  924. if [ "$REDHAT" = "yes" ] || [ "$MANDRAKE" = "yes" ] ; then
  925. exec_command "rpm -qia | grep -E '^(Name|Group)( )+:'" "Packages installed" ## Chris Gardner - 24.01.2012
  926. exec_command "rpm -qa | sort -d -f" "Packages installed (sorted)" #*# Alexander De Bernardi //09.03.2010 12:31/rr
  927. exec_command "rpm -qa --queryformat '%{NAME}\n' | sort -d -f" "Packages installed, Name only (sorted)" #*# Alexander De Bernardi //21.04.2010/rr
  928. exec_command "rpm -qa --queryformat '%-50{NAME} %{VENDOR}\n' | sort -d -f" "Packages installed, Name and Vendor only (sorted)" #*# Alexander De Bernardi //21.04.2010/rr
  929. exec_command "rpm --querytags" "RPM Query Tags" #*# Alexander De Bernardi //21.04.2010/rr
  930. if [ -x /usr/bin/yum ] ; then
  931. exec_command "yum history" "YUM: Last actions performed"
  932. fi # yum
  933. fi
  934. # end REDHAT
  935.  
  936. # SLACKWARE
  937. if [ "$SLACKWARE" = "yes" ] ; then
  938. exec_command "ls /var/log/packages " "Packages installed"
  939. fi
  940. # end SLACKWARE
  941. # GENTOO, rr, 15.12.2004, Rob
  942. if [ "$GENTOO" = "yes" ] ; then
  943. #exec_command "qpkg -I -v|sort" "Packages installed"
  944. #exec_command "qpkg -I -v --no-color |sort" "Packages installed" ## Rob Fantini, 15122004
  945. exec_command "qlist -I -v --nocolor |sort" "Packages installed" ## 2007-02-21 Oliver Schwabedissen
  946. fi
  947. # end GENTOO
  948.  
  949. # ARCH
  950. # M.Weiller, LUG-Ottobrunn.de, 2013-02-04
  951. if [ "$ARCH" = "yes" ] ; then
  952. exec_command "pacman -Qq" "all installed packages"
  953. exec_command "pacman -Q" "all installed packages with version"
  954. exec_command "pacman -Qi" "all installed packages with full information"
  955. exec_command "pacman -Qeq" "official installed packages only"
  956. exec_command "pacman -Qdq" "dependencies installed packages only"
  957. fi
  958. # end ARCH
  959.  
  960. ### Begin changes by Dusan.Baljevic@ieee.org ### 14.05.2014
  961.  
  962. if [ -x /usr/sbin/aa-status ]
  963. then
  964. exec_command "/usr/sbin/aa-status" "AppArmor LSM for Name-based Mandatory Access Control"
  965. fi
  966.  
  967. ### End changes by Dusan.Baljevic@ieee.org ### 14.05.2014
  968.  
  969. #### programming stuff ##### plugin for cfg2html/linux/hpux # 22.11.2005, 16:03 modified by Ralph Roth
  970. exec_command ProgStuff "Software Development: Programs and Versions"
  971.  
  972. dec_heading_level
  973.  
  974. fi # terminates CFG_SOFTWARE wrapper
  975.  
  976. ######################################################################
  977. if [ "$CFG_FILESYS" != "no" ]
  978. then # else skip to next paragraph
  979.  
  980. paragraph "Filesystems, Dump and Swap configuration"
  981. inc_heading_level
  982.  
  983. exec_command "grep -v '^#' /etc/fstab | column -t" "Filesystem Table" # 281211, rr
  984. exec_command "$TIMEOUTCMD 10 df -h" "Filesystems and Usage" # gdha, 30/Nov/2015, to avoid stale NFS hangs (modified)
  985.  
  986. exec_command "my_df" "All Filesystems and Usage"
  987. if [ -x /sbin/dumpe2fs ]
  988. then
  989. exec_command "display_ext_fs_param" "Filesystems Parameters" # needs fixing, 20140929 by Ralph Roth
  990. fi
  991. exec_command "mount" "Local Mountpoints"
  992. exec_command PartitionDump "Disk Partition Layout" # 30.03.2011, 20:00 modified by Ralph Roth #** rar **#
  993. #
  994. # maybe some parted -l stuff here? # changed 20141209 by Ralph Roth
  995. #
  996. if [ -x /sbin/sfdisk ]
  997. then
  998. sfdisk -d > $OUTDIR/$BASEFILE.partitions.save
  999. exec_command "cat $OUTDIR/$BASEFILE.partitions.save" "Disk Partitions to restore from"
  1000. AddText "To restore your partitions use the saved file: $BASEFILE.partitions.save, read the man page for sfdisk for usage. (Hint: sfdisk --force /dev/device < file.save)"
  1001. fi
  1002. #*#
  1003. #*# Alexander De Bernard 20100310
  1004. #*#
  1005.  
  1006. MD_FILE="/etc/mdadm.conf"
  1007. MD_CMD="/sbin/mdadm"
  1008.  
  1009. if [ -f ${MD_FILE} ]
  1010. then
  1011. exec_command "grep -vE '^#|^ *$' ${MD_FILE}" "MD Configuration File"
  1012. if [ -x ${MD_CMD} ]
  1013. then
  1014. MD_DEV=$(grep "ARRAY" ${MD_FILE} | awk '{print $2;}')
  1015. # stderr output from "/sbin/mdadm --detail ": ## SLES 11
  1016. # mdadm: No devices given.
  1017. for d in "$MD_DEV"
  1018. do
  1019. exec_command "${MD_CMD} --detail ${d}" "MD Device Setup of $d"
  1020. done
  1021. else
  1022. AddText "${MD_FILE} exists but no ${MD_CMD} command"
  1023. fi
  1024. fi
  1025.  
  1026. # for LVM using sed
  1027. exec_command "/sbin/fdisk -l|sed 's/8e \ Unknown/8e \ LVM/g'" "Disk Partitions"
  1028.  
  1029. if [ -f /etc/exports ] ; then
  1030. exec_command "grep -vE '^#|^ *$' /etc/exports" "NFS Filesystems"
  1031. fi
  1032.  
  1033. if [ -x /usr/sbin/kdumptool ]
  1034. then
  1035. exec_command "/usr/sbin/kdumptool dump_config; echo; /usr/sbin/kdumptool find_kernel; echo; /usr/sbin/kdumptool print_target" "Kdump Status (kdumptool)" ##CHANGED##FIXED## 20150304 by Ralph Roth
  1036. else
  1037. ### TODO: -x kdumpctl check ###
  1038. exec_command "kdumpctl status" "Kdump Status" # Added by Dusan Baljevic (dusan.baljevic@ieee.org) 6/11/2014 (not on SLES11!) // 04.03.2015 Ralph Roth
  1039. fi # /usr/sbin/kdumptool
  1040. [ -r /proc/diskdump ] && exec_command "cat /proc/diskdump" "Diskdump Status" # Added by Dusan Baljevic (dusan.baljevic@ieee.org) 6/11/2014, 06.04.2015 Ralph Roth
  1041. exec_command "cat /etc/sysconfig/dump" "SUSE LKCD Config" # Added by Dusan Baljevic (dusan.baljevic@ieee.org) 6/11/2014
  1042. ### TODO: line 107: lkcd: command not found ###
  1043. exec_command "lkcd -q" "SUSE LKCD Status" # Added by Dusan Baljevic (dusan.baljevic@ieee.org) 6/11/2014
  1044.  
  1045. dec_heading_level
  1046.  
  1047. fi # terminates CFG_FILESYS wrapper
  1048.  
  1049. ###########################################################################
  1050. ## 3/6/08 New: RedHat multipath config by krtmrrsn@yahoo.com, Marc Korte.
  1051. ## also available at SLES 11 # 07.04.2012, 19:56 modified by Ralph Roth #* rar *#
  1052. if [ $REDHAT = "yes" ] && [ -n $(ps -ef | awk '/\/sbin\/multipathd/ {print $NF}') ] ; then
  1053. #FIXME#if [ $REDHAT = "yes" ] && [ $(pgrep multipathd) ] ; then
  1054. if [ -x /sbin/multipath ] # 10.11.2011, 22:50 modified by Ralph Roth #* rar *#
  1055. then
  1056. paragraph "Multipath Configuration"
  1057. inc_heading_level
  1058.  
  1059. exec_command "rpm -qa | grep multipath" "Multipath Package Version"
  1060. exec_command "chkconfig --list multipathd" "Multipath Service Status"
  1061. exec_command "/sbin/multipath -v2 -d -ll" "Multipath Devices Basic Information"
  1062. exec_command "/sbin/multipath -v3 -d -ll" "Multipath Devices Detailed Information"
  1063. exec_command "grep -vE '^#|^ *$' /etc/multipath.conf" "Multipath Configuration File"
  1064. exec_command "for MultiPath in \$(/sbin/multipath -v1 -d -l); do ls -l /dev/mapper/\${MultiPath} 2>/dev/null; done" "Device Mapper Files"
  1065. exec_command "cat /var/lib/multipath/bindings" "Multipath Bindings"
  1066.  
  1067. dec_heading_level
  1068. fi
  1069. fi
  1070.  
  1071. ###########################################################################
  1072. if [ "$CFG_LVM" != "no" ]
  1073. then # else skip to next paragraph
  1074.  
  1075. paragraph "LVM"
  1076. inc_heading_level
  1077.  
  1078. [ -x /sbin/blkid ] && exec_command "blkid" "Block Device Attributes" # 07.11.2011, 21:42 modified by Ralph Roth #* rar *#
  1079. [ -x /sbin/pvs ] && exec_command "pvs" "Physical Volumes" # if LVM2 installed # 07.11.2011, 21:45 modified by Ralph Roth #* rar *#
  1080.  
  1081. # WONT WORK WITH HP RAID!
  1082. LVMFDISK=$(/sbin/fdisk -l | grep "LVM$")
  1083.  
  1084. if [ -n "$LVMFDISK" -o -s /etc/lvmtab -o /etc/lvm/lvm.conf ]
  1085. then # <m> 11.03.2008, 1158 - Ralph Roth
  1086. vgdisplay -s > /dev/null 2>&1 # 10032008 modified by Ralph.Roth
  1087. # due to LVM2 (doesn't use /etc/lvmtab anymore), but should be compatible to LVM1; A. Kumpf
  1088. if [ "$?" = "0" ] ; then
  1089. AddText "The system file layout is configured using the LVM (Logical Volume Manager)"
  1090. # choose between LVM1 and LVM2 because of different syntaxes; A. Kumpf, 21.07.06
  1091. if [ -x "/sbin/lvm" ]; then
  1092. LVM_VER=2
  1093. else
  1094. LVM_VER=1
  1095. fi
  1096. #
  1097. case "$LVM_VER" in
  1098. "1")
  1099. exec_command "lvscan --version" "LVM Version"
  1100. exec_command "ls -la /dev/*/group" "Volumegroup Device Files"
  1101. # { changed/added 29.01.2004 (11:15) by Ralph Roth } - sr by winfried knobloch for Serviceguard
  1102. exec_command "cat /proc/lvm/global" "LVM global info"
  1103. exec_command "vgdisplay -v | awk -F' +' '/PV Name/ {print \$4}'" "Available Physical Groups"
  1104. exec_command "vgdisplay -s | awk -F\\\" '{print \$2}'" "Available Volume Groups"
  1105. exec_command "vgdisplay -v | awk -F' +' '/LV Name/ {print \$3}'" "Available Logical Volumes"
  1106. ;;
  1107. "2")
  1108. exec_command "ls -al /dev/mapper/*" "Volumegroup Device Files"
  1109. exec_command "lvm version" "LVM global info"
  1110. exec_command "lvm dumpconfig" "LVM dumpconfig"
  1111. exec_command "vgdisplay -v | awk -F' +' '/PV Name/ {print \$4}'" "Available Physical Groups"
  1112. exec_command "vgdisplay -s | awk -F\\\" '{print \$2}'" "Available Volume Groups"
  1113. exec_command "vgdisplay -v | awk -F' +' '/LV Name/ {print \$4}'" "Available Logical Volumes"
  1114. # The command vgs -o +tags vgname will display any tags that are set for a volume group. *TODO*
  1115. # vgcreate --addtag $(uname -n) /dev/vgpkgA /dev/sda1 /dev/sdb1 // vgchange --deltag $(uname -n) vgpkgA *SGLX*
  1116. [ -x /sbin/vgs ] && exec_command "/sbin/vgs -o vg_name,lv_name,devices" "Detailed Volume Groups Report" # 27.10.2011 #* rar *# EHR by Jim Bruce
  1117. exec_command "lvs -o +devices" "Logical Volumes" # 07.11.2011, 21:46 modified by Ralph Roth #* rar *#
  1118. ;;
  1119. *)
  1120. AddText "Unsupported (new) LVM version ($LVM_VER)!"
  1121. ;;
  1122. esac
  1123. #
  1124. exec_command "vgdisplay -v" "Volumegroups"
  1125. exec_command PVDisplay "Physical Devices used for LVM"
  1126. AddText "Note: Run vgcfgbackup on a regular basis to backup your volume group layout"
  1127. else
  1128. # if vgdisplay exist, but no LV configured (dk3hg 21.02.03)
  1129. AddText "LVM binaries found, but this system seems to be configured with whole disk layout (WDL)"
  1130. fi
  1131. else
  1132. AddText "This system seems to be configured with whole disk layout (WDL)"
  1133. fi
  1134.  
  1135. # MD Tools, Ralph Roth
  1136.  
  1137. if [ -r /etc/raidtab ]
  1138. then
  1139. exec_command "cat /proc/mdstat" "Software RAID: mdstat"
  1140. exec_command "cat /etc/raidtab" "Software RAID: raidtab"
  1141. [ -r /proc/devices/md ] && exec_command "cat /proc/devices/md" "Software RAID: MD Devices"
  1142. fi
  1143.  
  1144. dec_heading_level
  1145.  
  1146. fi # terminates CFG_LVM wrapper
  1147.  
  1148. ###########################################################################
  1149. if [ "$CFG_NETWORK" != "no" ]
  1150. then # else skip to next paragraph
  1151.  
  1152. paragraph "Network Settings"
  1153. inc_heading_level
  1154.  
  1155. if [[ -x /sbin/ifconfig ]]; then
  1156. exec_command "/sbin/ifconfig" "LAN Interfaces Settings (ifconfig)" #D011 -- 16. March 2011, 28. Dezember 2011, ER by Heiko Andresen // to avoid erros of ifconfig not found
  1157. fi
  1158. exec_command "ip addr" "LAN Interfaces Settings (ip addr)" #D011 -- 16. March 2011, 28. Dezember 2011, ER by Heiko Andresen
  1159. exec_command "ip -s l" "Detailed NIC Statistics" #07.11.2011, 21:33 modified by Ralph Roth #* rar *#
  1160. # nmcli not available on SLES11##FIXED## 20150304 by Ralph Roth
  1161. if [ -x /usr/bin/nmcli ]
  1162. then
  1163. # exec_command "nmcli nm status" "NetworkManager Status" #06.11.2014, 20:34 added by Dusan Baljevic dusan.baljevic@ieee.org##FIXED## 20150304 by Ralph Roth // not availabe on openSUSE 13.2!
  1164. exec_command "nmcli device status" "NetworkManager Device Status" #20150527 by Ralph Roth
  1165. exec_command "nmcli connection show" "NetworkManager Connections" #06.11.2014, 20:34 added by Dusan Baljevic dusan.baljevic@ieee.org##FIXED## 20150304 by Ralph Roth
  1166. fi ## /usr/bin/nmcli
  1167.  
  1168. if [ -x /usr/sbin/ethtool ] ### 22.11.2010, 23:44 modified by Ralph Roth
  1169. then
  1170. LANS=$(netstat -i | tail -n+3 | awk '{print $1}' |grep -v ^lo) # RR: ifconfig is decrecapted -> use netstat instead (gdha)
  1171. for i in $LANS
  1172. do
  1173. exec_command "/usr/sbin/ethtool $i 2>/dev/null; /usr/sbin/ethtool -i $i" "Ethernet Settings for Interface "$i
  1174. done
  1175. fi
  1176.  
  1177. if [ $DEBIAN = "yes" ] ; then
  1178. if [ -f /etc/network/interfaces ] ; then
  1179. exec_command "grep -vE '(^#|^$)' /etc/network/interfaces" "Netconf Settings"
  1180. fi
  1181. fi
  1182.  
  1183. ## Added 3/05/08 by krtmrrsn@yahoo.com, Marc Korte, display ethernet
  1184. ## LAN and route config files for RedHat.
  1185. if [ $REDHAT = "yes" ] ; then
  1186. ## There will always be at least ifcfg-lo.
  1187. exec_command "for CfgFile in /etc/sysconfig/network-scripts/ifcfg-*; do printf \"\n\n\$(basename \${CfgFile}):\n\n\"; cat \${CfgFile}; done" "LAN Configuration Files"
  1188. ## Check first that any route-* files exist ("grep -q ''" exit status). Seems buggy!
  1189. exec_command "if grep -q '' /etc/sysconfig/network-scripts/route-*; then for RouteCfgFile in /etc/sysconfig/network-scripts/route-*; do printf \"\n\n\$(basename \${RouteCfgFile}):\n\n\"; cat \${RouteCfgFile}; done; fi" "Route Configuration Files"
  1190. fi
  1191. ## End Marc Korte display ethernet LAN config files.
  1192.  
  1193. [ -x /sbin/mii-tool ] && exec_command "/sbin/mii-tool -v" "MII Status"
  1194. [ -x /sbin/mii-diag ] && exec_command "/sbin/mii-diag -a" "MII Diagnostics"
  1195.  
  1196. exec_command "ip route" "Network Routing" # 07.11.2011, 21:37 modified by Ralph Roth #* rar *#
  1197. exec_command "netstat -r" "Routing Tables"
  1198. exec_command "ip neigh" "Network Neighborhood" # 07.11.2011, 21:38 modified by Ralph Roth #* rar *#
  1199.  
  1200. NETSTAT=`which netstat`
  1201. if [ $NETSTAT ] && [ -x $NETSTAT ]; then
  1202. # test if netstat version 1.38, because some options differ in older versions
  1203. # MiMe: '\' auf awk Zeile wichtig
  1204. RESULT=`netstat -V | awk '/netstat/ {
  1205. if ( $2 < 1.38 ) {
  1206. print "NO"
  1207. } else { print "OK" }
  1208. }'`
  1209.  
  1210. #exec_command "if [ "$RESULT" = "OK" ] ; then netstat -gi; fi" "Interfaces"
  1211. if [ "$RESULT" = "OK" ]
  1212. then
  1213. exec_command "netstat -gi" "Interfaces"
  1214. exec_command "netstat -tlpn" "TCP Daemons accepting connection"
  1215. exec_command "netstat -ulpn" "UDP Daemons accepting connection"
  1216. fi
  1217.  
  1218. exec_command "netstat -s" "Summary statistics for each protocol"
  1219. [ -x /usr/sbin/nstat ] && exec_command "/usr/sbin/nstat" "Other Network statistics" # gdha, 13/oct/2014 #47
  1220. exec_command "netstat -i" "Kernel Interface table"
  1221. # MiMe: iptables since 2.4.x
  1222. # MiMe: iptable_nat realisiert dabei das Masquerading
  1223. # MiMe: Details stehen in /proc/net/ip_conntrack
  1224. if [ -e /proc/net/ip_masquerade ]; then
  1225. exec_command "netstat -M" "Masqueraded sessions"
  1226. fi
  1227. if [ -e /proc/net/ip_conntrack ]; then
  1228. exec_command "cat /proc/net/ip_conntrack" "Masqueraded sessions"
  1229. fi
  1230. exec_command "netstat -an" "list of all sockets"
  1231. fi ## netstat
  1232. # -----------------------------------------------------------------------------
  1233. if [ -x /usr/sbin/ss ]
  1234. then
  1235. exec_command "/usr/sbin/ss -planeto" "TCP Listening Sockets Statistics" # changed 20131211 by Ralph Roth
  1236. exec_command "/usr/sbin/ss -planeuo" "UDP Listening Sockets Statistics" # UDP and listening? :)
  1237. fi # ss
  1238. # -----------------------------------------------------------------------------
  1239. ## Added 4/07/06 by krtmrrsn@yahoo.com, Marc Korte, probe and display
  1240. ## kernel interface bonding info.
  1241. if [ -e /proc/net/bonding ]; then
  1242. for BondIF in `ls -1 /proc/net/bonding`
  1243. do
  1244. exec_command "cat /proc/net/bonding/$BondIF" "Bonded Interfaces: $BondIF"
  1245. done
  1246. fi
  1247. ## End Marc Korte kernel interface bonding addition.
  1248. # -----------------------------------------------------------------------------
  1249. DIG=`which dig`
  1250. if [ -n "$DIG" ] && [ -x $DIG ] ; then
  1251. exec_command "dig `hostname -f`" "dig hostname"
  1252. else
  1253. NSLOOKUP=`which nslookup`
  1254. if [ -n "$NSLOOKUP" ] && [ -x $NSLOOKUP ] ; then
  1255. exec_command "nslookup `hostname -f`" "Nslookup hostname"
  1256. fi
  1257. fi
  1258.  
  1259. exec_command "grep -vE '^#|^ *$' /etc/hosts" "/etc/hosts"
  1260. #
  1261. if [ -f /proc/sys/net/ipv4/ip_forward ] ; then
  1262. FORWARD=`cat /proc/sys/net/ipv4/ip_forward`
  1263. if [ $FORWARD = "0" ] ; then
  1264. exec_command "echo \"IP forward disabled\"" "IP forward"
  1265. else
  1266. exec_command "echo \"IP forward enabled\"" "IP forward"
  1267. fi
  1268. fi
  1269.  
  1270. if [ -r /proc/net/ip_fwnames ] ; then
  1271. if [ -x /sbin/ipchains ] ;then
  1272. exec_command "/sbin/ipchains -n -L forward" "ipfilter forward settings"
  1273. exec_command "/sbin/ipchains -L -v" "ip filter settings"
  1274. fi
  1275. fi
  1276.  
  1277. if [ -r /proc/net/ip_tables_names ] ; then
  1278. if [ -x /sbin/iptables ] ; then
  1279. exec_command "/sbin/iptables -L -v --line-numbers" "Firewall: iptables rules and chains" ## rr, 030604 -v added, 101111, rar
  1280. exec_command "/sbin/iptables-save -c" "Firewall: iptables saved rules" ## rr, 120704 added, -c 101111, rar
  1281. fi
  1282. fi
  1283.  
  1284. ### Begin changes by Dusan.Baljevic@ieee.org ### 13.05.2014
  1285.  
  1286. if [ -x /usr/sbin/ufw ] ; then
  1287. exec_command "/usr/sbin/ufw status" "Netfilter Firewall"
  1288. exec_command "/usr/sbin/ufw app list" "Netfilter Firewall Application Profiles"
  1289. fi
  1290.  
  1291. ### End changes by Dusan.Baljevic@ieee.org ### 14.05.2014
  1292.  
  1293. if [ -x /usr/sbin/tcpdchk ] ; then
  1294. exec_command "/usr/sbin/tcpdchk -v" "tcpd wrapper"
  1295. exec_command "/usr/sbin/tcpdchk -a" "tcpd warnings"
  1296. fi
  1297.  
  1298. [ -f /etc/hosts.allow ] && exec_command "grep -vE '^#|^ *$' /etc/hosts.allow" "hosts.allow"
  1299. [ -f /etc/hosts.deny ] && exec_command "grep -vE '^#|^ *$' /etc/hosts.deny" "hosts.deny"
  1300.  
  1301. #exec_command "nettl -status trace" "Nettl Status"
  1302.  
  1303. if [ -f /etc/gated.conf ] ; then
  1304. exec_command "cat /etc/gated.conf" "Gate Daemon"
  1305. fi
  1306.  
  1307. if [ -f /etc/bootptab ] ; then
  1308. exec_command "grep -vE '(^#|^ *$)' /etc/bootptab" "BOOTP Daemon Configuration"
  1309. fi
  1310.  
  1311. if [ -r /etc/inetd.conf ]; then
  1312. exec_command "grep -vE '^#|^ *$' /etc/inetd.conf" "Internet Daemon Configuration"
  1313. fi
  1314. # 02.05.2005, 15:23 modified by Ralph Roth
  1315.  
  1316. # RedHat default
  1317. ## exec_command "grep -vE '^#|^ *$' /etc/inetd.conf" "Internet Daemon Configuration"
  1318. if [ -d /etc/xinetd.d ]; then
  1319. # mdk/rh has a /etc/xinetd.d directory with a file per service
  1320. exec_command "cat /etc/xinetd.d/*|grep -vE '^#|^ *$'" "/etc/xinetd.d/ section"
  1321. fi
  1322.  
  1323. #exec_command "cat /etc/services" "Internet Daemon Services"
  1324. if [ -f /etc/resolv.conf ] ; then
  1325. exec_command "grep -vE '^#|^ *$' /etc/resolv.conf;echo; ( [ -f /etc/nsswitch.conf ] && grep -vE '^#|^ *$' /etc/nsswitch.conf)" "DNS & Names"
  1326. fi
  1327. [ -r /etc/bind/named.boot ] && exec_command "grep -v '^;' /etc/named.boot" "DNS/Named"
  1328.  
  1329. if [ -x /usr/sbin/nullmailer-send ] ## backport from cfg2html-linux 2.97 -- 04.04.2015, rr
  1330. then
  1331. : ## provides sendmail which NO options
  1332. else
  1333. ## Test of sendmail Version Generates Empty Emails #80 - 04.04.2015
  1334. if [ -x /usr/sbin/postconf ]; then
  1335. exec_command "/usr/sbin/postconf -h mail_version" "Postfix Version"
  1336. elif [ -f /usr/sbin/sendmail.sendmail ]; then
  1337. exec_command "echo | /usr/sbin/sendmail.sendmail -v root | grep 220" "Sendmail version" ## which OS does use this binary? rr - 04.04.2015
  1338. elif [ -x /usr/sbin/sendmail ]; then
  1339. # exec_command "echo | /usr/sbin/sendmail -v root | grep 220" "Sendmail version"
  1340. exec_command "/usr/sbin/sendmail < /dev/null | grep 220" "Sendmail version"
  1341. else
  1342. exec_command "echo SENDMAIL or POSTFIX VERSION not found issue" "Sendmail/Postfix version"
  1343. fi
  1344. fi
  1345.  
  1346. aliasespath="/etc"
  1347. if [ "$GENTOO" == "yes" ] ;then ## 2007-02-27 Oliver Schwabedissen
  1348. aliasespath="/etc/mail"
  1349. fi
  1350. if [ -f $aliasespath/aliases ] ; then
  1351. exec_command "grep -vE '^#|^ *$' $aliasespath/aliases" "Email Aliases"
  1352. fi
  1353. #exec_command "grep -vE '^#|^$' /etc/rc.config.d/nfsconf" "NFS settings"
  1354. exec_command "ps -ef|grep -E '[Nn]fsd|[Bb]iod'" "NFSD and BIOD utilization" ## fixed 2007-02-28 Oliver Schwabedissen
  1355.  
  1356. # if portmap not available, do nothing
  1357. RES=`ps xau | grep [Pp]ortmap`
  1358. if [ -n "$RES" ] ; then
  1359. exec_command "rpcinfo -p " "RPC (Portmapper)"
  1360. # test if mountd running
  1361. MOUNTD=`rpcinfo -p | awk '/mountd/ {print $5; exit}'`
  1362. # if [ "$MOUNTD"="mountd" ] ; then
  1363. if [ -n "$MOUNTD" ] ; then
  1364. exec_command "rpcinfo -u 127.0.0.1 100003" "NSFD responds to RPC requests"
  1365. SHOWMOUNT=`which showmount` ## 2007-02-27 Oliver Schwabedissen
  1366. if [ $SHOWMOUNT ] && [ -x $SHOWMOUNT ] ; then
  1367. exec_command "$SHOWMOUNT -a" "Mounted NFS File Systems"
  1368. fi
  1369. # SUSE
  1370. if [ -x /usr/lib/autofs/showmount ] ; then
  1371. exec_command "/usr/lib/autofs/showmount -a" "Mounted NFS File Systems"
  1372. fi
  1373. if [ -f /etc/auto.master ] ;then
  1374. exec_command "grep -vE '^#|^$' /etc/auto.master" "NFS Automounter Master Settings"
  1375. fi
  1376. if [ -f /etc/auto.misc ] ;then
  1377. exec_command "grep -vE '^#|^$' /etc/auto.misc" "NFS Automounter misc Settings"
  1378. fi
  1379. if [ -f /proc/net/rpc/nfs ] ; then
  1380. exec_command "nfsstat" "NFS Statistics"
  1381. fi
  1382. fi # mountd
  1383. fi
  1384.  
  1385. #(ypwhich 2>/dev/null>/dev/null) && \
  1386. # (exec_command "what /usr/lib/netsvc/yp/yp*; ypwhich" "NIS/Yellow Pages")
  1387.  
  1388. # ntpq live sometimes in /usr/bin or /usr/sbin
  1389. NTPQ=`which ntpq`
  1390. # if [ $NTPQ ] && [ -x $NTPQ ] ; then
  1391. if [ -n "$NTPQ" -a -x "$NTPQ" ] ; then # fixes by Ralph Roth, 180403
  1392. exec_command "$NTPQ -p" "XNTP Time Protocol Daemon"
  1393. fi
  1394.  
  1395. # Chronyc is replacement for standard NTP, now default in RHEL/CentOS 7
  1396. # Added by Dusan Baljevic (dusan.baljevic@ieee.org) on 13 July 2014
  1397. #
  1398. CHRONYC=$(which chronyc 2>/dev/null)
  1399. if [ -n "$CHRONYC" -a -x "$CHRONYC" ] ; then
  1400. exec_command "$CHRONYC -n sourcestats" "CHRONY Time Protocol Daemon sources"
  1401. exec_command "$CHRONYC -n tracking" "CHRONY Time Protocol Daemon tracking"
  1402. fi
  1403.  
  1404. exec_command "timedatectl status" "System Time and Date Status" # Added by Dusan Baljevic (dusan.baljevic@ieee.org) on 6 November 2014
  1405.  
  1406. exec_command "hwclock -r" "Time: HWClock" # rr, 20121201
  1407. [ -f /etc/ntp.conf ] && exec_command "grep -vE '^#|^ *$' /etc/ntp.conf" "ntp.conf"
  1408. [ -f /etc/shells ] && exec_command "grep -vE '^#|^ *$' /etc/shells" "FTP Login Shells"
  1409. [ -f /etc/ftpusers ] && exec_command "grep -vE '^#|^ *$' /etc/ftpusers" "FTP Rejections (/etc/ftpusers)"
  1410. [ -f /etc/ftpaccess ] && exec_command "grep -vE '^#|^ *$' /etc/ftpaccess" "FTP Permissions (/etc/ftpaccess)"
  1411. [ -f /etc/syslog.conf ] && exec_command "grep -vE '^#|^ *$' /etc/syslog.conf" "syslog.conf"
  1412. [ -f /etc/syslog-ng/syslog-ng.conf ] && exec_command "grep -vE '^#|^ *$' /etc/syslog-ng/syslog-ng.conf" "syslog-ng.conf"
  1413. [ -f /etc/host.conf ] && exec_command "grep -vE '^#|^ *$' /etc/host.conf" "host.conf"
  1414.  
  1415. ######### SNMP ############
  1416. [ -f /etc/snmpd.conf ] && exec_command "grep -vE '^#|^ *$' /etc/snmpd.conf" "Simple Network Management Protocol (SNMP)"
  1417. [ -f /etc/snmp/snmpd.conf ] && exec_command "grep -vE '^#|^ *$' /etc/snmp/snmpd.conf" "Simple Network Management Protocol (SNMP)"
  1418. [ -f /etc/snmp/snmptrapd.conf ] && exec_command "grep -vE '^#|^ *$' /etc/snmp/snmptrapd.conf" "SNMP Trapdaemon config"
  1419.  
  1420. [ -f /opt/compac/cma.conf ] && "grep -vE '^#|^ *$' /opt/compac/cma.conf" "HP Insight Management Agents configuration"
  1421.  
  1422. ## ssh
  1423. [ -f /etc/ssh/sshd_config ] && exec_command "grep -vE '^#|^ *$' /etc/ssh/sshd_config" "sshd config"
  1424. [ -f /etc/ssh/ssh_config ] && exec_command "grep -vE '^#|^ *$' /etc/ssh/ssh_config" "ssh config"
  1425.  
  1426. dec_heading_level
  1427.  
  1428. fi # terminates CFG_NETWORK wrapper
  1429.  
  1430.  
  1431. ###########################################################################
  1432. if [ "$CFG_KERNEL" != "no" ]
  1433. then # else skip to next paragraph
  1434.  
  1435. # In the v2.6 Linux kernel, preventing the starvation of requests in general,
  1436. # and read requests in particular, was a primary focus of the new (four) I/O
  1437. # schedulers. The default I/O Elevator in the v2.6 Linux kernel is the
  1438. # anticipatory scheduler. RedHat RHEL4/5.6 and Novell/SUSE SLES 9-11
  1439. # installations overwrite this with the “CFQ scheduler”.
  1440. # see also
  1441. # # blockdev -v --getra /dev/sda
  1442. # get readahead: 1024
  1443. #
  1444.  
  1445. paragraph "Kernel, Modules and Libraries" "Kernelparameters"
  1446. inc_heading_level
  1447.  
  1448. if [ -f /etc/lilo.conf ] ; then
  1449. exec_command "grep -vE '^#|^ *$' /etc/lilo.conf" "Lilo Boot Manager"
  1450. exec_command "/sbin/lilo -q" "currently mapped files"
  1451. fi
  1452.  
  1453. if [ -f /boot/grub/menu.lst ] ; then
  1454. exec_command "grep -vE '^#|^ *$' /boot/grub/menu.lst" "GRUB Boot Manager" # rar
  1455. fi
  1456.  
  1457. if [ -f /etc/palo.conf ] ; then
  1458. exec_command "grep -vE '^#|^ *$' /etc/palo.conf" "Palo Boot Manager"
  1459. fi
  1460.  
  1461. exec_command "ls -l /boot" "Files in /boot" # 2404-2006, ralph
  1462. exec_command "lsmod" "Loaded Kernel Modules" # Fix/ER by VG - on RHEL 5.3, it is : /sbin/lsmod / on Ubuntu 10.04 it is /bin/lsmod,
  1463. exec_command "ls -l /lib/modules" "Available Modules Trees" # rar
  1464.  
  1465. if [ -f /etc/modules.conf ] ; then
  1466. exec_command "grep -vE '^#|^ *$' /etc/modules.conf" "modules.conf"
  1467. fi
  1468. if [ -f /etc/modprobe.conf ] ; then
  1469. exec_command "grep -vE '^#|^ *$' /etc/modprobe.conf" "modprobe.conf (all settings)"
  1470. exec_command "grep -r = /etc/modprob* | grep -v ':#'" "modprobe related settings "
  1471. fi
  1472.  
  1473. if [ -f /etc/sysconfig/kernel ] ; then
  1474. exec_command "grep -vE '^#|^ *$' /etc/sysconfig/kernel" "Modules for the ramdisk" # rar, SUSE only
  1475. exec_command "sed -e '/^#/d;/^$/d;/^[[:space:]]*$/d' /etc/sysconfig/kernel" "Missing Kernel Modules" # changed 20130205 by Ralph Roth
  1476. AddText "See: Modules failing to load at boot time - TID 7005784"
  1477. fi
  1478.  
  1479. if [ "$DEBIAN" = "no" ] && [ "SLACKWARE" = "no" ] ; then
  1480. which rpm > /dev/null && exec_command "rpm -qa | grep -e ^k_def -e ^kernel -e k_itanium -e k_smp -e ^linux" "Kernel RPMs" # rar, SUSE+RH+Itanium2
  1481. fi
  1482.  
  1483. if [ "$DEBIAN" = "yes" ] ; then
  1484. exec_command "dpkg -l | grep -i -e Kernel-image -e Linux-image" "Kernel related DEBs"
  1485. fi
  1486. [ -x /usr/sbin/getsebool ] && exec_command "/usr/sbin/getsebool -a" "SELinux Settings"
  1487.  
  1488. who -b 2>/dev/null > /dev/null && exec_command "who -b" "System boot" # 23.03.2006, 13:18 modified by Ralph Roth
  1489. exec_command "cat /proc/cmdline" "Kernel command line"
  1490.  
  1491. exec_command "getconf GNU_LIBC_VERSION" "libc Version (getconf)"
  1492.  
  1493. if [ -r /lib/libc.so.5 ]
  1494. then
  1495. if [ -x /lib/libc.so.5 ]
  1496. then
  1497. exec_command "/lib/libc.so.5" "libc5 Version" # Mandrake 9.2
  1498. else
  1499. exec_command "strings /lib/libc.so.5 | grep \"release version\"" "libc5 Version (Strings)"
  1500. ############# needs work out!
  1501. ## rpm ## ldd
  1502. fi
  1503. fi
  1504.  
  1505. if [ -r /lib/libc.so.6 ]
  1506. then
  1507. if [ -x /lib/libc.so.6 ]
  1508. then
  1509. exec_command "/lib/libc.so.6" "libc6 Version" # Mandrake 9.2
  1510. else
  1511. exec_command "strings /lib/libc.so.6 | grep \"release version\"" "libc6 Version (Strings)"
  1512. ############# needs work out!
  1513. ## rpm ## ldd
  1514. fi
  1515. fi
  1516.  
  1517. if [ "$DEBIAN" = "no" ] && [ "$SLACKWARE" = "no" ] && [ "$GENTOO" = "no" ] ; then ## fixed 2007-02-27 Oliver Schwabedissen
  1518. which rpm > /dev/null && exec_command "rpm -qi glibc" "libc6 Version (RPM)" # rar, SUSE+RH
  1519. fi
  1520.  
  1521. exec_command "/sbin/ldconfig -vN 2>/dev/null" "Run-time link bindings" ### changed 20130730 by Ralph Roth
  1522.  
  1523. # MiMe: SUSE patched kernel params into /proc
  1524. if [ -e /proc/config.gz ] ; then
  1525. exec_command "zcat /proc/config.gz | grep -vE '^#|^ *$'" "Kernelparameter /proc/config.gz"
  1526. else
  1527. if [ -e /usr/src/linux/.config ] ; then
  1528. exec_command "grep -vE '^#|^ *$' /usr/src/linux/.config" "Kernelsource .config"
  1529. fi
  1530. fi
  1531.  
  1532. ##
  1533. ## we want to display special kernel configuration as well
  1534. ## done in /etc/init.d/boot.local
  1535. ## 31Jan2003 it233 U.Frey FRU
  1536. if [ -e /etc/init.d/boot.local ] ; then
  1537. exec_command "grep -vE '^#|^ *$' /etc/init.d/boot.local" "Additional Kernel Parameters init.d/boot.local"
  1538. fi
  1539.  
  1540. if [ -x /sbin/sysctl ] ; then ## 11.01.2010, 10:44 modified by Ralph Roth
  1541. exec_command "/sbin/sysctl -a 2> /dev/null | sort -u" "configured kernel variables at runtime" ## rr, 20120212
  1542. exec_command "cat /etc/sysctl.conf | sort -u |grep -v -e ^# -e ^$" "configured kernel variables in /etc/sysctl.conf"
  1543. fi
  1544.  
  1545. # Added by Dusan Baljevic (dusan.baljevic@ieee.org) on 15 July 2013
  1546. #
  1547. BOOTCTL=$(which bootctl)
  1548. if [ -n "$BOOTCTL" ] && [ -x "$BOOTCTL" ] ; then
  1549. exec_command "$BOOTCTL status | awk NF" "Firmware and boot manager settings"
  1550. fi
  1551.  
  1552. if [ -f "/etc/rc.config" ] ; then
  1553. exec_command "grep ^INITRD_MODULES /etc/rc.config" "INITRD Modules"
  1554. fi
  1555.  
  1556. if [ -d /sys/devices ]
  1557. then # The new Linux 2.6.x I/O system and the I/O scheduler
  1558. exec_command GetElevator "Kernel I/O Elevator" # 18.07.2011, 13:33 modified by Ralph Roth #* rar *#
  1559. exec_command "lsblk -ta" "List of Block Devices" # changed 20130627 by Ralph Roth
  1560. fi
  1561. dec_heading_level
  1562.  
  1563. fi # terminates CFG_KERNEL wrapper
  1564. ######################################################################
  1565.  
  1566. if [ "$CFG_ENHANCEMENTS" != "no" ]
  1567. then # else skip to next paragraph
  1568.  
  1569. paragraph "System Enhancements"
  1570. inc_heading_level
  1571.  
  1572. if [ -e /etc/X11/XF86Config ] ; then
  1573. exec_command "grep -vE '^#|^ *$' /etc/X11/XF86Config" "XF86Config"
  1574. else
  1575. if [ -e /etc/XF86Config ] ; then
  1576. exec_command "grep -vE '^#|^ *$' /etc/XF86Config" "XF86Config"
  1577. fi
  1578. fi
  1579.  
  1580. # stderr output from "grep -vE '^#|^ *$' /etc/XF86Config-4":
  1581. # grep: /etc/XF86Config-4: No such file or directory
  1582.  
  1583. if [ -e /etc/X11/XF86Config-4 ] ; then
  1584. exec_command "grep -vE '^#|^ *$' /etc/X11/XF86Config-4" "XF86Config-4"
  1585. else
  1586. if [ -e /etc/XF86Config-4 ] ; then # 09.01.2008, 14:49 modified by Ralph Roth
  1587. exec_command "grep -vE '^#|^ *$' /etc/XF86Config-4" "XF86Config-4"
  1588. fi
  1589. fi
  1590.  
  1591. if [ -e /etc/X11/xorg.conf ] ; then
  1592. exec_command "grep -vE '^#|^ *$' /etc/X11/xorg.conf" "xorg.conf"
  1593. fi
  1594.  
  1595. # MiMe: fuer X braucht man Rechte
  1596. if [ -x /usr/X11R6/bin/xhost ] ; then
  1597. /usr/X11R6/bin/xhost > /dev/null 2>&1
  1598. if [ "$?" -eq "0" ] ;
  1599. then
  1600. # Gratien D'haese
  1601. # fix for sshdX11
  1602. # old command [ -x /usr/bin/X11/xdpyinfo ] && [ -n "$DISPLAY" ] && exec_command "/usr/bin/X11/xdpyinfo" "X11"
  1603. # this will only check if the display is 0 or 1 which is more then enough
  1604. [ -x /usr/bin/X11/xdpyinfo ] && [ -n "$DISPLAY" ] && [ `echo $DISPLAY | cut -d: -f2 | cut -d. -f1` -le 1 ] && exec_command "/usr/bin/X11/xdpyinfo" "X11"
  1605. [ -x /usr/bin/X11/fsinfo ] && [ -n "$FONTSERVER" ] && exec_command "/usr/bin/X11/fsinfo" "Font-Server"
  1606. fi
  1607. fi
  1608.  
  1609. [ -x /opt/gnome/bin/gconftool-2 ] && exec_command "gconftool-2 -R /system" "GNOME System Config" ## BF=bernhard keppel/110711, 30.11.2010/Ralph Roth
  1610.  
  1611. dec_heading_level
  1612.  
  1613. fi # terminates CFG_ENHANCEMENTS wrapper
  1614. ###########################################################################
  1615.  
  1616. if [ "$CFG_APPLICATIONS" != "no" ]
  1617. then # else skip to next paragraph
  1618.  
  1619. paragraph "Applications and Subsystems"
  1620.  
  1621. ### COMMON ################################################################
  1622.  
  1623. inc_heading_level
  1624.  
  1625. [ -x /usr/sbin/rear ] && exec_command "/usr/sbin/rear dump" "ReaR Configuration" # 14.06.2011, 18:58 modified by Ralph Roth #* rar *#
  1626.  
  1627. if [ -d /usr/local/bin ] ; then
  1628. exec_command "ls -lisa /usr/local/bin" "Files in /usr/local/bin"
  1629. fi
  1630. if [ -d /usr/local/sbin ] ; then
  1631. exec_command "ls -lisa /usr/local/sbin" "Files in /usr/local/sbin"
  1632. fi
  1633. if [ -d /opt ] ; then
  1634. exec_command "ls -lisa /opt" "Files in /opt"
  1635. fi
  1636.  
  1637. ############ Samba and Swat ########################
  1638.  
  1639. if [ -f /etc/inetd.conf ] ; then
  1640. SWAT=`grep swat /etc/services /etc/inetd.conf`
  1641. fi
  1642. if [ -f /etc/xinetd.conf ] ; then
  1643. SWAT=`grep swat /etc/services /etc/xinetd.conf`
  1644. fi
  1645.  
  1646. [ -n "$SWAT" ] && exec_command "echo $SWAT" "Samba: SWAT-Port"
  1647.  
  1648. [ -x /usr/sbin/smbstatus ] && exec_command "/usr/sbin/smbstatus 2>/dev/null" "Samba (smbstatus)"
  1649. ### Debian...., maybe a smbstatus -V/samba -V is useful
  1650. [ -x /usr/bin/smbstatus ] && exec_command "/usr/bin/smbstatus 2>/dev/null" "Samba (smbstatus)" ## fixed 2007-02-27 Oliver Schwabedissen
  1651. [ -x /usr/bin/testparm ] && exec_command "/usr/bin/testparm -s 2> /dev/null" "Samba Configuration (testparm)" # 09.01.2008, 14:53 modified by Ralph Roth
  1652. [ -f /etc/samba/smb.conf ] && exec_command "cat /etc/samba/smb.conf" "Samba Configuration (smb.conf)" #*# Alexander De Bernardi, 20100421 testparm does not show complete config
  1653. [ -f /etc/init.d/samba ] && exec_command "ps -ef | grep -E '(s|n)m[b]'" "Samba Daemons"
  1654.  
  1655. if [ -x /usr/sbin/lpc ] ; then
  1656. exec_command "/usr/sbin/lpc status" "BSD Printer Spooler and Printers" #*# Alexander De Bernardi, 20100310
  1657. fi
  1658. if [ -x /usr/bin/lpstat ] ; then
  1659. exec_command "/usr/bin/lpstat -t" "SYSV Printer Spooler and Printers" #*# Alexander De Bernardi, 20100310
  1660. fi
  1661. # if [ -x /usr/bin/hp-info ] ; then
  1662. #
  1663. # This for a bug in linux version
  1664. # Found: cfg2html stalls (freeze) when hplip is installed
  1665. # Cause: hp-info called in interactive mode, waits for a reply
  1666. # EL, 1.84 - 25. Januar 2011
  1667. # exec_command "echo q | /usr/bin/hp-info -i | \
  1668. # /usr/bin/col" "HPLIP Printer Info" #*# Alexander De Bernardi, 20100310
  1669. # fi
  1670.  
  1671. [ -r /etc/printcap ] && exec_command "grep -vE '^#|^ *$' /etc/printcap" "Printcap"
  1672. [ -r /etc/hosts.lpd ] && exec_command "grep -vE '^#|^ *$' /etc/hosts.lpd" "hosts.lpd"
  1673.  
  1674. ##
  1675. ## we want to display HP OpenVantage Operations configurations
  1676. ## 31Jan2003 it233 FRU U.Frey
  1677.  
  1678. if [ -e /opt/OV/bin/OpC/utils/opcdcode ] ; then
  1679. if [ -e /opt/OV/bin/OpC/install/opcinfo ] ; then
  1680. exec_command "cat /opt/OV/bin/OpC/install/opcinfo" "HP OpenView Info, Version"
  1681. fi
  1682. if [ -e /var/opt/OV/conf/OpC/monitor ] ; then
  1683. exec_command "/opt/OV/bin/OpC/utils/opcdcode /var/opt/OV/conf/OpC/monitor | grep DESCRIPTION" "HP OpenView Configuration MONITOR"
  1684. fi
  1685.  
  1686. if [ -e /var/opt/OV/conf/OpC/le ] ; then
  1687. exec_command "/opt/OV/bin/OpC/utils/opcdcode /var/opt/OV/conf/OpC/le | grep DESCRIPTION" "HP OpenView Configuration LOGGING"
  1688. fi
  1689. fi
  1690.  
  1691.  
  1692. ## we want to display Veritas Netbackup configurations
  1693. ## 31Jan2003 it233 FRU U.Frey
  1694. ## 3/5/08 Modified/added functionality by krtmrrsn@yahoo.com, Marc Korte.
  1695. ## Some things have changed in NetBU 6.x.
  1696. ## Made a separate section for Veritas Netbackup
  1697. if [ -e /usr/openv/netbackup/bp.conf ] ; then
  1698.  
  1699. dec_heading_level
  1700. paragraph "Veritas Netbackup Configuration"
  1701. inc_heading_level
  1702.  
  1703. NetBuVersion=$(find /usr/openv/netbackup -name "version")
  1704. if [ -e ${NetBuVersion} ] ; then
  1705. exec_command "cat ${NetBuVersion}" "Veritas Netbackup Version"
  1706. fi
  1707. exec_command "cat /usr/openv/netbackup/bp.conf" "Veritas Netbackup Configuration"
  1708. # bring the logic of hpux test to linux as well - gdha - 16/Dec/2015
  1709. if [ -s /usr/openv/netbackup/exclude_list ] ; then
  1710. exec_command "cat /usr/openv/netbackup/exclude_list" "Symantec Netbackup exclude_list"
  1711. fi
  1712. if [ -s /usr/openv/netbackup/include_list ] ; then
  1713. exec_command "cat /usr/openv/netbackup/include_list" "Symantec Netbackup include_list"
  1714. fi
  1715. if [ -x /usr/openv/netbackup/bin/bpclimagelist ] ; then
  1716. exec_command "$TIMEOUTCMD 20 /usr/openv/netbackup/bin/bpclimagelist | head -12" "Overview of the last 10 backups"
  1717. LASTFULL=$($TIMEOUTCMD 20 /usr/openv/netbackup/bin/bpclimagelist | grep Full | head -1 | cut -c1-10)
  1718. [[ -z "$LASTFULL" ]] && LASTFULL=$(date +%d/%m/%Y) # if no output was retrieved we use today's date
  1719. LASTFULLSEC=$(date +%s -d $LASTFULL)
  1720. sleep 1 # to have at least 1 sec difference
  1721. NOWSEC=$(date +%s)
  1722.  
  1723. DIFFDAYS=$(( ($NOWSEC - $LASTFULLSEC) /86400 ))
  1724. if [[ $DIFFDAYS -gt 14 ]]; then
  1725. AddText "Warning: Last full backup is $DIFFDAYS days old"
  1726. else
  1727. AddText "Last full backup is $DIFFDAYS days old"
  1728. fi
  1729. fi
  1730.  
  1731. exec_command "netstat -tap | egrep '(bpcd|bpjava-msvc|bpjava-susvc|vnetd|vopied)|(Active|Proto)'" "Veritas Netbackup Network Connections"
  1732. ## Use FS="=" in case there's no whitespace in the SERVER lines.
  1733. exec_command "for NetBuServer in $(awk 'BEGIN {FS="="} /SERVER/ {printf $NF}' /usr/openv/netbackup/bp.conf); do ping -c 3 \${NetBuServer} && echo \"\"; done" "Veritas Netbackup Servers Ping Check"
  1734. if ping -c 3 $(awk 'BEGIN {FS="="} /SERVER/ {print $NF}' /usr/openv/netbackup/bp.conf | head -1) >/dev/null
  1735. then
  1736. exec_command "/usr/openv/netbackup/bin/bpclntcmd -pn" "Veritas Netbackup Client to Server Inquiry"
  1737. fi
  1738. fi
  1739.  
  1740. ### Section about HP Data Protector info - gdha - 04/Jan/2016
  1741. if [ -f /etc/opt/omni/client/cell_server ] ; then
  1742. dec_heading_level
  1743. paragraph "HP Data Protector Configuration"
  1744. inc_heading_level
  1745. exec_command "cat /etc/opt/omni/client/cell_server" "HP Data Protector cell manager"
  1746. if [ -x /opt/omni/bin/omnicheck ]; then
  1747. exec_command "/opt/omni/bin/omnicheck -version" "HP Data Protector version"
  1748. exec_command "/opt/omni/bin/omnicheck -patches -host $(hostname)" "HP Data Protector patches"
  1749. fi
  1750. fi
  1751.  
  1752. ### new stuff with 2.83 by Dusan // # changed 20140319 by Ralph Roth
  1753. if [ -x /usr/bin/puppet ]
  1754. then
  1755. ##############################################################################
  1756. ### Puppet settings
  1757. ### Made by Dusan.Baljevic@ieee.org ### 12.03.2014, # changed 20140425 by Ralph Roth, # changed 20140428 by Dusan, backported from 2.90, 2.91
  1758. dec_heading_level
  1759. paragraph "Puppet Configuration Management System"
  1760. inc_heading_level
  1761. exec_command "ps -ef | grep -E 'puppetmaster[d]|puppet maste[r]'" "Active Puppet Master"
  1762. exec_command "ps -ef | grep -E 'puppet[d]'" "Active Puppet Client"
  1763.  
  1764. if [ -x /usr/sbin/puppetd ]; then
  1765. exec_command "/usr/sbin/puppetd -V" "Puppet Client agent version"
  1766. else
  1767. exec_command "/usr/bin/puppet agent -V" "Puppet Client agent version"
  1768. fi
  1769.  
  1770. exec_command "/usr/bin/puppet master status" "Puppet Server status"
  1771.  
  1772. PUPPETCHK=$(puppet help | awk '$1 == "config" {print}')
  1773. if [ "$PUPPETCHK" ] ; then
  1774. exec_command "/usr/bin/puppet config print all" "Puppet configuration"
  1775. exec_command "/usr/bin/puppet config print modulepath" "Puppet configuration module paths"
  1776. fi
  1777.  
  1778. if [ -x /usr/sbin/puppetca ]; then
  1779. exec_command "/usr/sbin/puppetca -l -a" "Puppet certificates"
  1780. else
  1781. exec_command "/usr/bin/puppet ca list --all" "Puppet certificates"
  1782. fi
  1783.  
  1784. # gdha - 16/Nov/2015 - added TIEMOUTCMD - issue #95
  1785. exec_command "$TIMEOUTCMD 60 /usr/bin/puppet resource user" "Users in Puppet Resource Abstraction Layer (RAL)"
  1786. exec_command "/usr/bin/puppet resource package" "Packages in Puppet Resource Abstraction Layer (RAL)"
  1787. # SUSE-SU-2014:0155-1 # seems to crash plain installed servers, puppet not configured ## changed 20140429 by Ralph Roth
  1788. # Bug References: 835122,853982 - CVE References: CVE-2013-4761 - puppet-2.6.18-0.12.1
  1789. #exec_command "/usr/bin/puppet resource service" "Services in Puppet Resource Abstraction Layer (RAL)"
  1790.  
  1791. ##############################################################################
  1792. fi # puppet
  1793.  
  1794. if [ -x /opt/chef-server/embedded/bin/knife ]
  1795. then
  1796. ### Chef settings
  1797. ### Made by Dusan.Baljevic@ieee.org ### 16.03.2014
  1798. dec_heading_level
  1799. paragraph "Chef Configuration Management System"
  1800. inc_heading_level
  1801. [ -x /opt/chef-server/bin/chef-server-ctl ] && exec_command "/opt/chef-server/bin/chef-server-ctl test" "Chef Server"
  1802. [ -x /opt/chef-server/embedded/bin/knife ] && exec_command "/opt/chef-server/embedded/bin/knife list -R /" "Chef full status"
  1803. [ -x /opt/chef-server/embedded/bin/knife ] && exec_command "/opt/chef-server/embedded/bin/knife environment list -w" "Chef list of environments"
  1804. [ -x /opt/chef-server/embedded/bin/knife ] && exec_command "/opt/chef-server/embedded/bin/knife client list" "Chef list of registered API clients"
  1805. [ -x /opt/chef-server/embedded/bin/knife ] && exec_command "/opt/chef-server/embedded/bin/knife cookbook list" "Chef list of registered cookbooks"
  1806. [ -x /opt/chef-server/embedded/bin/knife ] && exec_command "/opt/chef-server/embedded/bin/knife data bag list" "Chef list of data bags"
  1807. [ -x /opt/chef-server/embedded/bin/knife ] && exec_command "/opt/chef-server/embedded/bin/knife diff" "Chef differences between local chef-repo and files on server"
  1808. [ -x /opt/chef-server/embedded/bin/chef-client ] && exec_command "/opt/chef-server/embedded/bin/chef-client -v" "Chef Client"
  1809. ##############################################################################
  1810. fi
  1811.  
  1812. # this may need reworking - works only if CFEngine agent is installed. # changed 20140319 by Ralph Roth
  1813. if [ -x /var/cfengine/bin/cfagent ]
  1814. then
  1815. ### new stuff with 2.85 by Dusan
  1816. ##############################################################################
  1817. ### CFEngine settings
  1818. ### Made by Dusan.Baljevic@ieee.org ### 19.03.2014
  1819. dec_heading_level
  1820. paragraph "CFEngine Configuration Management System"
  1821. inc_heading_level
  1822. exec_command "ps -ef | grep -E 'cfserv[d]|cf-server[d]'" "Active CFEngine Server"
  1823. exec_command "ps -ef | grep -E 'cfagen[t]|cf-agen[t]'" "Active CFEngine Agent"
  1824. [ -x /var/cfengine/bin/cfagent ] && exec_command "/var/cfengine/bin/cfagent -V" "CFEngine v2 Agent version"
  1825. [ -x /var/cfengine/bin/cfagent ] && exec_command "/var/cfengine/bin/cfagent -p -v" "CFEngine v2 classes"
  1826. [ -x /var/cfengine/bin/cfagent ] && exec_command "/var/cfengine/bin/cfagent --no-lock --verbose --no-splay" "CFEngine v2 managed client status"
  1827. [ -x /var/cfengine/bin/cfagent ] && exec_command "/var/cfengine/bin/cfagent -n" "CFEngine v2 pending actions for managed client (dry-run)"
  1828. [ -x /var/cfengine/bin/cfshow ] && exec_command "/var/cfengine/bin/cfshow --active" "CFEngine v2 dump of active database"
  1829. [ -x /var/cfengine/bin/cfshow ] && exec_command "/var/cfengine/bin/cfshow --classes" "CFEngine v2 dump of classes database"
  1830.  
  1831. [ -x /var/cfengine/bin/cf-serverd ] && exec_command "/var/cfengine/bin/cf-serverd --version" "CFEngine v3 Server version"
  1832. [ -x /var/cfengine/bin/cf-agent ] && exec_command "/var/cfengine/bin/cf-agent --version" "CFEngine v3 Agent version"
  1833. [ -x /var/cfengine/bin/cf-report ] && exec_command "/var/cfengine/bin/cf-report -q --show promises" "CFEngine v3 promises"
  1834. [ -x /var/cfengine/bin/cf-promises ] && exec_command "/var/cfengine/bin/cf-promises -v" "CFEngine v3 validation of policy code"
  1835. [ -x /var/cfengine/bin/cf-agent ] && exec_command "/var/cfengine/bin/cf-agent -n" "CFEngine v3 pending actions for managed client (dry-run)"
  1836. ##############################################################################
  1837. fi # CFEngine
  1838.  
  1839. ##############################################################
  1840.  
  1841. ####BACKPORT####
  1842. ## SAP stuff # changed 20140213 by Ralph Roth, backported from Gratien SAP-Info collector 12.04.2015,Ralph Roth
  1843. # -----------------------------------------------------------------------------
  1844. if [ -x /usr/sap/hostctrl/exe/saphostexec ]
  1845. then
  1846. dec_heading_level
  1847. paragraph "SAP Information"
  1848. inc_heading_level
  1849. exec_command "/usr/sap/hostctrl/exe/saphostexec -version" "Installed SAP Components"
  1850. exec_command "/usr/sap/hostctrl/exe/saphostexec -status" "Status SAP" ### Ralph Roth, 12.04.2015
  1851. exec_command "/usr/sap/hostctrl/exe/lssap -F $TMP_DIR/dev_lssap" "SAP - lssap" ### Ralph Roth, 12.04.2015
  1852. exec_command "ps fax | grep -i ' pf=/' | grep -v grep" "Active SAP Processes" ### CHANGED ### 20150412 by Ralph Roth
  1853. fi ## SAP
  1854.  
  1855. ##
  1856.  
  1857. ###########################################################################
  1858. # { changed/added 28.01.2004 by Ralph Roth }
  1859. if [ -r /etc/cmcluster.conf ] ; then
  1860. dec_heading_level
  1861. paragraph "Serviceguard/SGLX"
  1862. inc_heading_level
  1863. . ${SGCONFFILE:=/etc/cmcluster.conf} # get env. setting, rar 12.05.2005
  1864. PATH=$PATH:$SGSBIN:$SGLBIN
  1865. exec_command "cat ${SGCONFFILE:=/etc/cmcluster.conf}" "Cluster Config Files"
  1866. # gdha - 17/Nov/2015 - what does not exist on Linux
  1867. #exec_command "what $SGSBIN/cmcld|head; what $SGSBIN/cmhaltpkg|head" "Real Serviceguard Version" ## 12.05.2005, 10:07 modified by Ralph Roth
  1868. exec_command "cmversion" "Serviceguard Version" ## gdha - 17/Nov/2015
  1869. exec_command "cmquerycl -v" "Serviceguard Configuration"
  1870. exec_command "cmviewcl -v" "Serviceguard Nodes and Packages"
  1871. exec_command "cmviewconf" "Serviceguard Cluster Configuration Information"
  1872. exec_command "cmscancl -s" "Serviceguard Scancl Detailed Node Configuration"
  1873. exec_command "netstat -in" "Serviceguard Network Subnets"
  1874. exec_command "netstat -a |fgrep hacl" "Serviceguard Sockets"
  1875. exec_command "ls -l $SGCONF" "Files in $SGCONF"
  1876. fi
  1877.  
  1878. dec_heading_level
  1879. paragraph "Cluster Services"
  1880. inc_heading_level
  1881.  
  1882. ######## SLES 11 SP1 Pacemaker stuff ########## Mittwoch, 16. March 2011 ##### Ralph Roth ####
  1883. [ -x /usr/sbin/corosync-cfgtool ] && exec_command "/usr/sbin/corosync-cfgtool -s;corosync -v" "Corosync TOTEM Status/Active Rings"
  1884. # see also: corosync-objctl runtime.totem.pg.mrp.srp.members
  1885. [ -x /usr/sbin/corosync-objctl ] && exec_command "/usr/sbin/corosync-objctl" "Corosync Object Database" # changed 20140507 by Ralph Roth
  1886.  
  1887. if [ -x /usr/sbin/crm ] # pacemaker #
  1888. then
  1889. exec_command "/usr/sbin/crm_mon -rnA1" "Cluster Configuration" ## 281113, rr
  1890. exec_command "/usr/sbin/crm -D plain configure show" "Cluster Configuration"
  1891. exec_command "/usr/sbin/crm -D plain status" "Cluster Status"
  1892. fi
  1893.  
  1894. [ -x /usr/sbin/clusterstate ] && exec_command "/usr/sbin/clusterstate --all" "Status of pacemaker HA cluster" ## 04.04.2012, 14:27 modified by Ralph Roth #* rar *#
  1895. [ -x /usr/sbin/crm_simulate ] && exec_command "/usr/sbin/crm_simulate -LsU" "Current Cluster status, scores and utilization" ## changed 20140507 by Ralph Roth
  1896.  
  1897. # only if ClusterTools2/SLES11 HAE are installed # 04.04.2012, modified by Ralph Roth #* rar *#
  1898. [ -x /usr/sbin/grep_cluster_patterns ] && exec_command "/usr/sbin/grep_cluster_patterns --show" "Output of grep_cluster_patterns"
  1899. for i in grep_error_patterns grep_cluster_transition cs_show_scores cs_list_failcounts
  1900. do
  1901. [ -x /usr/sbin/$i ] && exec_command "$i" "ClusterTool2: Output of $i"
  1902. done
  1903.  
  1904. ######## RHEL 5.x CRM stuff ######## 18. March 2011 #### Ralph Roth ####
  1905. if [ -x /usr/sbin/cman_tool ]
  1906. then
  1907. exec_command "/usr/sbin/cman_tool status" "Cluster Resource Manager Status"
  1908. exec_command "/usr/sbin/cman_tool nodes" "Cluster Resource Manager Nodes"
  1909. exec_command "/usr/sbin/cman_tool services" "Cluster Resource Manager Services"
  1910. fi
  1911.  
  1912. ####### Red Hat Cluster Suite configuration # 04.07.2011, modified by Ralph Roth #* rar *#
  1913. if [ -r /etc/cluster/cluster.conf ]
  1914. then
  1915. exec_command "/usr/sbin/clustat" "Cluster Status" ## ER by David Williams
  1916. if [[ $(grep -c xml /etc/cluster/cluster.conf) -gt 0 ]];
  1917. then ## small example can be found at http://pastebin.com/Yi5humeL
  1918. exec_command "cat /etc/cluster/cluster.conf|sed 's{<{\&lt{g'|sed 's{>{\&gt{g'" "Cluster Configuration (XML)"
  1919. else
  1920. exec_command "cat /etc/cluster/cluster.conf" "Cluster Configuration"
  1921. fi
  1922. fi
  1923. dec_heading_level
  1924.  
  1925. fi #"$CFG_APPLICATIONS"# <m> 23.04.2008 - Ralph Roth
  1926.  
  1927. ##########################################################################
  1928. ##
  1929. ## Display Oracle configuration if applicable
  1930. ## Begin Oracle Config Display
  1931. ## 31jan2003 it233 FRU U.Frey
  1932.  
  1933. if [ -s /etc/oratab ] ; then # exists and >0
  1934.  
  1935. paragraph "Oracle Configuration"
  1936. inc_heading_level
  1937.  
  1938. exec_command "grep -vE '^#|^$|:N' /etc/oratab " "Configured Oracle Databases Startups" # 27.10.2011, modified by Ralph Roth #* rar *#
  1939.  
  1940. ##
  1941. ## Display each Oracle initSID.ora File
  1942. ## orcl:/home/oracle/7.3.3.0.0:Y
  1943. ## leaveup:/home/oracle/7.3.2.1.0:N
  1944.  
  1945. for DB in $(grep ':' /etc/oratab|grep -v '^#'|grep -v ':N$') # 27.10.2011, 14:58 modified by Ralph Roth #* rar *#
  1946. do
  1947. Ora_Home=`echo $DB | awk -F: '{print $2}'`
  1948. Sid=`echo $DB | awk -F: '{print $1}'`
  1949. Init=${Ora_Home}/dbs/init${Sid}.ora
  1950. if [ -r "$Init" ]
  1951. then
  1952. exec_command "cat $Init" "Oracle Instance $Sid"
  1953. else
  1954. AddText "WARNING: obsolete entry $Init in /etc/inittab for SID $Sid!"
  1955. fi
  1956. done
  1957. dec_heading_level
  1958. fi
  1959.  
  1960.  
  1961. ###
  1962. ##############################################################################
  1963. ### HP Proliant Server LINUX Logfiles from HP tools and or the HP PSP. ###
  1964. ### Made by Jeroen.Kleen@hp.com EMEA ISS Competence Center Engineer ###
  1965.  
  1966. if [ "$CFG_HPPROLIANTSERVER" != "no" ]
  1967. then # else skip to next paragraph
  1968.  
  1969. # @(#) Below follows HP Proliant specific stuff mainly written by Jeroen Kleen
  1970. # --=----------------------------------------------------------------------=---
  1971. #
  1972.  
  1973. paragraph "hp ProLiant Server Log- and configuration Files"
  1974. inc_heading_level
  1975.  
  1976. temphp=$TMP_DIR/cfg2html_temp
  1977. if [ ! -d $temphp ] ; then
  1978. mkdir $temphp
  1979. fi
  1980.  
  1981. if [ -x /opt/hp/hpdiags/hpdiags ] ; then
  1982. /opt/hp/hpdiags/hpdiags -v 5 -o $temphp/hpdiagsV5.txt -f -p >/dev/null
  1983. fi
  1984.  
  1985. if [ -x /opt/hp/hp_fibreutils/hp_system_info ] ; then
  1986. rm /tmp/system_info*.tar.gz -f
  1987. /opt/hp/hp_fibreutils/hp_system_info > /dev/null
  1988. cp /tmp/system_info*.tar.gz $temphp
  1989. rm /tmp/system_info*.tar.gz -f
  1990. fi
  1991.  
  1992.  
  1993. # Request: Dienstag, 12. Januar 2010 -- Koerber, Martin
  1994. # ========
  1995. # Starting with "8.28-13.0 (6 May 2009)" of cpqacuxe the capture functionality is no longer supported.
  1996. # http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=15351&prodSeriesId=1121486&swItem=MTX-a72c1471380f45f4a5cb2f4ec9&prodNameId=3288144&swEnvOID=4049&swLang=8&taskId=135&mode=5
  1997. #
  1998. # Version: 8.28-13.0 (6 May 2009), hpacucli-8.70-8.0 (April 2012)
  1999. # Scripting for captures and inputs is no longer supported in ACU HPACUCLI is now responsible for scripting
  2000.  
  2001. CPQACUXE=$(which cpqacuxe 2>/dev/null)
  2002. if [ -x "$CPQACUXE" ] ; then
  2003. $CPQACUXE -c $temphp/cpqacuxe.cfg
  2004. fi
  2005.  
  2006. HPADUCLI=$(which hpaducli 2>/dev/null )
  2007. if [ -x "$HPADUCLI" ] ; then
  2008. $HPADUCLI -f $temphp/ADUreport.txt -r
  2009. fi
  2010.  
  2011. # Where is hponcfg installed? /opt/hp/tools ???
  2012. if [ -x /usr/lib/hponcfg ] ; then
  2013. /usr/lib/hponcfg -a -w $temphp/ilo.cfg # closes issue #31 # changed 20131218 by Ralph Roth
  2014. fi
  2015. if [ -x /sbin/hponcfg ] ; then
  2016. /sbin/hponcfg -a -w $temphp/ilo.cfg # closes issue #31 # changed 20131218 by Ralph Roth
  2017. fi
  2018.  
  2019. if [ -x $DMIDECODE ] ; then
  2020. exec_command "$DMIDECODE | grep Product" "HP Proliant Server model Information taken from dmidecode"
  2021. fi
  2022.  
  2023. SURVEY=$(which survey 2>/dev/null)
  2024. if [ -x "$SURVEY" ] ; then
  2025. exec_command "$SURVEY -v 5 -t" "Classic Survey output -v 5"
  2026. fi
  2027.  
  2028. if [ -x /sbin/hplog ] ; then
  2029. exec_command "hplog -t -f -p" "Current Thermal Sensor, Fan and Power data"
  2030. # RE: [cfg2html] cfg2html hangs on Oracle Linux 6.7 --> I fixed the problem. It was giving the error “FAILURE Event log buffer is too small” when running the “hplog –v” command so I just commented out this command line in the cfg2html_linux script. 07.09.2015
  2031. # gdha - 16/Nov/2015 - added TIMEOUTCMD (defined in default.conf) - issue #92
  2032. exec_command "$TIMEOUTCMD 60 hplog -v" "Proliant Integrated Management Log"
  2033. fi
  2034.  
  2035. if [ -r /var/log/hppldu.log ] ; then
  2036. exec_command "cat /var/log/hppldu.log" "Installation Log Proliant Support Pack 7.*"
  2037. fi
  2038.  
  2039. if [ -r /tmp/hppldu.cfg ] ; then
  2040. exec_command "cat /tmp/hppldu.cfg" "Proliant Support Pack 7.* Installation Settings file"
  2041. fi
  2042.  
  2043. if [ -r /var/hp/log/localhost/hpsum_log.txt ] ; then
  2044. exec_command "cat /var/hp/log/localhost/hpsum_log.txt" "Installation Log Proliant Support Pack 8.* using HP SUM"
  2045. fi
  2046.  
  2047. if [ -r /var/hp/log/localhost/hpsum_detail_log.txt ] ; then
  2048. exec_command "cat /var/hp/log/localhost/hpsum_detail_log.txt" "Detailed Installation Log Proliant Support Pack 8.* using HP SUM"
  2049. fi
  2050.  
  2051. if [ -e /opt/compaq/cma.conf ] ; then
  2052. exec_command "cat /opt/compaq/cma.conf" "/opt/compaq/cma.conf file"
  2053. fi
  2054.  
  2055. if [ -e /opt/hp/hp-snmp-agents/cma.conf ] ; then
  2056. exec_command "cat /opt/hp/hp-snmp-agents/cma.conf" "/opt/hp/hp-snmp-agents/cma.conf file"
  2057. fi
  2058.  
  2059. if [ -e /opt/compaq/snmpd.conf.orig ] ; then
  2060. exec_command "cat /opt/compaq/snmpd.conf.orig" "/opt/compaq/snmpd.conf.orig file "
  2061. fi
  2062.  
  2063. if [ -e /var/hp/install_history.txt ] ; then
  2064. exec_command "cat /var/hp/install_history.txt" "/var/hp/install_history.txt file"
  2065. fi
  2066.  
  2067. if [ -e /var/log/hplog.txt ] ; then
  2068. exec_command "cat /var/log/hplog.txt" "/var/log/hplog.txt file"
  2069. fi
  2070.  
  2071. if [ -e /var/opt/hp/nicfwupg.log ] ; then
  2072. exec_command "cat /var/opt/hp/nicfwupg.log" "/var/opt/hp/nicfwupg.log file"
  2073. fi
  2074.  
  2075. if [ -e /var/spool/compaq/cma.log ] ; then
  2076. exec_command "cat /var/spool/compaq/cma.log" "/var/spool/compaq/cma.log Agents logfile"
  2077. fi
  2078.  
  2079. if [ -e /var/cpq/Component.log ] ; then
  2080. exec_command "cat /var/cpq/Component.log" "Individual Components Installation Log file (ROMBIOS/SA FW/iLO)"
  2081. fi
  2082.  
  2083. if [ -e /etc/snmp/snmpd.conf ] ; then
  2084. exec_command "cat /etc/snmp/snmpd.conf" "/etc/snmp/snmpd.conf file"
  2085. fi
  2086.  
  2087. if [ -x /etc/init.d/hpasm ] ; then
  2088. exec_command "/etc/init.d/hpasm status" "hpasm status of how what modules are loaded and running correctly."
  2089. fi
  2090.  
  2091. if [ -e /opt/compaq/cpqhealth/cpqhealth_boot.log ] ; then
  2092. exec_command "cat /opt/compaq/cpqhealth/cpqhealth_boot.log" "LOGfile from when hpasm failed installation"
  2093. fi
  2094.  
  2095. if [ -e /opt/compaq/hprsm/hprsm_boot.log ] ; then
  2096. exec_command "cat /opt/compaq/hprsm/hprsm_boot.log" "LOGfile during boot from hprsm"
  2097. fi
  2098.  
  2099. if [ -x /opt/compaq/nic/bin/hpetfe ] ; then
  2100. exec_command "/opt/compaq/nic/bin/hpetfe -A" "/opt/compaq/utils/nic/bin/hpetfe -A HP NIC information"
  2101. fi
  2102.  
  2103. HPASMCLI=$(which hpasmcli 2>/dev/null)
  2104. if [ -x "$HPASMCLI" ] ; then
  2105. $HPASMCLI -s "show asr; show boot; show dimm; show f1; show fans; show ht; show ipl; show name; show powersupply; show pxe; show serial bios; show serial embedded; show serial virtual; show server; show temp; show uid; show wol" >$temphp/hpasmcliOutput.txt
  2106. exec_command "cat $temphp/hpasmcliOutput.txt" "HP ASM CLI command line output"
  2107. fi
  2108.  
  2109. if [ -e /etc/opt/hp/hp-vt/hp-vt.conf ] ; then
  2110. exec_command "cat /etc/opt/hp/hp-vt/hp-vt.conf" "Intelligent Networking Pack Virus Throttling conf file"
  2111. fi
  2112.  
  2113. if [ -x /etc/init.d/hp-vt ] ; then
  2114. exec_command "/etc/init.d/hp-vt status" "Intelligent Networking Pack Virus Throttling Status"
  2115. fi
  2116.  
  2117. if [ -e /var/opt/hp/hp-vt/hp-vt.log ] ; then
  2118. exec_command "cat /var/opt/hp/hp-vt/hp-vt.log" "Intelligent Networking Pack Logfile"
  2119. fi
  2120.  
  2121. if [ -x /opt/hp/hp-pel/nalicense ] ; then
  2122. exec_command "/opt/hp/hp-pel/nalicense -d" "Proliant Essentials Licenses installed overview"
  2123. fi
  2124. if [ -e /var/opt/hp/hp-pel/hp-pel.log ] ; then
  2125. exec_command "cat /var/opt/hp/hp-pel/hp-pel.log" "Proliant Essentials Licenses Logfile"
  2126. fi
  2127.  
  2128. if [ -e $temphp/ilo.cfg ] ; then
  2129. exec_command "cat $temphp/ilo.cfg" "iLO configuration file captured via HPONCFG"
  2130. fi
  2131.  
  2132. if [ -e /root/install.log.syslog ] ; then
  2133. exec_command "cat /root/install.log.syslog" "Installation SYS logfile"
  2134. fi
  2135.  
  2136. if [ -r /root/install.rdp.log ] ; then
  2137. exec_command "cat /root/install.rdp.log" "Rapid Deployment Pack RDPinstall logfile"
  2138. fi
  2139.  
  2140. if [ -e /root/anaconda-ks.cfg ] ; then
  2141. exec_command "cat /root/anaconda-ks.cfg" "anaconda kickstart file used during OS deployment"
  2142. fi
  2143.  
  2144. if [ -e /var/log/messages ] ; then
  2145. # exec_command "cat /var/log/messages" "messages logging file (older messages logfiles in TARBALL)"
  2146. cp /var/log/messages $temphp > /dev/null
  2147. cp /var/log/messages.1 $temphp > /dev/null
  2148. cp /var/log/messages.2 $temphp > /dev/null
  2149. fi
  2150.  
  2151. if [ -e /var/log/boot.log ] ; then
  2152. exec_command "cat /var/log/boot.log" "boot.log logfile (older boot.log logfiles in TARBALL)"
  2153. cp /var/log/boot.log.1 $temphp > /dev/null
  2154. cp /var/log/boot.log.2 $temphp > /dev/null
  2155. fi
  2156.  
  2157. if [ -e /var/log/dmesg ] ; then
  2158. exec_command "cat /var/log/dmesg" "dmesg logfile /var/log/dmesg"
  2159. fi
  2160.  
  2161. if [ -e /var/log/acpid ] ; then
  2162. exec_command "cat /var/log/acpid" "ACPID power boot / reboot log"
  2163. fi
  2164.  
  2165. # if [ -e $temphp/ADUreport.txt ] ; then
  2166. # exec_command "cat $temphp/ADUreport.txt" "Array Diagnostic Utility report is included in the TAR ball as a single file"
  2167. # fi
  2168.  
  2169. if [ -e $temphp/cpqacuxe.cfg ] ; then
  2170. exec_command "cat $temphp/cpqacuxe.cfg" "cpqacuxe configuration file (SmartArray configuration)"
  2171. fi
  2172.  
  2173. if [ -e /tmp/hpsum ] ; then ## bugfixed 29052013 by Ralph Roth after an ER by Henrik Rosqvist
  2174. echo "Generating HPSUM reports"
  2175. /tmp/hpsum /report /veryv > /dev/null
  2176. /tmp/hpsum /inventory_report /veryv > /dev/null
  2177. /tmp/hpsum /firmware_report /veryv > /dev/null
  2178. cp /tmp/discovery.xml $temphp > /dev/null
  2179. cp /tmp/HPSUM_* $temphp > /dev/null
  2180. cp /tmp/hp_sum/*.trace $temphp > /dev/null
  2181. cp /tmp/hp_sum/InventoryResults.xml $temphp > /dev/null
  2182. fi
  2183.  
  2184. if [ -d /var/hp/log ] ; then
  2185. cp /var/hp/log/* $temphp
  2186. cp /var/hp/log/localhost/* $temphp
  2187. cp /var/log/hp_sum/* $temphp
  2188. fi
  2189.  
  2190. if [ -d /opt/hp/hpdiags ] ; then
  2191. cp /opt/hp/hpdiags/survey* $temphp
  2192. fi
  2193.  
  2194. if [ -d /opt/hp/hp-fc-enablement/elxreport.sh ] ; then
  2195. /opt/hp/hp-fc-enablement/elxreport > /dev/null
  2196. cp /tmp/elxreport.sh* $temphp
  2197. fi
  2198.  
  2199. if [ -d /opt/hp/hp-fc-enablement/ql-hba-collect-1.8/ql-hba-collect.sh ] ; then
  2200. /opt/hp/hp-fc-enablement/ql-hba-collect-1.8/ql-hba-collect.sh > /dev/null
  2201. cp /tmp/QLogicDiag* $temphp
  2202. fi
  2203.  
  2204. if [ -x /usr/local/bin/vcsu ] ; then
  2205. echo "HP Virtual Connect Support Utility (VCSU) detected; get if needed the VC logs"
  2206. echo " collected via /usr/local/bin/vcsu -a collect. and with vcsu -a -supportdump and"
  2207. echo " executute then again cfg2html to get all the logs included automatically."
  2208. cp /usr/local/bin/*.txt $temphp
  2209. cp /usr/local/bin/vcsu*.log $temphp
  2210. fi
  2211.  
  2212. if [ -e /opt/netxen ] ; then
  2213. echo "NetXen diagnostic utility detected; to get full NetXEN diag output run command:"
  2214. echo "/opt/netxen/nxudiag -i ethX (ethX is your eth adapter like eth0 / eth1"
  2215. fi
  2216.  
  2217. ###below partitioning and HPACUCLI is contributed by kgalal@gmail.com
  2218. ## Changed 2011-09-05 Peter Boysen - Previous hpacucli commands was redundant.
  2219. if [ -x /usr/sbin/hpacucli ] ; then
  2220. export INFOMGR_BYPASS_NONSA=1 # see issue #25
  2221. # exec_command "/usr/sbin/hpacucli controller all show" "HP SmartArray controllers Detected" # added by jeroenkleen HP
  2222. # exec_command "/usr/sbin/hpacucli controller all show status" "HP SmartArray controllers Detected with Status"
  2223. # slotnum=`/usr/sbin/hpacucli controller all show | awk '{if($0!="")print $6}'` # jkleen: this doesn't work (yet) for MSA1x000 controllers
  2224. # exec_command "/usr/sbin/hpacucli controller slot=$slotnum physicaldrive all show" "Physical Drives on SmartArray Controller"
  2225. # exec_command "/usr/sbin/hpacucli controller slot=$slotnum logicaldrive all show" "Logical Drives on SmartArray controller"
  2226. exec_command "/usr/sbin/hpacucli ctrl all show config detail" "HP SmartArray controllers Detected" # added by jeroenkleen HP # Changed 2011-09-05 Peter Boysen
  2227. /usr/sbin/hpacucli controller all diag file=$temphp/hpacucli_diag.txt # Added 2011-09-05 Peter Boysen.
  2228. fi
  2229.  
  2230. disks=`/sbin/fdisk -l`
  2231. if [ ! -z "$disks" ] ; then
  2232. exec_command "/sbin/fdisk -l" "Disk Partitions on Logical Drives"
  2233. else
  2234. disks=`cat /proc/partitions | awk '{if($4 ~ /\//)print $4}' |grep -v p`
  2235. for adisk in $disks ; do
  2236. exec_command "/sbin/fdisk -l /dev/$adisk" "Disk Partitions - /dev/$adisk"
  2237. done
  2238. fi
  2239.  
  2240. ###above partitioning and HPACUCLI is contributed by kgalal@gmail.com
  2241.  
  2242. exec_command "ls $temphp" "These files have been made or captured during CFG2html execution and should be in the zipped TARball"
  2243. hplog -s INFO -l "CFG2HTML HP Proliant Server report successfully created"
  2244.  
  2245. dec_heading_level
  2246.  
  2247.  
  2248. fi # end of CFG_HPPROLIANTSERVER paragraph
  2249. ### END of HP Proliant Server Integration
  2250. ###############################################################################
  2251. ###
  2252.  
  2253.  
  2254.  
  2255. ###
  2256. ##############################################################################
  2257. ### Altiris ADL agent settings and logfiles
  2258. ### Made by Jeroen.Kleen@hp.com EMEA ISS Competence Center Engineer ###
  2259.  
  2260. if [ "$CFG_ALTIRISAGENTFILES" != "no" ]
  2261. then # else skip to next paragraph
  2262.  
  2263. # checking if Altiris directory exist otherwise skip this section
  2264. if [ -e /opt/altiris/deployment/adlagent ] ; then
  2265.  
  2266. paragraph "Altiris ADL Agent logfiles and settings"
  2267. inc_heading_level
  2268.  
  2269. exec_command "cat /opt/altiris/deployment/adlagent/conf/adlagent.conf" "Altiris ADLagent settings file"
  2270. exec_command "cat /opt/altiris/deployment/adlagent/log/adlagentdbg.txt" "Altris ADLagent Debugging file"
  2271. exec_command "cat /opt/altiris/deployment/adlagent/log/adlagentIpTrace.txt" "Altiris ADLagent IP tracing file"
  2272.  
  2273. dec_heading_level
  2274. fi
  2275.  
  2276. fi # end of CFG_ALTIRISAGENTFILES paragraph
  2277. ### END of Altiris ADL agent settings and logfiles
  2278. ##############################################################################
  2279.  
  2280.  
  2281. ###
  2282. ##############################################################################
  2283. ### VMWARE settings and logfiles
  2284. ### Made by Jeroen Kleen, EMEA ISS Competence Center Engineer ###
  2285.  
  2286. if [ "$CFG_VMWARE" != "no" ]
  2287. then # else skip to next paragraph
  2288. # checking if VMWare directory exist otherwise skip this section
  2289. if [ -e /proc/vmware ] ; then
  2290.  
  2291. paragraph "VMWare logfiles and settings"
  2292. inc_heading_level
  2293. exec_command "vmware -v" "VMWare Server version"
  2294. echo "VMWare server detected. We will start now the vm-support script in case you"
  2295. echo "need this vmware debugging file send to VMWare support or other support teams."
  2296. vm-support
  2297. exec_command "cat esx-$(date -I).$$.tgz" "vm-support ticket generated in local directory if vm-support is installed."
  2298. dec_heading_level
  2299. fi
  2300. fi # end of CFG_VMWARE paragraph
  2301. ##############################################################################
  2302.  
  2303. #
  2304. # execute custom plugins -- anaumann 2009/07/10
  2305. #
  2306.  
  2307. if [ "$CFG_PLUGINS" != "no" ];
  2308. then # else skip to next paragraph
  2309. if [ -f $CONFIG_DIR/plugins ]; then
  2310. paragraph "Custom plugins"
  2311.  
  2312. # include plugin configuration
  2313. . $CONFIG_DIR/plugins
  2314.  
  2315.  
  2316. if [ -n "$CFG2HTML_PLUGIN_DIR" -a -n "$CFG2HTML_PLUGINS" ]; then
  2317. # only run plugins when we know where to find them and at least one of them is enabled
  2318.  
  2319. inc_heading_level
  2320.  
  2321. if [ "$CFG2HTML_PLUGINS" == "all" ]; then
  2322. # include all plugins
  2323. CFG2HTML_PLUGINS="$(ls -1 $CFG2HTML_PLUGIN_DIR)"
  2324. fi
  2325.  
  2326. for CFG2HTML_PLUGIN in $CFG2HTML_PLUGINS; do
  2327. if [ -f "$CFG2HTML_PLUGIN_DIR/$CFG2HTML_PLUGIN" ]; then
  2328. . $CFG2HTML_PLUGIN_DIR/$CFG2HTML_PLUGIN
  2329. exec_command cfg2html_plugin "$CFG2HTML_PLUGINTITLE"
  2330. else
  2331. AddText "Configured plugin $CFG2HTML_PLUGIN not found in $CFG2HTML_PLUGIN_DIR"
  2332. fi
  2333. done
  2334. dec_heading_level
  2335. fi
  2336. fi
  2337. fi
  2338.  
  2339. ## end of plugin processing
  2340.  
  2341.  
  2342. #
  2343. # collect local files
  2344. #
  2345. if [ -f $CONFIG_DIR/files ] ; then
  2346. paragraph "Local files"
  2347. inc_heading_level
  2348. . $CONFIG_DIR/files
  2349. for i in $FILES
  2350. do
  2351. if [ -f $i ] ; then
  2352. exec_command "grep -vE '(^#|^ *$)' $i" "File: $i"
  2353. fi
  2354. done
  2355. AddText "You can customize this entry by editing /etc/cfg2html/files"
  2356. dec_heading_level
  2357. fi
  2358.  
  2359. dec_heading_level
  2360.  
  2361. close_html
  2362. ###########################################################################
  2363. ###########################################################################
  2364. ###### Creating gzipped TAR File for all needed files together. Added by Jeroen Kleen HP EMEA ISS CC
  2365.  
  2366. if [ "$CFG_HPPROLIANTSERVER" != "no" ]
  2367. then # else skip to next paragraph
  2368.  
  2369. if [ -f $OUTDIR/$BASEFILE.tar ] ; then
  2370. rm $OUTDIR/$BASEFILE.tar
  2371. fi
  2372. echo " "
  2373. echo "The following files are included in your gzipped tarball file:"
  2374. tar -czf $OUTDIR/$BASEFILE.tar.gz $temphp
  2375. echo " "
  2376. echo "The tar file can be mailed to your support supplier if needed"
  2377.  
  2378. fi # end of CFG_HPPROLIANTSERVER (making tarball)
  2379. ###########################################################################
  2380.  
  2381.  
  2382. logger "End of $VERSION"
  2383. _echo "\n"
  2384. line
  2385.  
  2386. logger "End of $VERSION"
  2387. rm -f core > /dev/null
  2388.  
  2389. ########## remove the error.log if it has size zero #######################
  2390. [ ! -s "$ERROR_LOG" ] && rm -f $ERROR_LOG 2> /dev/null
  2391.  
  2392. ####################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement