Trigger action on link state change

Damien Fleuriot ml at my.gd
Fri Jun 15 11:12:45 UTC 2012


On 6/15/12 12:32 PM, Michael Ross wrote:
> 
> Hi all,
> 
> i was wondering if there is any ready-made method to trigger an action
> as soon as a link changes state.
> Along the lines of
>     onifdown_em0="/run/this/script"
> in rc.conf
> 
> Background:
> Discussing physical data security with a client yesterday: The machine
> has to run 24/7. The filesystem is encrypted on boot, but this doesn't
> help a lot if anybody brings an AC generator to steal the machine *AND*
> the UPS. Best point in time to lock the machine I could think of was
> when somebody pulls the NIC cable.
> 
> Regards,
> 
> Michael


Aside from Matthias' suggestion of devd, you may want to also look up
ifstated.

We actually use it in production to send nagios passive alerts on CARP
status change and LAGG interface loss of fault tolerance.


More information about the freebsd-questions mailing list