There are many choices for enterprise monitoring, you may already have server level monitoring in place.

Where an individual process requires inspection over time, a simple monitoring script is an option

One of the trade-offs that you must make when monitoring in detail is sample frequency.

Too frequent and you might cause more issues (large logs or other cruft).

Not frequent enough and you might miss the very thing you are trying to observe.

A basic Python script that logs every 2 minutes to sqlite can be found at the link shown next.

On a server with Python 2 available, and equipped with the process id you wish to monitor (from ps output), you might invoke the script as follows:

python ./pidmem_sample1.py 1234

(where 1234 is the process id of you long running process)

The script will run for 3 months or so, and samples at two minute intervals.

Killing the process being monitored will see the monitoring script exit also.

Advertisements