Monitor Linux hosts using RSH and ActiveXperts

Linux RSH
    Figure 1: ActiveXperts Network Monitor RSH check>


ActiveXperts solution to monitor Linux hosts

RSH is a client process that opens connections to rsh daemons, sends a command to be executed on the remote server and retrieves its output, both stdout and stderr. The connection is established on standard port 514 (tcp port for the shell/cmd protocol). ActiveXperts Network Monitor requires the output (i.e. StdOut) to be formatted according to the following syntax:

[ SUCCESS | ERROR | UNCERTAIN]: { <explanation> } { DATA:<value>}

The <explanation> will be shown in the 'Last Response' column in the Manager application. The <value> field will be shown in the 'Data' column in the Manager application. Samples:

ERROR: Free Disk space is less than 40 GB DATA:34
SUCCESS: Daemon 'LPD' is running

To allow clients (incl. ActiveXperts Network Monitor) to run a shell script on LINUX/UNIX machine using RSH, the following pre-conditions must be met:

  • The remote UNIX/LINUX machine must have the RSH daemon running;
  • The client must have an entry in the host.allowed configuration file.

An RSH Shell Script check requires the following parameters:

  • Remote Host - Host name or IP address of the remote LINUX/UNIX host;
  • Port - TCP port used for RSH on the remote host. Default port is 22;
  • RSH Command - Specifies the command to run on the remote host;
  • Script Timeout - Specifies the maximum number of milliseconds to wait for completion of the script; if the script takes longer, it will be terminated. Default value: 5000 milliseconds;
  • Account - Account used to authenticate to the remote host;
  • Password - Password used to authenticate to the remote host. If you use a Private Key File to authenticate, you can leave the 'Password' field blank;
  • Private Key File - Private Key File used to authenticate to the remote host. If you use a Password file to authenticate, you can leave the 'Private Key File' field blank;
  • If StdErr is not empty, the result will be - If there's an error in the script, you can handle this error and specify what the result of the check should be: Uncertain, Error or Success.

About RSH

The RSH client runs commands on remote computers running the RSH service or daemon. Usually, UNIX and LINUX platforms have the RSH daemon installed and running; Windows XP and Windows 2000 do not provide a RSH service. A RSH service called Rshsvc.exe is provided with the Windows 2000 Server Resource Kit.

The RSH command copies standard input to the remote Command, standard output of the remote Command to its standard output, and the standard error of the remote Command to its standard error. Rsh normally quits when the remote command quits. The .rhosts file typically permits network access on UNIX/LINUX systems. The .rhosts file lists computer names and associated logon names that have access to remote computers. When you run rcp, rexec, or rsh commands remotely with a correctly configured .rhosts file, you do not need to provide logon and password information for the remote computer.

The .rhosts file is a text file in which each line is an entry. An entry consists of the local computer name, the local user name, and any comments about the entry. Each entry is separated by a tab or space, and comments begin with a pound sign (#). For example:

host7 #This computer is in room 31A

The .rhosts file must be in the user's home directory on the remote computer. For more information about the specific implementation of the .rhosts file on a remote computer, see the remote system documentation.