I’m trying to make a command-line sensor. This command will check if my vpn tunnel can ping to the outside world. It’s working as it should from the HA terminal but not as a sensor. What am I doing wrong?
This is the code:
When checking this new sensor in Developer Tools the state of this sensor will always be Offline. I think it has something to do with the quotation marks. Looked up some examples in this forum but couldn’t find a working solution. Any ideas?
Argh! What a rookie mistake for not checking the logs. I looked at the logs but didn’t find any messages related to this sensor. Another thing I tried: turning on the debug log. No weird stuff there.
logger:
default: debug
What I do have are SSH errors on the server where the VPN tunnel is running. Something with a wrong password. Fixing that could be the solution for this.
Found a solution. I had to figure out first why the command didn’t work. Someone posted a helpful tip here, The suggestion was to append 2> /config/command.log to the end of the ssh command in order to write the output from the command to a file. Which got me this error: