Sample configurations

Configuration 1 for Linux

In this example, the executable samba is configured as StartProgram and StopProgram, with start and stop specified as command-line arguments respectively. The agent is configured to monitor two processes: a process specified by the pid smbd.pid and the process nmbd.

<resource name="samba_app" type="Application">

<attribute name="MonitorProcesses">

<val>"nmbd"</val>

</attribute>

<attribute name="PidFiles">

<val>"/var/lock/samba/smbd.pid"</val>

</attribute>

<attribute name="StartProgram"><scalar>"/usr/sbin/samba start"</scalar></attribute>

<attribute name="StopProgram"><scalar>"/usr/sbin/samba stop" </scalar></attribute>

<attribute name="User"><scalar>"root"</scalar></attribute>

</resource>

Configuration 2 for Linux

In this example, no user is specified, so the root user is used. The executable samba is used to start and stop the application, with start and stop as the command-line arguments respectively. The executable sambaMonitor monitors the application and uses "all" as its command-line argument. In addition, the processes smbd and nmbd are monitored.

<resource name="samba_app2" type="Application">

<attribute name="CleanProgram"><scalar>"/usr/sbin/samba force stop"</scalar></attribute>

<attribute name="MonitorProcesses">

<val>"smbd"</val>

<val>"nmbd"</val>

</attribute>

<attribute name="MonitorProgram"><scalar>"/usr/local/bin/sambaMonitor all"</scalar></attribute>

<attribute name="StartProgram"><scalar>"/usr/sbin/samba start"</scalar></attribute>

<attribute name="StopProgram"><scalar>"/usr/sbin/samba stop" </scalar></attribute>

</resource>

Configuration 1 for AIX, Linux, and Solaris

In this example, you configure the executable samba as StartProgram and StopProgram, with start and stop specified as command line arguments respectively. Configure the agent to monitor two processes: a process specified by the pid smbd.pid, and the process nmbd.

Application samba_app (

User = "root"

StartProgram = "/usr/sbin/samba start"

StopProgram = "/usr/sbin/samba stop"

PidFiles = { "/var/lock/samba/smbd.pid" }

MonitorProcesses = { "nmbd" }

)

Configuration 2 for AIX, Linux, and Solaris

In this example, since no user is specified, it uses the root user. The executable samba starts and stops the application using start and stop as the command line arguments. The executable sambaMonitor monitors the application and uses all as its command line argument. The agent also monitors the smbd and nmbd processes.

Application samba_app2 (

StartProgram = "/usr/sbin/samba start"

StopProgram = "/usr/sbin/samba stop"

CleanProgram = "/usr/sbin/samba force stop"

MonitorProgram = "/usr/local/bin/sambaMonitor all"

MonitorProcesses = { "smbd", "nmbd" }

)

Configuration 3 on Solaris 10

In this example, configure a resource in a non-global zone: zone1. The ZonePath of zone1 is /zone1/root. Configure the executable samba as StartProgram and StopProgram, with start and stop specified as command line arguments respectively. Configure the agent to monitor two processes: a process specified by the pid smbd.pid, and the process nmbd.

Application samba_app (

StartProgram = "/usr/sbin/samba start"

StopProgram = "/usr/sbin/samba stop"

PidFiles = { "/zone1/root/var/lock/samba/smbd.pid" }

MonitorProcesses = { "nmbd" }

ContainerName = "zone1"

)

Sample Configuration 1 for HP-UX

In this example, configure the executable samba as StartProgram and StopProgram, with start and stop specified as command-line arguments respectively. Configure the agent to monitor two processes: a process specified by the pid smbd.pid, and the process nmbd.

Application sample_app (

User = "root"

StartProgram = "/usr/sbin/sample_app start"

StopProgram = "/usr/sbin/sample_app stop"

PidFiles = { "/etc/sample_app.pid" }

MonitorProcesses = { "sample_app_process" }

)

Sample Configuration 2 for HP-UX

In this example, since no user is specified, it uses the root user. The executable samba starts and stops the application using start and stop as the command-line arguments. The executable sambaMonitor monitors the application and uses all as its command-line argument. Also, the agent monitors the smbd and nmbd processes.

Application sample_app2 (

StartProgram = "/usr/sbin/sample_app start"

StopProgram = "/usr/sbin/sample_app stop"

CleanProgram = "/usr/sbin/sample_app force stop"

MonitorProgram = "/usr/local/bin/sampleMonitor all"

MonitorProcesses = { "sample_app_process" }

)