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

PRTG Network Monitor

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

Free Download

Top Tags


View all Tags

Using SSH Script sensor to run a command

Votes:

0

Your Vote:

Up

Down

I'm trying to get Memory Usage stats from a Mac Mini server, however none of PRTG's sensors are working with it (It's a Mid 2011 Mac Mini). So I figured I would use the SSH Script sensor. I already have a script that tells me the "Up/Down" status of a process, which works successfully with PRTG...so I'm trying to adapt that script to what I'm needing.

I want to run the following command:

top -l 1 | head -n 10 | grep PhysMem | sed 's/, /n /g'

which gives me the output of(However...it varies each time...so therin lies my issue):

PhysMem: 1663M wiredn 3991M activen 10G inactiven 16G usedn 442M free.

Does anyone have any formats where I can have the script run that command and then pipe it out to an acceptable way for PRTG to read it and then graph it?

mac-mini script ssh-script

Created on Sep 30, 2021 4:44:42 PM by  jpowers01 (0) 1



1 Reply

Votes:

0

Your Vote:

Up

Down

Hello,

Thank you for your message.

With the SSH Script sensor, you can only return one value in PRTG by following the format below:

returncode:value:message

Therefore, if you need to send all the values displayed in the result you get, I invite you to use the SSH Script Advanced sensor instead and return the data by following the format mentioned in this manual: https://www.paessler.com/manuals/prtg/custom_sensors#standard_sshscript

Please, make sure to return valid integer or float values otherwise PRTG won't process the data it receives and return an error accordingly.

If you have questions, let us know.

Regards.

Created on Oct 1, 2021 9:31:50 AM by  Florian Lesage [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.