I use a POE switch to power a bunch of cheap IP cameras. Because they’re cheap, they tend to lock up once in a while. The switch’s CLI allows for a per-port POE power recycle command:
poe 4 0; sleep 5; poe 4 24 (power cycles port 5 for 5 seconds)
I would like the PLEG to be able to send this command to the switch automatically where the ping detector plugin device (one per camera) detects a failed ping, as an action.
Any idea how this could be done?
i am guessing you could do this with something like
luup.inet.wget("ssh firstname.lastname@example.org 'poe 4 0; sleep 5; poe 4 24'")
That would go in to the lua script in actions…
try the command firstly using putty or another ssh terminal to make sure the command itself works
Thank you, will give it a go
actually… i think i have had more time to think it through…
I am not at home to try… but I think it needs to be
os.execute(" command here ")
Thanks again, will post results when I have the switch set up.