4.45 RemoteProcessDown

Use this Knowledge Script to monitor processes on a remote UNIX computer where you have not installed the UNIX agent. This Knowledge Script runs on a proxy UNIX agent and monitors processes on a remote UNIX computer.

When you drag this Knowledge Script to a UNIX computer in the TreeView, the Knowledge Script runs on that computer and tries to communicate with a specified list of remote UNIX computers. This Knowledge Script raises an event if any of the named processes are down or any of the computers you specify cannot be reached from the computer where this Knowledge Script is running.

If a monitored process is found to be down, this Knowledge Script can restart it using a script or command you supply. Be sure to read the help for the Scripts or commands to restart processes parameter, below, before proceeding.

This Knowledge Script requires the UNIX agent to run as the root user account.

4.45.1 Resource Object

UNIX computer icon (not supported on HP-UX Itanium).

4.45.2 Default Schedule

The default interval for this script is Every 10 minutes.

If the script used to restart any process found to be down takes a considerable amount of time, events generated by the job are generated more than 10 minutes apart (by default).

4.45.3 Setting Parameter Values

Set the following parameters as needed:

Description

How to Set It

Event Notification

Raise event if process is down?

Select Yes to raise an event if the monitored process is found to be down. The default is Yes.

Event severity when process is down

Set the event severity level, from 1 to 40, to indicate the importance of the event. The default is 10.

Raise event if process is running?

Select Yes to raise an event if the monitored process is found to be running. The default is unselected.

Event severity when process is running

Set the event severity level, from 1 to 40, to indicate the importance of the event. The default is 25.

Remote Host Connection

Configure access to the remote managed computers by specifying their root password. All of the remote computers must use the same root password. This Knowledge Script can use SSH with root password authentication or Telnet to communicate with the remote managed computer.

Password for root user account

If you want to use Secure Shell (SSH) for the connection to the remote computers, make sure SSH with root authentication is enabled on the remote UNIX computers where you want to install the UNIX agent.

For this parameter, you must specify the password for the root user to securely access the remote UNIX computers. This Knowledge Script does not support SSH root authentication with an RSA key.

Connection Transport

Select either SSH/SFTP or Telnet/FTP. The default is Telnet/FTP,

This Knowledge Script can use SSH with root password authentication or Telnet to communicate with the remote managed computer.

If you select the Telnet/FTP option the Telnet prompt on the remote computer must end with a space or one of the following characters:% > # $

This example shows a supported Telnet prompt:

user@hostname>

This example shows an unsupported Telnet prompt:

<user@hostname:/tmp - 2005-Mar-09>
->

In the examples above, the last character in the first line of the 2-line prompt is a line feed character, which is not supported.

Telnet non-root user account

If you selected Telnet to connect to the remote UNIX computers, specify a non-root user account to use for the connection. When connecting to a remote UNIX computer using Telnet and FTP, this Knowledge Script switches from the non-root user to the root user.

Telnet non-root user password

If you selected Telnet as the connection transport medium, specify the password for the non-root user account to connect to the remote UNIX computers.

Proxy Monitoring Configuration

Full path to configuration file for remote monitoring

Supply a full directory path to an XML file to use for monitoring instructions.

The configuration file should specify which processes to monitor on the remote UNIX computer and how to restart them. See Section 4.45.5, Remote Process Monitoring Using a Configuration File for more information about the configuration file.

The default is /tmp/config.xml.

Proxy Monitoring without Configuration File

Hostnames or IP addresses where processes are to be monitored (comma-separated)

Enter a list of hostnames or IP addresses of the UNIX computers where processes are to be monitored.

Separate multiple hostnames with commas (,) and no spaces.

Supply IP addresses in dotted notation, such as 23.45.678.9. Separate multiple IP addresses with commas and no spaces.

Names of processes to monitor (comma-separated)

Supply the names of the UNIX application processes to monitor. Separate multiple process names with commas and no spaces.

You can also enter a Perl regular expression here if you want to exclude and include processes on various platforms through the use of one argument. See Section 4.45.4, Running this Knowledge Script for more information.

Scripts or commands to restart processes (comma-separated)

Supply one of the following:

  • a list of full directory paths to script files to use to restart any processes that are found to be down, or

  • a list of commands to use to restart these processes.

Use this parameter only when you restart the process when it is down.

Specify a list of restart commands or shell scripts that contain the restart commands. Do not execute restart commands in the foreground. When executing a restart command in the foreground, this Knowledge Script cannot run at its next scheduled interval until after all of the restart commands have completed. When specifying:

  • A list of commands to run on the remote computer, run each command in the background by appending an ampersand (&) and separate each command with a comma. If this Knowledge Script is configured to use Telnet/FTP, you can restart a process in the background by appending an ampersand (&) to each command. If this Knowledge Script is configured to use SSH/SFTP, you should use a shell script on the remote computer to restart the processes in the background and ensure that stdout and stderr are redirected to a log file. When configured to use SSH/SFTP, this Knowledge Script always executes a command to restart a process in the foreground.

  • A shell script on the remote computer that restarts the processes you want, in the shell script, append an ampersand (&) to each restart command--and ensure that stdout and stderr are redirected to a log file--to restart a process in the background.

Restart process if down? (y/n for each process, comma-separated)

Provide a list specifying “y” or “n” for each process in the list of processes to monitor. Specify y for a process if you want this Knowledge Script to restart it on the remote computer if it is found to be down. The commands or scripts you specified for the previous parameter are used. Separate each entry in the list with a comma. Do not use spaces.

Enable debugging? (y/n)

Set to y to enable debugging. The default is n.

4.45.4 Running this Knowledge Script

This Knowledge Script requires the proxy UNIX agent to run as the root user account.

It can use either the Secure Shell (SSH) program with root password authentication or Telnet to make a secure connection to the remote UNIX computer(s). By default, Telnet is used, but you can select SSH/SFTP from the Connection Transport list to use Secure Shell instead. If you choose to use Telnet, you must supply a non-root user account name and password.

NOTE:Proxy monitoring with this Knowledge Script is possible only if the SSH program is installed on the target computer, or if the Telnet protocol is enabled on it.

A version of this Knowledge Script that runs on a Windows proxy computer to monitor remote UNIX computers is also available. See the NT_UnixRemoteProcessDown Knowledge Script.

You can use this Knowledge Script to monitor the up and down status of the UNIX agent. To do this, specify nqmagt in the list of processes you want to monitor. If the nqmagt process is detected down, you can specify a restart command, /etc/init.d/nqmdaemon start, to restart the agent.

You can specify the process names to be monitored as a parameter, or you can provide a configuration file in XML format to specify processes to monitor and what steps to take to restart them if they are down. See Section 4.45.5, Remote Process Monitoring Using a Configuration File for more information about the configuration file.

You can also supply a Perl regular expression for the Names of processes to monitor (comma-separated) parameter if you want to check for a specific string. For example, you can exclude and include processes on various platforms through the use of one argument. For example, assume that a process is running out of the /usr, the /opt, or the /var directory, but you are not sure where. You can enter (/usr|/opt)/[processname] for the Names of processes to monitor parameter. The Knowledge Script would monitor the process that is running in /usr OR in /opt but NOT in /var. The topic titled Section 4.1, Creating Filters with Regular Expressions contains more information about regular expressions.

4.45.5 Remote Process Monitoring Using a Configuration File

The RemoteProcessDown Knowledge Script includes an option to use a configuration file in XML format to supply monitoring instructions to the agent. In such a file, you can supply a list of processes to monitor on a given remote UNIX computer, specify how to restart these processes, and indicate whether to restart these processes.

By default, the Knowledge Script looks for the following configuration file:

/tmp/config.xml

However, you can supply a different file as the value for the Full path to configuration file for remote monitoring parameter.

Following is an example of a valid XML configuration file that instructs the UNIX agent which processes to monitor and what to do if they are not running:

<?xml version="1.0" encoding="utf-8" ?> 
<SERVERS>
  <SERVER name="uws3">
    <PROCESS name="nqmagt" startupscript="/etc/init.d/nqmdaemon start" restart="y"/>
    <PROCESS name="xntpd"  startupscript="/etc/init.d/xntpd start" restart="n"/>
  </SERVER>
  <SERVER name="uws19">
    <PROCESS name="inetd"  startupscript="/etc/init.d/inetsvc start" restart="n"/>
    <PROCESS name="init"  startupscript="/etc/init.d/init start" restart="n"/>
  </SERVER>
</SERVERS>