8.2. Linux and Unix Hosts¶
An SSH host gives Retrospective a shell session on a Linux machine, or on a best-effort basis on another Unix system such as macOS. Retrospective uses that session to search and monitor the log files stored there, and the built-in SSH Console connects to it. Everything on this page applies to SSH hosts only — for Windows Event Logs see Windows Hosts.
8.2.1. Connection Endpoint (Standard)¶
Enter the computer name or IP address in Host and the port number in Port, from 1 to 65535. The default port for SSH is 22. An empty or invalid entry is flagged on the field, for example Host not defined, Port not defined or Port must be between 1 and 65535, and Test and Save stay unavailable.
Retrospective generates the description automatically from the entered data,
in the format user@host:port. Once you type a description of your own, it
is no longer updated. When you save a host whose generated description no
longer matches its data, the Outdated Description dialog asks
whether to adopt the proposed new description.
Next to the description, a short text says how many profiles use the host and how many data sources it holds. When profiles use it, click the link in this text. A dialog titled with the host’s description lists them under Profiles and sources assigned to this host. Right-click a profile there and choose Go to profile to open it.
8.2.2. Authentication (Standard)¶
Under Method, choose Password or SSH key. Then enter the Username and the credentials. Retrospective uses them when it establishes new SSH connections to the selected host.
Whatever you enter here is stored encrypted and is never shown back to you. A
field that already holds a password shows a row of dots you cannot type into.
Leave it alone to keep the saved password. To enter a new one, press
Replace the saved value at the right end of the field. To
change your mind, press
Keep the saved value. With the
field focused, you can press Space instead of clicking the pencil. See
Security for what the encryption protects and what it does not.
A padlock beside the field marks a saved value; point at it for an explanation. To remove a saved password, press the pencil and save with the field still empty. While saving would do that, the padlock turns into a warning triangle that says so. Such a save is not connectivity-checked, because there is nothing left to connect with. The same works for the Keyphrase of a key. A host that logs in by password stays flagged in the host tree until you enter a new password.
8.2.2.1. SSH Keys¶
The SSH key file field says where the key lives:
The field shows |
Meaning |
|---|---|
a name, |
The key itself is held by Retrospective, encrypted like a password. The file it came from is no longer read, and you can move or delete it. |
a file path |
Only the location is stored. The key is read from that file each time a connection is opened. The file has to stay where it is, and it stays readable to anything running under your account. |
Choose a key with
SSH key file at the right end of
the field. Retrospective reads the chosen key into its own store. A host in
the second state therefore moves to the first the next time you pick its key.
Retrospective never converts one on its own, because that would silently
change how you rotate keys.
If the key is protected by a passphrase, type it in Keyphrase before you pick the file. Otherwise the file is refused with This key is protected by a keyphrase — type the keyphrase first, then choose the file again. Any other refusal opens a dialog titled SSH key file that names the reason.
After a save that read a key in, the Original key file dialog offers to delete the file the key came from. Keep the file is the default; Delete the file removes it. The offer is skipped while another host still uses that file.
Note
Replacing a key file on disk does not change a host whose key is held in Retrospective; it keeps using the copy it read. Pick the key file again to take over the new one.
8.2.3. Host Key¶
Authentication proves who you are to the host. The host key proves which machine answered, and Retrospective checks it on every connection.
Press Test to see where a host stands. The report ends with a line about the host key: the fingerprint stored for the host, or Host key … is not trusted yet. An unknown host raises the question about its fingerprint here. That is how you trust a host in advance, before a search needs it.
Remove stored key appears after Save once Retrospective has stored a key of its own, or once you answered Trust once in this session. It removes the key at once, without asking. The next connection then asks about the host again. Use it after a host was genuinely reinstalled, which Retrospective cannot tell apart from an interception on its own. A Trust once was never written down, and is forgotten anyway when you close Retrospective.
The button stays hidden for a host trusted because your own
~/.ssh/known_hosts or ~/.ssh/known_hosts2 lists it. That file belongs
to you, and Retrospective only reads it. Remove the line there, or switch off
Trust hosts from the SSH known_hosts file on the
Security preferences page. An edit to that file
counts from the next connection.
Server Identity describes the question, the fingerprints it shows, and the file the answer is kept in.
8.2.4. Customization (Standard)¶
8.2.4.1. Time Zone Fallback¶
When Retrospective collects log entries, it automatically converts their timestamps to the local time. It uses the time zone information found in the log entry timestamps. This lets you correlate log entries retrieved from servers lying in different time zones. In many cases, however, applications write log entries without time zone information. Time zone fallback decides how Retrospective treats them.
For more information, see the Log Time Synchronization chapter.
8.2.4.2. Adjust Time Offset¶
If you select the Adjust time offset checkbox, Retrospective automatically adjusts log entry dates coming from the remote host and the time search criteria passed to it. The goal of the adjustment is to make the remote host time match the time on the local computer.
For more information, see the Log Time Synchronization chapter.
8.2.4.3. Terminal Encoding¶
Terminal encoding defines the encoding used by the built-in SSH Console to:
translate characters from the SSH Console into bytes sent to the remote terminal;
translate bytes sent by the remote terminal into characters in the SSH Console.
Select one of the proposals from the drop-down list. The list is fixed and you
cannot type an encoding of your own. With the default value best-guess,
Retrospective detects the remote terminal encoding automatically and then uses
it in the SSH Console. Retrospective detects the remote terminal encoding by
reading the LC_ALL, LANG, LC_CTYPE and LC_MESSAGES environment
variables on the remote host.
Warning
For the SSH Console to work correctly, the selected encoding has to be
valid on your local Java Virtual Machine. It also has to match the
remote terminal encoding set in the environment variables named above.
Take care when you change the encoding from the default best-guess. In
most typical situations the best-guess setting is sufficient and does
not need to be changed.
8.2.5. Connection Options (Advanced)¶
8.2.5.1. Maximum Connections¶
Pick a value from 1 to 15 in Maximum Connections; the default is 15. It sets how many SSH connections this host configuration may open at the same time. Use it to search or monitor log files while limiting the resources, including CPU, that Retrospective consumes on the target host. The CPU limit is most effective if the host is a strong multicore machine.
Assume that one connection consumes at most about 120% of a single core capacity during an intensive search operation. Therefore, if you have 8 cores, limit the connection number to 5. Retrospective then never consumes approximately more than 5 × 120% = 600% of a single core, that is, no more than 6 out of the 8 available cores. However, the fewer simultaneous connections, the worse the performance Retrospective can offer. If you are concerned about Retrospective taking CPU from other host processes, consider the execution priority modification (see Execution Priority). It lets you prevent that in a less radical manner, without limiting the number of simultaneous connections.
Retrospective does not open all the connections allowed by this option as soon as it starts interacting with the host. Instead, it increases the number of connections based on the amount of work it has to do and on the host behavior. The current number of connections is influenced by a dynamic connection limit. This limit is always less than or equal to the maximum connection limit. If no exceptions occur while opening new connections, Retrospective gradually increases the dynamic connection limit, which allows new connections to be opened. If problems with connection opening start to appear, Retrospective decreases the dynamic connection limit. These rules describe the dynamic connection limit behavior in more detail:
at the beginning the limit equals 2;
Retrospective considers increasing the limit only when it needs to open at least one connection more than the limit. For example, the limit is 2 and you have just started to search data sources covering 3 different files;
the limit is increased by one when a connection to a given host was successfully opened at least 10 times in a row;
the limit can be temporarily increased to prevent starvation of some activity, even if not enough subsequent connections were successfully opened (starvation is explained below). In such a case the limit is decreased as soon as any connection is released;
the limit is decreased by 3 (or even more) when there is an error during a connection’s opening;
the limit is never increased above the maximum host connections and always at least one connection is allowed (the limit is always greater than or equal to 1).
Changing the value has no immediate effect on the connections that might already be open for this host configuration, because you may already be running a search on this host. After you save the host definition, the new limit applies to new connections; connections that are already open are reused until they expire. Retrospective closes a connection to a given host if it is not used for some assumed period. Currently this period is 5 minutes and cannot be changed in preferences. Some connections needed for host compatibility checking (see Host Compatibility Information) are closed even sooner.
The lower the maximum connection number, the higher the probability of encountering a starvation situation. A starvation situation happens when all connections to a given host are consumed. For example, suppose maximum connections is set to 1 and you start a long-term search on a big file. Any other activities such as searching or monitoring then wait idly until the search causing the starvation finishes. Retrospective warns you periodically about starving activities. You can define the interval in seconds for these warnings on the Search/Monitor preferences page. These warnings appear only when the dynamic connection limit reaches the maximum connections specified in the Host Manager.
Even when starvation happens, you can still perform light short-term activities such as host compatibility checking (see Host Compatibility Information), file browsing (see File Browser) and adding, configuring or running Autofind on a data source. This is possible because Retrospective allows opening just ONE more connection beyond the limit of the maximum host connections option. When you check the currently opened connections on an SSH host, expect at most one more connection than the number specified in the Host Manager. Since this is only ONE additional connection, during starvation you cannot run Autofind and, for example, file browsing at the same time. File browsing has to wait until Autofind finishes. This ONE additional connection is never used for searching or monitoring, so it expires after the light activities are finished. Searching also acquires connections more aggressively than monitoring. Therefore, when searching competes with monitoring for a restricted number of connections, assume that searching always wins and monitoring starves.
Note
The maximum host connection configuration is independent of the jump server configuration (see Jump Server). The restriction is related only to the target host and not to the jump server present in the connection chain for this host.
Note
The maximum connections setting applies only to the host configuration that you are currently editing. Suppose you have another host configuration for the same host name that differs in some other setting, for example different credentials. The two configurations are then independent in terms of connection pooling: each configuration has its own connection pool.
8.2.5.2. Jump Server¶
A jump server or jump host is a special-purpose computer on a network, typically used to manage devices in a separate security zone. If your environment requires a connection through a jump server to the target host to search or monitor log files, Retrospective lets you define a jump server for a host. You can even chain more than two hosts together: you can access your target host through more than one jump server.
Jump servers are also available for Windows hosts that use the SSH transport.
To define a jump server, switch to the host editor’s Advanced tab. Then select a host in the Jump server drop-down of the Connection Options group. Without a jump server, the host is accessed directly, and the drop-down shows Direct Access.
The list offers the SSH hosts you have defined in the Host Manager. It leaves out the host you are currently editing, and any host that would turn the connection chain into a loop. Windows hosts are never candidates. Once you select a jump server, the Connection chain appears directly below the Jump server drop-down. It shows the route that Retrospective takes to your host.
In the Connection chain, a green arrow on the icon
marks every hop after the first. In the host tree on the left,
it marks a host reached through a jump server.
Fig. 8.5 Jump server configuration.¶
The Jump server drop-down in the Connection Options section.
The Connection chain showing the route to the target host.
The green-arrow host icon
marking a host reached through a
jump server.
Note
Retrospective does not let you create jump server loops: the drop-down never offers a host that would close one. A loop that comes from elsewhere, such as an imported configuration, marks the host in the host tree with an error that reads Jump host loop.
Note
If a host is configured to be accessed through a jump server, then its IP address is evaluated by the jump server. Therefore, if you specify the IP of a host in a local network, for example 192.168.x.y, Retrospective accesses the host in the local network that is accessible for the jump server. It does not access the host in the local network accessible for the host running Retrospective.
8.2.5.3. Proxy Server¶
A proxy server, also known as a “proxy”, is a computer that acts as a gateway. It sits between a local network, for example all the computers at one company or in one building, and a larger-scale network such as the internet. Proxy servers provide increased security as they help prevent an attacker from invading a private network. If your target host has to be accessed through a proxy server to search or monitor log files, Retrospective lets you define an HTTP or SOCKS proxy server for individual hosts. You can even chain a proxy server with a jump host: you can access your target host through a proxy server and a jump host.
Proxy servers are also available for Windows hosts that use the SSH transport.
To define a proxy server for a particular host, switch to the host editor’s Advanced tab. In the Proxy row of the Connection Options group, click Define Proxy. The Define Proxy dialog asks for:
Type: HTTP (the default, port 80), SOCKS 4 or SOCKS 5 (port 1080). Changing the type resets the port.
Host Name and Port.
Requires password, with Username and Password, when the proxy needs a login.
While an entry is missing or invalid, OK is unavailable and the banner names the problem: Proxy hostname cannot be left blank, Port must be between 1 and 65535 or Username and password cannot be left blank.
Fig. 8.6 The Define Proxy dialog.¶
Once a proxy is defined, the Proxy row shows it in the form
HTTP proxy [user@]host:port.
Edit proxy
definition reopens the dialog.
Delete proxy
removes the proxy without asking; the change takes effect when you save the
host. The Connection chain lists the proxy as one of the devices
that Retrospective passes to reach the target host.
Fig. 8.7 Proxy server configuration.¶
8.2.6. Target Command Modification (Advanced)¶
Retrospective lets you operate on remote hosts by executing shell commands through SSH. The Target command modification section provides the following options to modify the executed commands:
Changing the user identity when executing shell commands on the host, see Identity Change.
Decreasing the execution priority / CPU time consumption of executed shell commands on the host, see Execution Priority.
Note
These configuration options require certain tools to be available (for
example the nice tool) or certain configurations on the target host.
Always use the Test button to verify that your host
configuration matches the setup of your target host. As an alternative,
select the Check connectivity checkbox when you save a host
configuration with target command modification settings.
8.2.6.1. Identity Change¶
The Authentication group of the Standard tab configures one user. The log files that you want to search or monitor may require the security privileges of a different user, normally the superuser root. In that case, Retrospective can change your identity on the host. It then executes all shell commands on behalf of the configured target user. The Identity change drop-down offers none, the default, and two approaches:
sudo: Retrospective usessudoto execute shell scripts as the target user.sudo su: Retrospective usessudoto become superuser and then usessuto execute all shell scripts as the target user.
The configuration you create in Retrospective should correspond to the
configuration in the /etc/sudoers file on the target host. The
/etc/sudoers file offers many configuration options, for example not
requiring a password for certain commands, requiring a password for users or
groups, and so on. A detailed description of /etc/sudoers syntax and
configuration options is out of the scope of this manual. The configuration
elements required by Retrospective are described further below.
To change your identity on a host, proceed as follows:
Select an approach in the Identity change drop-down of the Target command modification group on the Advanced tab. Selecting an approach shows the options of an identity change.
Enter the Target user. Leave it empty to use root. A name that cannot be a user name is flagged, and Test and Save stay unavailable until you correct it.
Select Requires password if, and only if, the user from the Authentication group needs a password to execute
sudo(as defined in/etc/sudoers).Retrospective then provides a password when it executes
sudo. Which password depends on the Method in the Authentication group. The information bullet beside the Password field explains it for the current settings.With Password, Retrospective reuses the login password of that user, so the Password field of the identity change stays unavailable. Retrospective stores no sudo password for the host.
With SSH key, you must enter the password of that user yourself. The field is required: while it is empty, it is flagged Password not defined, and Test and Save stay unavailable. A saved sudo password is kept like any other saved credential (see Authentication (Standard)); to drop it, clear Requires password or switch the login to Password.
If you mark the Initial login checkbox, the shell environment is replaced with the shell environment of the target user. For example, the shell then reads login-specific resource files such as
.profileor.login.The read-only Target command shows the resulting shell command, with
<COMMAND>standing for each command Retrospective runs.
Fig. 8.8 Identity change configuration.¶
Note
Identity change settings have no effect if configured for a host that is used only as a jump server.
The basic syntax of the /etc/sudoers file is four space-separated fields.
The file can also be placed in another directory than /etc. In the example
below the f1–f4 labels line up directly above the field each one
names:
f1 f2 f3 f4
user ALL=(ALL) ALL
A group may be used in field f1 instead of a user by prefixing it with
@ (for example @group ALL=(ALL) ALL).
The meaning of each field is as follows:
f1— user (or a group) that is allowed to usesudo. This field has to contain the user from the Authentication group (or a group to which this user belongs).f2— list of hostnames. It is rarely used and is not that relevant for Retrospective. For an explanation see the sudoers manual.f3— list of target users. The user (or a group) from fieldf1is allowed to change identity to these users. Depending on the selected approach for the user identity change, this field has to contain the following:sudo: the Target user (or
ALLthat matches all users);sudo su:
rootorALLthat matches all users.
f4— list of commands that can be executed by the user (or a group) from fieldf1after changing identity. Depending on the selected identity change approach, this field has to contain the following:sudo:
ALLthat matches all possible commands (Retrospective executes many typical *NIX commands on the target host and defining all of them cannot be easily done);sudo su: assume that the
sutool is placed in/bin/suand thatTARGET_USERis the Target user. The field then has to contain the following, depending on Initial login:Initial login not selected:
/bin/su TARGET_USER *(for the target user root,/bin/su *);Initial login selected:
/bin/su - TARGET_USER *(for the target user root,/bin/su - *).
Note
When Requires password is not selected, prepend the content of
the f4 field with the NOPASSWD: token.
The examples below show the /etc/sudoers configuration that Retrospective
requires. In these examples, retrouser is the username entered in the
Authentication group.
Example 1 — Identity change sudo, Target user root, Requires password yes, Initial login either:
retrouser ALL=(ALL) ALL
Example 2 — Identity change sudo su, Target user root, Requires password yes, Initial login yes:
retrouser ALL=(ALL) /bin/su - *
Example 3 — Identity change sudo, Target user jboss, Requires password yes, Initial login either:
retrouser ALL=(jboss) ALL
Example 4 — Identity change sudo su, Target user jboss, Requires password yes, Initial login yes:
retrouser ALL=(ALL) /bin/su - jboss *
Example 5 — Identity change sudo, Target user jboss, Requires password no, Initial login either:
retrouser ALL=(jboss) NOPASSWD:ALL
Example 6 — Identity change sudo su, Target user jboss, Requires password no, Initial login yes:
retrouser ALL=(ALL) NOPASSWD:/bin/su - jboss *
Example 7 — Identity change sudo su, Target user root, Requires password no, Initial login yes:
retrouser ALL=(ALL) NOPASSWD:/bin/su - *
Note
In all the examples above, retrouser present in field f1 can be
replaced with a group to which retrouser belongs. Typically all users
that are allowed to execute sudo are added to a sudo group.
8.2.6.2. Execution Priority¶
The execution priority configuration lets you lower the priority / CPU time consumption of all operations that Retrospective performs on a particular host. This is useful when you run a search on a production environment where intensive usage of CPU could introduce an unwanted impact. For example, an application running in the environment slows down.
Move the Execution priority slider in the Target command modification group of the Advanced tab to the right, from Standard towards Low. A green dot marks the end the current value is at. This decreases the priority of all Retrospective operations on this host.
Retrospective translates the execution priority setting into a POSITIVE
nice value used for all shell commands it executes on this host.
nice is a *NIX tool used to modify the scheduling priority of a
particular process. Retrospective only lets you configure an execution
priority that results in more “niceness”. You can therefore only LOWER the
scheduling priority of Retrospective operations on a host. Lowering the
scheduling priority means increasing the “niceness”, which is also referred to
as “nice level”.
To modify the execution priority, the nice tool has to be present on the
target host. When it is missing, the compatibility report shows a warning that
every command runs at Standard priority (see
Host Compatibility Information). If you have moved the slider away from
Standard, the operation fails instead: Test, searching and
monitoring all report that nice is not available. Install nice on the
host, or move the slider maximally to the left. The nice tool is then not
used at all and disappears entirely from the Target command text
box.
Fig. 8.9 Execution priority configuration.¶
8.2.7. Host Compatibility Information¶
You can check the SSH connection to a remote server in two ways: press the Test button, or press the Save button while the Check connectivity checkbox is selected. When the SSH connection can be established, Retrospective performs some compatibility checks on the remote server. The report appears in the Host compatibility information table below the Test and Save buttons. Errors are listed first, then warnings, then information. Right-click a row and choose Copy message to copy its text.
Retrospective operates on remote servers with the use of several standard tools available on *NIX systems. Information about host compatibility is related to the availability of these tools and their functionality. The report is therefore produced for SSH hosts only; a Windows host is verified differently, as described in Windows Hosts.
Why does Retrospective check the host compatibility?
Retrospective checks that the set of available tools is sufficient for using Retrospective on the host. It also notifies the user about any minor (warnings) or major (errors) issues related to the tool set.
What exactly is checked and what is reported?
Checking the host compatibility covers the following tests:
identification of the operating system. Retrospective recognizes Linux, macOS, FreeBSD, Solaris, AIX, HP-UX and Cygwin, and warns when the host reports none of these. Recognizing a system does not mean it is supported; see supported host systems;
identification of the locale and encoding (performed by analyzing the
LC_ALL,LANG,LC_CTYPE,LC_MESSAGESenvironment variables in exactly this order);identification of the effective username, the effective user groups and the home directory;
the amount of memory, which limits each command, and whether the host restarts when its memory runs out;
availability of essential tools needed for basic scripting:
command,echo,printf,grep,awk,uname,diff,cksum;availability and functionality of tools needed for searching:
grep,fgrep,awk,sed;availability and functionality of tools needed for monitoring:
dd,head,tail;availability and functionality of
ps, which reports the processes Retrospective started on the host;availability and functionality of
date, which reports the current time on the host;availability and functionality of tools needed for uncompressing:
tar,gzip,unzip,bzip2;availability and functionality of tools needed for target command modification (see Target Command Modification (Advanced)):
sudo,su,sftp-server,nice(also identification of the effective nice level);whether the SSH server offers an SFTP subsystem. Without it, the File Browser lists directories through the shell.
Note
When the LC_ALL, LANG, LC_CTYPE and LC_MESSAGES environment
variables are not set or cannot be parsed, then en_US is assumed as the
default locale and UTF-8 as the default encoding.
The report contains these kinds of messages:
information about the detected operating system, locale and encoding;
information, one for each available tool, which contains: tool name, path (sometimes arguments), flavor (typically GNU or OTHER) and version;
a warning that a tool is emulated, which means Retrospective stands in for it with another one. For
cksumandpsnothing is lost. Whereawkstands in forhead, reading the start of a file is slower;a warning that a tool is usable but limited, so one capability is reduced or unavailable on this host;
a warning that the host restarts when its memory runs out;
an error, which means Retrospective cannot search or monitor this host;
information about the host key, naming either the fingerprint stored for the host or the fact that the host is not trusted yet (see Host Key).
What should you do when the report shows a warning?
A warning names a capability that is reduced or unavailable on this host. It is not a task list. Read the row, decide whether that capability matters for the logs you read on this host, and keep the answer with the host definition. The table groups the warnings by what they cost you, because one tool can appear in more than one group.
The report warns about |
What still works |
What you lose |
|---|---|---|
|
everything |
search speed on large files |
no GNU |
everything |
speed when reading the start of a file |
|
search results stay complete |
the exact position of a match in the file, used by the File Scroller and by context diving |
|
every other file |
that one archive format cannot be read |
|
plain |
|
no GNU |
every archive |
speed when reading archived logs |
|
search |
long or non-ASCII log entry delimiters, and long date formats, are rejected |
|
logs the login account can read |
Identity Change, so logs owned by another user stay out of reach |
|
everything, also through sudo |
nothing: with sudo, the File Browser lists directories through the shell |
|
everything |
Execution Priority, so every command runs at Standard |
|
everything |
the check that Retrospective commands run at the configured priority |
|
Adjust time offset |
the clock difference is measured to about a second |
|
everything |
some tools are detected less precisely, and generic Unix behavior is used |
the host restarts when its memory runs out |
everything |
headroom, so avoid searching many or large files at the same time |
a tool is emulated |
everything |
nothing, where the emulated tool is |
Installing the named tool removes the warning, on a host you administer. Where you do not, see Hosts You Cannot Change.
What should you do when the report shows an error?
An error is a different statement. It names something Retrospective cannot work around. The host is then refused: a save with Check connectivity selected does not persist it, and searching and monitoring report the same error. Install the named tool on the host, or read the logs from a machine that has it.