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?


Article Comments

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.


Oct, 2021 - Permalink