What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Advanced SSH Script - Empty Response

Votes:

0

Your Vote:

Up

Down

Hi guys,
Here's the execution/output of my script in /var/prtg/scriptsxml, which returns json:

[email protected]:/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.

json linux ssh ssh-script-advanced-sensor

Created on Jul 16, 2020 8:28:55 AM by  looselyhuman (0) 2

Last change on Jul 16, 2020 8:35:12 AM by  Moritz Heller [Paessler Support]



Best Answer

Accepted Answer

Votes:

1

Your Vote:

Up

Down

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://kb.paessler.com/en/topic/463). In these files, you can see the result which PRTG receives.

Created on Jul 17, 2020 6:27:42 AM by  Moritz Heller [Paessler Support]



5 Replies

Votes:

0

Your Vote:

Up

Down

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.

Created on Jul 16, 2020 8:36:46 AM by  Moritz Heller [Paessler Support]



Votes:

0

Your Vote:

Up

Down

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!

Created on Jul 16, 2020 3:24:10 PM by  looselyhuman (0) 2

Last change on Jul 22, 2020 5:01:55 AM by  Marijan Horsky [Paessler Support]



Votes:

0

Your Vote:

Up

Down

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.

Created on Jul 16, 2020 5:50:50 PM by  looselyhuman (0) 2

Last change on Jul 17, 2020 6:22:43 AM by  Moritz Heller [Paessler Support]



Accepted Answer

Votes:

1

Your Vote:

Up

Down

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://kb.paessler.com/en/topic/463). In these files, you can see the result which PRTG receives.

Created on Jul 17, 2020 6:27:42 AM by  Moritz Heller [Paessler Support]



Votes:

0

Your Vote:

Up

Down

>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!

Created on Jul 17, 2020 4:34:55 PM by  looselyhuman (0) 2



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.