Hi guys,
Here's the execution/output of my script in /var/prtg/scriptsxml, which returns json:
user@host:/var/prtg/scriptsxml$ sudo ./authsensor.sh { "prtg": { "results": [ { "channel": "Banned", "value": "25" }, { "channel": "Failed", "value": "64" } ] } }
However PRTG is reporting an empty response for this sensor.
Any guidance appreciated.
Article Comments
Hi,
Could you provide instructions on doing that? Probe is running on Windows 10, running the SSH script on a remote linux machine. Where would I execute the script from the probe?
Thanks!
Jul, 2020 - Permalink
Sorry for another comment. Hoping you guys can clean these up. I still need help.
I've modified the script to generate the following output (renamed "results", changed to numeric "value"). Here's the latest json:
{ "prtg": { "result": [ { "channel": "Banned", "value": 10 }, { "channel": "Failed", "value": 44 }, { "channel": "Succeeded", "value": 0 } ] } }
I also notice this sensor doesn't run unless I pause/resume, at least per the log.
Jul, 2020 - Permalink
Hi Ian,
Thank you for the update.
Unfortunately we don't offer help by custom scripts.
However, I checked the response and everything looks fine. Therefore, I suspect that the script executed in PRTG has another result.
To check this result, please enable the option " Write Results To Disk" in your Sensor settings. This will create additional log files in the "Logs > Sensors" folder in the PRTG Data Directory of the corresponding Probe(https://helpdesk.paessler.com/en/support/solutions/articles/7600006351163). In these files, you can see the result which PRTG receives.
Jul, 2020 - Permalink
>We don't offer help Moritz, I Hate to break it to you, but you just did! Thank you.
For some reason this script, when calling the fail2ban-client, didn't accept the sudo settings configured for the device. Not an issue with other scripts. Very odd. I just ended up reducing the security a bit (https://github.com/fail2ban/fail2ban/issues/2649). Not ideal but I'll come back to it. I used chown which means they'd have to compromise my login. This will be the least of my worries in that case. :)
Cheers!
Jul, 2020 - Permalink
Hi there,
Did you tried to execute the script in the corresponding Probe and in 32bit mode (if possible)? Please note that the PRTG Probe service is a 32bit service and therefore can start a sub-process only in 32bit.
Jul, 2020 - Permalink