Is there any documentation on the parameters you can pass to a python sensor

So far I have got......

password = data['linuxloginpassword']
host = data['host']
username = data['linuxloginusername'] 

I would guess there should be one more, for the additional parameters field in the sensor?


Article Comments

Hi there,

You can use almost all placeholders that are described in this site.

What specific parameters do you need to pass to the Python script?


Feb, 2017 - Permalink

The one that I'm not finding, is the "additional paramaters" when you look at the settings of the custom python sensor.

I want to pass a variable into the sensor from that box, but not finding what the placeholder for that field.


Feb, 2017 - Permalink

Hi,

Please see the screenshot below: python

Do you have this field too? If not, what version of PRTG are you currently using and what exact sensortype?


Feb, 2017 - Permalink

yep that's the field I'm asking about.

I want to use that to pass in a custom list into my python sensor


Feb, 2017 - Permalink

Hi there,

Then just enter your necessary parameters into that field. ^^ I am quite unsure what the current question is, as you have the field and you are able to enter parameters. So to pass the IP-Address or Hostname of the parent device, just add: -host "%host" Just make sure that the python script can take and interpret the "-host" parameter.


Feb, 2017 - Permalink

Hi Kube,

Not sure if you recieved an answer to this but I believe all the parameters you can pass from Python can be found in your logs

  • 1. You need to first run a python sensor to produce the data.
  • 2. You must turn on "Write sensor results to disk"
  • 3. Location of the logs can be found here.
    • C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)
    • Example: Result of Sensor 5036.Data.txt
  • 4. Options such as "Pass the Device Credentials" will update this parameter list.

The parameters you can pass can be found in the following. (I purposly removed all my sensitive data)

Data['blockedsens'].asString := ''
Data['canlinux'].asString := '1'
Data['checkfailed'].asString := '0'
Data['cookies'].asString := ''
Data['crc'].asString := '0'
Data['customheaders'].asString := ''
Data['fastcount'].asString := '0
Data['host'].asString := '#########'
Data['hostv6'].asString := ''
Data['httpauthentication'].asString := ''
Data['httpmethod'].asString := 'GET'
Data['httpmustneeded'].asString := '2'
Data['httpmustnotneeded'].asString := '0'
Data['httppassword'].asString := '***'
Data['httpurl'].asString := '########'
Data['httpuser'].asString := ''
Data['hybridmode'].asString := 'delphi'
Data['includemaynot'].asString := ''
Data['includemaynottype'].asString := '0'
Data['includemaynotwarning'].asString := ''
Data['includemust'].asString := '#######'
Data['includemusttype'].asString := '0'
Data['includemustwarning'].asString := ''
Data['inerror'].asString := '0'
Data['interfacenumber'].asString := ''
Data['inum'].asString := ''
Data['ipversion'].asString := '0'
Data['isexesensor'].asString := '0'
Data['lastmsg'].asString := '#P1'
Data['lastuptime'].asString := '0'
Data['maxdownload'].asString := '0'
Data['monitorchange'].asString := '0'
Data['notonpod'].asString := '0'
Data['port'].asString := ''
Data['postcontentoptions'].asString := '0'
Data['postcontenttype'].asString := 'application/x-www-form-urlencoded'
Data['postdata'].asString := ''
Data['protocolversion'].asString := '1'
Data['proxy'].asString := ''
Data['proxypassword'].asString := '***'
Data['proxyport'].asString := '###'
Data['proxyuser'].asString := ''
Data['reboot'].asString := '42823.7710075926'
Data['reqmsginterval'].asString := '3600'
Data['resultfile'].asString := 'Result of Sensor 5036.txt'
Data['sensorid'].asString := '5036'
Data['simulate'].asString := '0'
Data['sni_inheritance'].asString := '0'
Data['snihost'].asString := '
Data['timeout'].asString := '60'
Data['tlsexplicit_default'].asString := ''
Data['tlsexplicit_ftp'].asString := ''
Data['tlsexplicit_imap'].asString := ''
Data['tlsexplicit_pop3'].asString := ''
Data['tlsexplicit_port'].asString := ''
Data['tlsexplicit_smtp'].asString := ''
Data['tpaesslconnection_owned'].asString := ''
Data['tpaesslconnection_step'].asString := '0'
Data['uptimecount'].asString := '0'
Data['usednstime'].asString := '0'
Data['useragent'].asString := 'Mozilla/5.0 (compatible PRTG Network Monitor (www.paessler.com) Windows)'

Apr, 2017 - Permalink

Hi Jeffrey,

Thank you for your additional explanation. Upvote. :)

Best regards.


Apr, 2017 - Permalink