4.66 UnixRemoteProcessDown

Use this Knowledge Script to monitor applications on remote UNIX computers where you cannot easily install a UNIX agent. This script uses a proxy UNIX agent, installed on another computer, to monitor processes on the remote UNIX computer.

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

You can specify the process names to be monitored in the Processes to monitor 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. For more information, see Remote Process Monitoring Using a Configuration File.

4.66.1 Resource Object

UNIX Machine folder

4.66.2 Default Schedule

The default interval for this script is Every 20 seconds.

4.66.3 Setting Parameter Values

Set the following parameters as needed:

Description

How to Set It

Event Notification

Raise event if process down?

Select Yes to raise an event if a monitored process is 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 an event in which a process is down. The default is 10.

Raise event if process is running?

Select Yes to raise an event if a monitored process is 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 an event in which a monitored process is running. 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 script can use SSH with root password authentication or Telnet to communicate with the remote managed computer.

Password for root user account

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

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

Connection Transport

This script can use SSH with root password authentication or Telnet to communicate with the remote managed computers.

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

The following is an example of a supported Telnet prompt:

user@hostname>

Here is an example of an unsupported Telnet prompt:

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

In the example above, the last character in the first line of the two-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 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.

Monitoring Source Configuration

Full path to configuration file for remote monitoring

Supply a full directory path to an XML file to use for communications with the remote UNIX computer. The default is c:\temp\config.xml

Manual Configuration

Hostnames or IP addresses where processes are to be monitored

Supply 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.

Processes to monitor

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 using one argument. See Running this Knowledge Script for more information.

Scripts or commands to restart processes

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.

There is no need to supply a value for this parameter if you specify “n” for the Restart process if down? parameter.

If you configure this script to restart a process, 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 script cannot run at its next scheduled interval until after all the restart commands have completed. When specifying:

  • A list of commands to run on the remote computer, run each command in the background by adding an ampersand (&) and separating each command with a comma. If this script is configured to use Telnet/FTP, you can restart a process in the background by adding an ampersand (&) to each command. If this script is configured to use SSH/SFTP, 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 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, add 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?

Provide a list specifying “y” or “n” for each process in the Processes to monitor parameter. Specify y for a process if you want this 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 will be used. Separate the list of Ys and Ns with commas and no spaces.

4.66.4 Running this Knowledge Script

The UnixRemoteProcessDown script requires the proxy UNIX agent to run as the root user account. To enable this script, you must run the AppManager installation program (the AMxx_UNIX_setup.exe file) on the proxy computer. An extra “helper” file will be installed: UnixRemoteProcessDown.exe.

To use this script to monitor the up and down status of the UNIX agent, specify nqmagt in the list of processes to monitor. If the nqmagt process is down, you can specify a restart command to restart the agent:

/etc/init.d/nqmdaemon start 

This script can use either the Secure Shell (SSH) program with root password authentication or Telnet to make a secure connection to the remote UNIX computer. By default, Telnet is used, but you can select SSH/SFTP from the Connection Transport parameter 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 script is possible only if the SSH program is installed on the target computer, or if the Telnet protocol is enabled on it.

You can also supply a Perl regular expression for the Names of processes to monitor parameter to check for a specific string. For example, you can exclude and include processes on various platforms using one argument. A process may be running out of the /usr, the /opt, or the /var directory, but you are not sure where. Or perhaps a process is running out of different locations on different platforms. If you enter

(/usr|/opt)/[processname] 

for the Names of processes to monitor parameter, the script would monitor the process that is running in /usr OR in /opt but NOT in /var.

4.66.5 Remote Process Monitoring Using a Configuration File

The UnixRemoteProcessDown 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 script looks for the following configuration file:

c:\temp\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 tells the UNIX agent which processes to monitor and what to do if the processes 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>