Hi friends.

I'm trying to create a Custom Sensor Python but, everytime that I edit the default script structure, I got a ERROR:

XML: Structural error in xml file, 1 open items. -- JSON: O JSON retornado não corresponde à estrutura esperada (Invalid JSON.). (código: PE231

What am I doing wrong?

Here my script:

  1. -*- coding: utf-8 -*-

import sys import json from paepy.ChannelDefinition import CustomSensorResult

error = 0 log_bkp_pi = open('

SAP-PI-APP01
Sybase
bin
falha_dbfull.log', 'r').read()

def test(): if "1" in log_bkp_pi: error = 1 return error else: error = 2 return error

result = CustomSensorResult("OK")

result.add_channel(channel_name="Backup FULL", unit="Count", value=test(), is_float=False, primary_channel=True, is_limit_mode=True, limit_max_error=2, limit_error_msg="Backup Fail")

print(result.get_json_result())

Details: Line- log_bkp_pi = open('

SAP-PI-APP01
Sybase
bin
falha_dbfull.log', 'r').read() This line I'm reading a log backup that contains 1 or 0.

Could you help me whit this problem?


Article Comments

Please enable write result to disk within the sensor settings and open up a new ticket with
Tech Support. Don't forget to attach the log files, they're located under: C:\Program Data\Paessler\PRTG Network Monitor\Logs (Sensors)


Jan, 2017 - Permalink