Hi, I build a simple SSH script but is not executed and I get the time out error.
Here the script
"<prtg>"
New-SSHSession -ComputerName 172.20.3.1 -Credential $Credential -AcceptKey >$null
"<result>"
" <channel>TEST</channel>"
" <value>"
if ($Res = Invoke-SSHCommand -Index 0 -Command "ping -c 1 172.20.1.1" > $null)
{
"1"
" </value>"
" <float>"
"1"
}
else
{
"0"
" </value>"
" <float>"
"0"
}
" </float>"
" </result>"
"</prtg>"
Debbuging the sensor I only the file with (Sensor#).Data.txt but not the (Sensor#).txt
Any Idea?
Thanks
Article Comments
Attention: This article is a record of a conversation with the Paessler support team. The information in this conversation is not updated to preserve the historical record. As a result, some of the information or recommendations in this conversation might be out of date.
This is an example. I'm trying to execute commands on a Remote machine to collect some data from server unreachable from PRTG. Those server and the bridge server are all Linux servers.
The problem is that I get that error PE018 but when I execute the command from shell the execution is almost instantaneous.
Also the log file for this sensor do not generate the sensor.txt file but only the one data.txt
Any suggestion?
Thanks
Jun, 2019 - Permalink
But the script is somewhat messy and won't work :) Check out the following for running commands on SSH hosts: https://helpdesk.paessler.com/en/support/solutions/articles/71923-monitoring-linux-distributions-incompatible-with-the-ssh-disk-free-sensor
Note that we can't help with the modification or development of scripts in general :)
Jun, 2019 - Permalink
If anything, that'd be PowerShell, from what I can tell :) What are you trying to achieve here? Pinging a host via another one? The SSH Remote Ping Sensor might be what you're looking for.
PRTGapi | Feature Requests | WMI Issues | SNMP Issues
Kind regards,
Stephan Linke, Tech Support Team
Jun, 2019 - Permalink