New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


SSH Script to monitor process in linux

Votes:

0

Your Vote:

Up

Down

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 by  jdube (0) 1



1 Reply

Votes:

0

Your Vote:

Up

Down

Hi there,

Thanks for sharing your solution! We have a similar approach by using SNMP instead:
https://kb.paessler.com/en/topic/29403-monitoring-processes-in-linux

Best regards.

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



Please log in or register to enter your reply.


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.