Tag Archives: bash

Nagios Plugin – check_mem

check_mem is a simple Nagios plugin to check memory utilisation on Linux servers. I have written both a bash and a Ruby version of this script.

bash version:

Ruby version:


Launching Simultaneous Processes and Monitoring Exit Statuses

Let’s say you have three scripts. You want to execute them simultaneously (or as close to simultaneous as is practicable). You then want to examine all of their exit statuses, and maybe perform some actions accordingly.

The easiest way is using a script such as the following, capturing the PID of each process as it is launched, and then using wait to wait for the specified process to return its termination status. For example: