
For example, I was recently struggling with a FreeBSD computer where a program’s child processes would occasionally fail to exit. This makes ps-watcher an excellent all-purpose system monitoring tool. You can define any condition to match and execute any action when a match is found (or not found). The power of ps-watcher is its flexibility. To ensure that ps-watcher is always running, you can add a line to /etc/rc.local to start it on every boot. ps-watcher automatically daemonizes itself and re-runs on a regular basis (every five minutes by default). To use this configuration, start ps-watcher (as root) and specify theĬonfiguration file with the command ps-watcher -config ps-watcher.cfg. See the ps-watcher man page for other possible values. none means execute the action if no matches are found, while every means execute the action for every match. The occurs line controls how often the action line gets executed. The workaround for this case is to match on slightly different regular expressions, such as “ntpd” or “ntp.” The second line of the configuration file ( occurs=none) file tells ps-watcher to execute the action line if no process name matches are made. Note that because of the way ps-watcher is written you can’t match on the same process name more than once in a configuration file, even though you may want to if you want to both monitor that a particular process is running and perform an action if the process meets your criteria we’ll see how that works in a moment. The first line, in brackets, is a regular expression that is matched against the cmd field in the ps output. Create a ps-watcher.cfg file with these contents: One way to keep ntpd running is to use ps-watcher to ensure that at least one ntpd process is running at all times. Keeping ntpd running can be a challenge for example, it exits on startup if the system time is too far from the reference time. Say that you want to make sure your CentOS Linux server always has one copy of the Network Time Protocol daemon ntpd running to maintain accurate time. One basic use for ps-watcher is ensuring that a certain program is running.

Ps-watcher can stop machines from crashing due to memory exhaustion, or make sure that a buggy program isn’t leaving too many copies of itself running. Along with the supplied configuration file, you can use command-line options to fine-tune the behavior of ps-watcher and assist in debugging. Once you have ps-watcher installed the next step is to create a configuration file that contains the rules your want to use for monitoring or acting on what ps-watcher reports, based on the output of the ps command.
#Process monitor linux install
Because it doesn’t have any prerequisites, ps-watcher should install and work on just about any Unix-like system. Any user can run ps-watcher for simple monitoring and alerting. You don’t have to install or run ps-watcher as root, although depending on the actions you want to perform you may need to either run it as root or use sudo.
#Process monitor linux code
Download the source code and do the usual configure make make install routine. ps-watcher provides a consistent interface (with some caveats) to the varied process information available on different Unix and Linux machines.Īlthough ps-watcher may not come with your system, installing it is straightforward.

It allows you to access all the process information on a system and make choices based on that information. Ps-watcher is an example of a Unix tool that does one thing and does it well. When you need to address smaller problems with process data on a system, the process monitoring tool ps-watcher comes in handy. Open source monitoring solutions like Nagios or OpenNMS cost nothing to acquire but still require planning and tweaking.
#Process monitor linux software
Large proprietary applications make sense for large installations that can afford the expense of both the software and consultants who fine-tune the systems.


You can monitor your computers in a wide variety of ways.
