18.4. The Log Collector Tool
18.4.1. Log Collector
A log collection tool is included in the Red Hat Virtualization Manager. This allows you to easily collect relevant logs from across the Red Hat Virtualization environment when requesting support.
The log collection command is
ovirt-log-collector. You are required to log in as the root user and provide the administration credentials for the Red Hat Virtualization environment. The
ovirt-log-collector -h command displays usage information, including a list of all valid options for the
18.4.2. Syntax for the ovirt-log-collector Command
The basic syntax for the log collector command is:
# ovirt-log-collector options list all|clusters|datacenters # ovirt-log-collector options collect
The two supported modes of operation are
listparameter lists either the hosts, clusters, or data centers attached to the Red Hat Virtualization Manager. You are able to filter the log collection based on the listed objects.
collectparameter performs log collection from the Red Hat Virtualization Manager. The collected logs are placed in an archive file under the /tmp/logcollector directory. The
ovirt-log-collectorcommand assigns each log a specific file name.
Unless another parameter is specified, the default action is to list the available hosts together with the data center and cluster to which they belong. You will be prompted to enter user names and passwords to retrieve certain logs.
There are numerous parameters to further refine the
- Displays the version number of the command in use and returns to prompt.
- Displays command usage information and returns to prompt.
- Sets PATH as the configuration file the tool is to use.
- Sets PATH as the directory in which logs are saved. The default directory is /tmp/logcollector.
- Sets TICKET as the ticket, or case number, to associate with the SOS report.
- Sets FTP_SERVER as the destination for retrieved logs to be sent using FTP. Do not use this option unless advised to by a Red Hat support representative.
- Sets PATH as the specific file name the command should use for the log output.
- Sets quiet mode, reducing console output to a minimum. Quiet mode is off by default.
- Sets verbose mode, providing more console output. Verbose mode is off by default.
- Displays only information about time differences between hosts, without generating a full SOS report.
Red Hat Virtualization Manager Options
These options filter the log collection and specify authentication details for the Red Hat Virtualization Manager.
These parameters can be combined for specific commands. For example,
ovirt-log-collector --user=admin@internal --cluster ClusterA,ClusterB --hosts "SalesHost"* specifies the user as
admin@internal and limits the log collection to only
SalesHost hosts in clusters
- Omits virtualization hosts from the log collection.
- Collects the logs of one host (the SPM, if there is one) from each cluster.
- Sets the user name for login. The USER is specified in the format user@domain, where user is the user name and domain is the directory services domain in use. The user must exist in directory services and be known to the Red Hat Virtualization Manager.
Sets the fully qualified domain name of the Red Hat Virtualization Manager server from which to collect logs, where FQDN is replaced by the fully qualified domain name of the Manager. It is assumed that the log collector is being run on the same local host as the Red Hat Virtualization Manager; the default value is
- Collects logs from the virtualization hosts in the nominated CLUSTER in addition to logs from the Red Hat Virtualization Manager. The cluster(s) for inclusion must be specified in a comma-separated list of cluster names or match patterns.
- Collects logs from the virtualization hosts in the nominated DATACENTER in addition to logs from the Red Hat Virtualization Manager. The data center(s) for inclusion must be specified in a comma-separated list of data center names or match patterns.
- Collects logs from the virtualization hosts in the nominated HOSTS_LIST in addition to logs from the Red Hat Virtualization Manager. The hosts for inclusion must be specified in a comma-separated list of host names, fully qualified domain names, or IP addresses. Match patterns are also valid.
- Sets PORT as the port to use for SSH connections with virtualization hosts.
- Sets KEYFILE as the public SSH key to be used for accessing the virtualization hosts.
Sets MAX_CONNECTIONS as the maximum concurrent SSH connections for logs from virtualization hosts. The default is
PostgreSQL Database Options
The database user name and database name must be specified, using the
dbname parameters, if they have been changed from the default values.
pg-dbhost parameter if the database is not on the local host. Use the optional
pg-host-key parameter to collect remote logs. The PostgreSQL SOS plugin must be installed on the database server for remote log collection to be successful.
Disables collection of database. The log collector will connect to the Red Hat Virtualization Manager PostgreSQL database and include the data in the log report unless the
--no-postgresqlparameter is specified.
- Sets USER as the user name to use for connections with the database server. The default is postgres.
- Sets DBNAME as the database name to use for connections with the database server. The default is rhevm.
- Sets DBHOST as the host name for the database server. The default is localhost.
- Sets KEYFILE as the public identity file (private key) for the database server. This value is not set by default; it is required only where the database does not exist on the local host.
18.4.3. Basic Log Collector Usage
ovirt-log-collector command is run without specifying any additional parameters, its default behavior is to collect all logs from the Red Hat Virtualization Manager and its attached hosts. It will also collect database logs unless the
--no-postgresql parameter is added. In the following example, log collector is run to collect all logs from the Red Hat Virtualization Manager and three attached hosts.
Example 18.2. Log Collector Usage
ovirt-log-collectorINFO: Gathering oVirt Engine information... INFO: Gathering PostgreSQL the oVirt Engine database and log files from localhost... Please provide REST API password for the admin@internal oVirt Engine user (CTRL+D to abort): About to collect information from 3 hypervisors. Continue? (Y/n): INFO: Gathering information from selected hypervisors... INFO: collecting information from 192.168.122.250 INFO: collecting information from 192.168.122.251 INFO: collecting information from 192.168.122.252 INFO: finished collecting information from 192.168.122.250 INFO: finished collecting information from 192.168.122.251 INFO: finished collecting information from 192.168.122.252 Creating compressed archive... INFO Log files have been collected and placed in /tmp/logcollector/sosreport-rhn-account-20110804121320-ce2a.tar.xz. The MD5 for this file is 6d741b78925998caff29020df2b2ce2a and its size is 26.7M