Process watch
This configuration can keep processes running or stopped. A defined process name will be evaluated regarding if it is running (present) or not (absent). If the condition is not met the command defined in "command to run" will be executed. This could for example restart a process when it has terminated. On the other hand, this can also prevent processes from running.
Any restart event will be logged in the qbee logs. This allows you to see if you have processes that are failing on a regular basis.
Typically the process name is used to find the process. The agent performs a search for the process name with the information from the process name box. For example: /usr/local/bin/cpu_temp.sh
searches for this process and checks if it runs. The "Command to run" could then be bash /usr/local/bin/cpu_temp.sh > /dev/null 2>&1 &
. This starts the script again. The appendix > /dev/null 2>&1 &
pipes bash output to /dev/null and executes it in the background. It is important that the file output is handled.
This evaluation is performed with the frequency with which the agent runs. If it runs every 5 minutes then a process would be restarted at the latest 5 minutes after termination. Like all configuration this will also be maintained should the network connection be down. Any event will be logged in the log files thus giving you insight into where processes die and how often this happens. This can be really valuable for debugging.
Sometimes there is more than one process with the same name. Maybe two openvpn
processes are running. Then it is very important to use not only the process name but also the path to differentiate which one is monitored. Otherwise the condition will never trigger as long as one openvpn process still runs.