What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags

View all Tags

SSH Script to monitor process in linux



This isn't a question, it's a share - wasn't sure how to share something the community. I was looking for a way to monitor a given process in Linux (specifically Ubuntu.) I used to use Xymon which allowed me to set a min/max number of a process and alert based on that; wanted something like that for PRTG. After some research I really couldn't find what I was looking for, so I made it myself.

  1. !/bin/sh

ProcCount=$(ps -e | grep $1 | wc -l) echo "0:$ProcCount:Found $ProcCount of $1 running"

give it a name and save it in /var/prtg/scripts on the linux system you want to monitor. Then create a SSH Script sensor for that machine and select the script you just made; set the 'parameters' to be the name of the process to check then edit the alerting to set your high/low limits.

The script just does a simple process count and returns the number found.

check count linux process running script ssh ubuntu

Created on Jun 30, 2018 1:27:41 PM

1 Reply



Hi there,

Thanks for sharing your solution! We have a similar approach by using SNMP instead:

Best regards.

Created on Jul 2, 2018 8:22:55 AM by  Dariusz Gorka [Paessler Support]

Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.