Hi all,
I try to check for a process on a SLES server and for at least two child processes of that parent process with the “procs” check_command. There have to be at least 2 child processes running , otherwise the application will be very slow.
The process table looks like:
ps -ef | grep 7451
caadmin 7451 1 0 Aug09 ? 00:00:00 ca_rsopsv
caadmin 7453 7451 0 Aug09 ? 00:00:28 -p 4 -n 200000052 -v 1
caadmin 7457 7451 0 Aug09 ? 00:00:00 -p 4 -n 200000053 -v 1
caadmin 7461 7451 0 Aug09 ? 00:00:00 -p 4 -n 200000054 -v 1
caadmin 7465 7451 0 Aug09 ? 00:00:00 -p 4 -n 200000055 -v 1
On the host I’ve configured:
vars.procs["ca_rsopsv"] = {
procs_argument = "ca_rsopsv"
}
vars.procs["children of ca_rsopsv"] = {
procs_ppid = "7451"
}
whereas the service is configured like:
apply Service "Process: " for (procs => config in host.vars.procs) {
import "generic-service"
check_command = "procs"
command_endpoint = host.name
vars += config
assign where host.vars.os == "SLES"
ignore where host.vars.noagent
}
That works if I know the PPID (here: 7451) already. Is there a way to get the PID of the first process “ca_rsopsv” in order to put it as variable in the check of the child processes?
Thanks for help!
Bye
Stephan