'\" t .\" Title: hb_report .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-01-07 .\" Manual: Pacemaker documentation .\" Source: hb_report .\" Language: English .\" .TH "HB_REPORT" "8" "2024-01-07" "hb_report" "Pacemaker documentation" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" hb_report \- create report for CRM based clusters (Pacemaker) .SH "SYNOPSIS" .sp \fBhb_report\fP \-f {time|"cts:"testnum} [\-t time] [\-u user] [\-l file] [\-n nodes] [\-E files] [\-p patt] [\-L patt] [\-e prog] [\-MSDCZAQVsvhd] [dest] .SH "DESCRIPTION" .sp The hb_report(1) is a utility to collect all information (logs, configuration files, system information, etc) relevant to Pacemaker (CRM) over the given period of time. .SH "OPTIONS" .sp dest .RS 4 The report name. It can also contain a path where to put the report tarball. If left out, the tarball is created in the current directory named "hb_report\-current_date", for instance hb_report\-Wed\-03\-Mar\-2010. .RE .sp \fB\-d\fP .RS 4 Don\(cqt create the compressed tar, but leave the result in a directory. .RE .sp \fB\-f\fP { time | "cts:"testnum } .RS 4 The start time from which to collect logs. The time is in the format as used by the Date::Parse perl module. For cts tests, specify the "cts:" string followed by the test number. This option is required. .RE .sp \fB\-t\fP time .RS 4 The end time to which to collect logs. Defaults to now. .RE .sp \fB\-n\fP nodes .RS 4 A list of space separated hostnames (cluster members). hb_report may try to find out the set of nodes by itself, but if it runs on the loghost which, as it is usually the case, does not belong to the cluster, that may be difficult. Also, OpenAIS doesn\(cqt contain a list of nodes and if Pacemaker is not running, there is no way to find it out automatically. This option is cumulative (i.e. use \-n "a b" or \-n a \-n b). .RE .sp \fB\-l\fP file .RS 4 Log file location. If, for whatever reason, hb_report cannot find the log files, you can specify its absolute path. .RE .sp \fB\-E\fP files .RS 4 Extra log files to collect. This option is cumulative. By default, /var/log/messages are collected along with the cluster logs. .RE .sp \fB\-M\fP .RS 4 Don\(cqt collect extra log files, but only the file containing messages from the cluster subsystems. .RE .sp \fB\-L\fP patt .RS 4 A list of regular expressions to match in log files for analysis. This option is additive (default: "CRIT: ERROR:"). .RE .sp \fB\-p\fP patt .RS 4 Additional patterns to match parameter name which contain sensitive information. This option is additive (default: "passw.*"). .RE .sp \fB\-Q\fP .RS 4 Quick run. Gathering some system information can be expensive. With this option, such operations are skipped and thus information collecting sped up. The operations considered I/O or CPU intensive: verifying installed packages content, sanitizing files for sensitive information, and producing dot files from PE inputs. .RE .sp \fB\-A\fP .RS 4 This is an OpenAIS cluster. hb_report has some heuristics to find the cluster stack, but that is not always reliable. By default, hb_report assumes that it is run on a Heartbeat cluster. .RE .sp \fB\-u\fP user .RS 4 The ssh user. hb_report will try to login to other nodes without specifying a user, then as "root", and finally as "hacluster". If you have another user for administration over ssh, please use this option. .RE .sp \fB\-X\fP ssh\-options .RS 4 Extra ssh options. These will be added to every ssh invocation. Alternatively, use \f(CR$HOME/.ssh/config\fP to setup desired ssh connection options. .RE .sp \fB\-S\fP .RS 4 Single node operation. Run hb_report only on this node and don\(cqt try to start slave collectors on other members of the cluster. Under normal circumstances this option is not needed. Use if ssh(1) does not work to other nodes. .RE .sp \fB\-Z\fP .RS 4 If the destination directory exist, remove it instead of exiting (this is default for CTS). .RE .sp \fB\-V\fP .RS 4 Print the version including the last repository changeset. .RE .sp \fB\-v\fP .RS 4 Increase verbosity. Normally used to debug unexpected behaviour. .RE .sp \fB\-h\fP .RS 4 Show usage and some examples. .RE .sp \fB\-D\fP (obsolete) .RS 4 Don\(cqt invoke editor to fill the description text file. .RE .sp \fB\-e\fP prog (obsolete) .RS 4 Your favourite text editor. Defaults to $EDITOR, vim, vi, emacs, or nano, whichever is found first. .RE .sp \fB\-C\fP (obsolete) .RS 4 Remove the destination directory once the report has been put in a tarball. .RE .SH "EXAMPLES" .sp Last night during the backup there were several warnings encountered (logserver is the log host): .sp .if n .RS 4 .nf .fam C logserver# hb_report \-f 3:00 \-t 4:00 \-n "node1 node2" report .fam .fi .if n .RE .sp collects everything from all nodes from 3am to 4am last night. The files are compressed to a tarball report.tar.bz2. .sp Just found a problem during testing: .sp .if n .RS 4 .nf .fam C # note the current time node1# date Fri Sep 11 18:51:40 CEST 2009 node1# /etc/init.d/heartbeat start node1# nasty\-command\-that\-breaks\-things node1# sleep 120 #wait for the cluster to settle node1# hb_report \-f 18:51 hb1 .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C # if hb_report can\*(Aqt figure out that this is corosync node1# hb_report \-f 18:51 \-A hb1 .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C # if hb_report can\*(Aqt figure out the cluster members node1# hb_report \-f 18:51 \-n "node1 node2" hb1 .fam .fi .if n .RE .sp The files are compressed to a tarball hb1.tar.bz2. .SH "INTERPRETING RESULTS" .sp The compressed tar archive is the final product of hb_report. This is one example of its content, for a CTS test case on a three node OpenAIS cluster: .sp .if n .RS 4 .nf .fam C $ ls \-RF 001\-Restart .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C 001\-Restart: analysis.txt events.txt logd.cf s390vm13/ s390vm16/ description.txt ha\-log.txt openais.conf s390vm14/ .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C 001\-Restart/s390vm13: STOPPED crm_verify.txt hb_uuid.txt openais.conf@ sysinfo.txt cib.txt dlm_dump.txt logd.cf@ pengine/ sysstats.txt cib.xml events.txt messages permissions.txt .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C 001\-Restart/s390vm13/pengine: pe\-input\-738.bz2 pe\-input\-740.bz2 pe\-warn\-450.bz2 pe\-input\-739.bz2 pe\-warn\-449.bz2 pe\-warn\-451.bz2 .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C 001\-Restart/s390vm14: STOPPED crm_verify.txt hb_uuid.txt openais.conf@ sysstats.txt cib.txt dlm_dump.txt logd.cf@ permissions.txt cib.xml events.txt messages sysinfo.txt .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C 001\-Restart/s390vm16: STOPPED crm_verify.txt hb_uuid.txt messages sysinfo.txt cib.txt dlm_dump.txt hostcache openais.conf@ sysstats.txt cib.xml events.txt logd.cf@ permissions.txt .fam .fi .if n .RE .sp The top directory contains information which pertains to the cluster or event as a whole. Files with exactly the same content on all nodes will also be at the top, with per\-node links created (as it is in this example the case with openais.conf and logd.cf). .sp The cluster log files are named ha\-log.txt regardless of the actual log file name on the system. If it is found on the loghost, then it is placed in the top directory. If not, the top directory ha\-log.txt contains all nodes logs merged and sorted by time. Files named messages are excerpts of /var/log/messages from nodes. .sp Most files are copied verbatim or they contain output of a command. For instance, cib.xml is a copy of the CIB found in /var/lib/heartbeat/crm/cib.xml. crm_verify.txt is output of the crm_verify(8) program. .sp Some files are result of a more involved processing: .sp \fBanalysis.txt\fP .RS 4 A set of log messages matching user defined patterns (may be provided with the \-L option). .RE .sp \fBevents.txt\fP .RS 4 A set of log messages matching event patterns. It should provide information about major cluster motions without unnecessary details. These patterns are devised by the cluster experts. Currently, the patterns cover membership and quorum changes, resource starts and stops, fencing (stonith) actions, and cluster starts and stops. events.txt is always generated for each node. In case the central cluster log was found, also combined for all nodes. .RE .sp \fBpermissions.txt\fP .RS 4 One of the more common problem causes are file and directory permissions. hb_report looks for a set of predefined directories and checks their permissions. Any issues are reported here. .RE .sp \fBbacktraces.txt\fP .RS 4 gdb generated backtrace information for cores dumped within the specified period. .RE .sp \fBsysinfo.txt\fP .RS 4 Various release information about the platform, kernel, operating system, packages, and anything else deemed to be relevant. The static part of the system. .RE .sp \fBsysstats.txt\fP .RS 4 Output of various system commands such as ps(1), uptime(1), netstat(8), and ifconfig(8). The dynamic part of the system. .RE .sp description.txt should contain a user supplied description of the problem, but since it is very seldom used, it will be dropped from the future releases. .SH "PREREQUISITES" .sp ssh .RS 4 It is not strictly required, but you won\(cqt regret having a password\-less ssh. It is not too difficult to setup and will save you a lot of time. If you can\(cqt have it, for example because your security policy does not allow such a thing, or you just prefer menial work, then you will have to resort to the semi\-manual semi\-automated report generation. See below for instructions. + If you need to supply a password for your passphrase/login, then always use the \f(CR\-u\fP option. + For extra ssh(1) options, if you\(cqre too lazy to setup $HOME/.ssh/config, use the \f(CR\-X\fP option. Do not forget to put the options in quotes. .RE .sp sudo .RS 4 If the ssh user (as specified with the \f(CR\-u\fP option) is other than \f(CRroot\fP, then \f(CRhb_report\fP uses \f(CRsudo\fP to collect the information which is readable only by the \f(CRroot\fP user. In that case it is required to setup the \f(CRsudoers\fP file properly. The user (or group to which the user belongs) should have the following line: + ALL = NOPASSWD: /usr/sbin/hb_report + See the \f(CRsudoers(5)\fP man page for more details. .RE .sp Times .RS 4 In order to find files and messages in the given period and to parse the \f(CR\-f\fP and \f(CR\-t\fP options, \f(CRhb_report\fP uses perl and one of the \f(CRDate::Parse\fP or \f(CRDate::Manip\fP perl modules. Note that you need only one of these. Furthermore, on nodes which have no logs and where you don\(cqt run \f(CRhb_report\fP directly, no date parsing is necessary. In other words, if you run this on a loghost then you don\(cqt need these perl modules on the cluster nodes. + On rpm based distributions, you can find \f(CRDate::Parse\fP in \f(CRperl\-TimeDate\fP and on Debian and its derivatives in \f(CRlibtimedate\-perl\fP. .RE .sp Core dumps .RS 4 To backtrace core dumps gdb is needed and the packages with the debugging info. The debug info packages may be installed at the time the report is created. Let\(cqs hope that you will need this really seldom. .RE .SH "TIMES" .sp Specifying times can at times be a nuisance. That is why we have chosen to use one of the perl modules\(emthey do allow certain freedom when talking dates. You can either read the instructions at the \c .URL "http://search.cpan.org/dist/TimeDate/lib/Date/Parse.pm#EXAMPLE_DATES" "Date::Parse examples page" . or just rely on common sense and try stuff like: .sp .if n .RS 4 .nf .fam C 3:00 (today at 3am) 15:00 (today at 3pm) 2007/9/1 2pm (September 1st at 2pm) Tue Sep 15 20:46:27 CEST 2009 (September 15th etc) .fam .fi .if n .RE .sp \f(CRhb_report\fP will (probably) complain if it can\(cqt figure out what do you mean. .sp Try to delimit the event as close as possible in order to reduce the size of the report, but still leaving a minute or two around for good measure. .sp \f(CR\-f\fP is not optional. And don\(cqt forget to quote dates when they contain spaces. .SH "SHOULD I SEND ALL THIS TO THE REST OF INTERNET?" .sp By default, the sensitive data in CIB and PE files is not mangled by \f(CRhb_report\fP because that makes PE input files mostly useless. If you still have no other option but to send the report to a public mailing list and do not want the sensitive data to be included, use the \f(CR\-s\fP option. Without this option, \f(CRhb_report\fP will issue a warning if it finds information which should not be exposed. By default, parameters matching \fIpassw.*\fP are considered sensitive. Use the \f(CR\-p\fP option to specify additional regular expressions to match variable names which may contain information you don\(cqt want to leak. For example: .sp .if n .RS 4 .nf .fam C # hb_report \-f 18:00 \-p "user.*" \-p "secret.*" /var/tmp/report .fam .fi .if n .RE .sp Heartbeat\(cqs ha.cf is always sanitized. Logs and other files are not filtered. .SH "LOGS" .sp It may be tricky to find syslog logs. The scheme used is to log a unique message on all nodes and then look it up in the usual syslog locations. This procedure is not foolproof, in particular if the syslog files are in a non\-standard directory. We look in /var/log /var/logs /var/syslog /var/adm /var/log/ha /var/log/cluster. In case we can\(cqt find the logs, please supply their location: .sp .if n .RS 4 .nf .fam C # hb_report \-f 5pm \-l /var/log/cluster1/ha\-log \-S /tmp/report_node1 .fam .fi .if n .RE .sp If you have different log locations on different nodes, well, perhaps you\(cqd like to make them the same and make life easier for everybody. .sp Files starting with "ha\-" are preferred. In case syslog sends messages to more than one file, if one of them is named ha\-log or ha\-debug those will be favoured over syslog or messages. .sp hb_report supports also archived logs in case the period specified extends that far in the past. The archives must reside in the same directory as the current log and their names must be prefixed with the name of the current log (syslog\-1.gz or messages\-20090105.bz2). .sp If there is no separate log for the cluster, possibly unrelated messages from other programs are included. We don\(cqt filter logs, but just pick a segment for the period you specified. .SH "MANUAL REPORT COLLECTION" .sp So, your ssh doesn\(cqt work. In that case, you will have to run this procedure on all nodes. Use \f(CR\-S\fP so that \f(CRhb_report\fP doesn\(cqt bother with ssh: .sp .if n .RS 4 .nf .fam C # hb_report \-f 5:20pm \-t 5:30pm \-S /tmp/report_node1 .fam .fi .if n .RE .sp If you also have a log host which is not in the cluster, then you\(cqll have to copy the log to one of the nodes and tell us where it is: .sp .if n .RS 4 .nf .fam C # hb_report \-f 5:20pm \-t 5:30pm \-l /var/tmp/ha\-log \-S /tmp/report_node1 .fam .fi .if n .RE .SH "OPERATION" .sp hb_report collects files and other information in a fairly straightforward way. The most complex tasks are discovering the log file locations (if syslog is used which is the most common case) and coordinating the operation on multiple nodes. .sp The instance of hb_report running on the host where it was invoked is the master instance. Instances running on other nodes are slave instances. The master instance communicates with slave instances by ssh. There are multiple ssh invocations per run, so it is essential that the ssh works without password, i.e. with the public key authentication and authorized_keys. .sp The operation consists of three phases. Each phase must finish on all nodes before the next one can commence. The first phase consists of logging unique messages through syslog on all nodes. This is the shortest of all phases. .sp The second phase is the most involved. During this phase all local information is collected, which includes: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} logs (both current and archived if the start time is far in the past) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} various configuration files (corosync, heartbeat, logd) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} the CIB (both as xml and as represented by the crm shell) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} pengine inputs (if this node was the DC at any point in time over the given period) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} system information and status .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} package information and status .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} dlm lock information .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} backtraces (if there were core dumps) .RE .sp The third phase is collecting information from all nodes and analyzing it. The analyzis consists of the following tasks: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} identify files equal on all nodes which may then be moved to the top directory .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} save log messages matching user defined patterns (defaults to ERRORs and CRITical conditions) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} report if there were coredumps and by whom .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} report crm_verify(8) results .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} save log messages matching major events to events.txt .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} in case logging is configured without loghost, node logs and events files are combined using a perl utility .RE .SH "BUGS" .sp Finding logs may at times be extremely difficult, depending on how weird the syslog configuration. It would be nice to ask syslog\-ng developers to provide a way to find out the log destination based on facility and priority. .sp If you think you found a bug, please rerun with the \-v option and attach the output to bugzilla. .sp hb_report can function in a satisfactory way only if ssh works to all nodes using authorized_keys (without password). .sp There are way too many options. .SH "AUTHOR" .sp Written by Dejan Muhamedagic, \c .MTO "dejan\(atsuse.de" "" "" .SH "RESOURCES" .sp Pacemaker: \c .URL "http://clusterlabs.org/" "" "" .sp Heartbeat and other Linux HA resources: \c .URL "http://linux\-ha.org/wiki" "" "" .sp OpenAIS: \c .URL "http://www.openais.org/" "" "" .sp Corosync: \c .URL "http://www.corosync.org/" "" "" .SH "SEE ALSO" .sp Date::Parse(3) .SH "COPYING" .sp Copyright (C) 2007\-2009 Dejan Muhamedagic. Free use of this software is granted under the terms of the GNU General Public License (GPL).