I wrote a script that return 0 or 1:

IF x print 1 else print 0

but in sensor I have this message: Received empty SSH response. Please check the sensor log.


Article Comments

Hi Rodrigo,

The returned response must look like this so that the sensor is able to make use of it: returncode:value:message

Value has to be a 64 bit integer or float and will be used as the resulting value for this sensor (e.g. bytes, milliseconds, etc.), message can be any string (maximum length: 2000 characters) and will be stored in the database.

For further details including the returncode, please check custom sensor documentation in PRTG located at Setup | PRTG API | Custom Sensors.

Kind regards.


Jul, 2016 - Permalink

Hi Erhard,

So, I did like you said. Just for test I did this script:

# coding=utf8
# -*- coding: utf8 -*-
import os

print "0:11:OK"

And prtg says: Received empty SSH response

This "print" isn't correct ?


Jul, 2016 - Permalink

Hi Rodrigo,

Try echo instead of print.

Kind regards.


Jul, 2016 - Permalink

It is "print" because this is a Python script. Python doesn't work in this sensor?


Jul, 2016 - Permalink

Consulted a developer about it. SSH Script sensor does not support Python natively, but you can try using a bash wrapper like this:

#!/bin/bash
/path/to/python /var/prtg/script/script.py

Kind regards.


Jul, 2016 - Permalink