Process resource type allows you to wirte scripts for start, stop, monitor and run the process in a specific user context. You do not need to use the script agent for this. The Process Agent, being a Bundled Agent, is a supported agent. Look in the Bundled Agents Reference Guide and it should give you an example. We use this in class to demonstrate how to use a script to start a process. This reduces your work because you do not need to create a types file for your resource type.
From the BARG:
Sample 1
In the following configuration, the online entry point spawns the executable
test.exe with online as a command-line argument. The offline entry point
spawns the executable test.exe with offline as the command-line argument.
The monitor entry point monitors the attribute value for StartProgram,
test.exe, and checks the state.
Process Process_Test (
StartProgram = "\"X:\\bin\\test.exe\" /online"
StopProgram = "\"X:\\bin\\test.exe\" /offline"
UserName = "Administrator"
Password = bphNepE
Domain = "VCS_DOMAIN"
)
Sample 2
In the following configuration, the batch file start.bat starts an instance,
MyProcess, of the executable process.exe. The batch file stop.bat stops the
process instance of process.exe. The batch file monitor.bat monitors the
attribute value for StartProgram, and checks the state of the process.exe. Note
that the executable process.exe resides in the directory C:\batchfiles, which
is specified as the StartupDirectory.
PROCESS-Process_SG (
StartProgram = "C:\\batchfiles\\start.bat MyProcess"
StartupDirectory = "C:\\batchfiles"
StopProgram = "C:\\batchfiles\\stop.bat MyProcess"
MonitorProgram = "C:\\batchfiles\\monitor.bat MyProcess"
UserName = Administrator
Password = jxpVmxM
Domain = "mydomain.mycompany.com"
)