Page 1 of 1

Netwatch script to check if plugged in

Posted: Sat Nov 30, 2024 3:13 pm
by ocgltd
I want my mAP to take an action when I plug another host into a particular port. However, that host runs a firewall so it will not respond to pings /etc. Basically I want to use the link state (running) for a particular port and tell netwatch to use the result of that script to cause the action to happen.

Is this an ok way to use the script feature of netwatch? Or should I just use a script set to run at intervals.

Re: Netwatch script to check if plugged in

Posted: Sat Nov 30, 2024 3:59 pm
by jaclaz
Netwatch is triggered by a change in the status of pinging <some address>, and the discrimination is only between ping OK and ping NOT OK.

If the pinging always fails, no matter if the ether interface has a connection or not, it won't be triggered, I believe.