How can I perform an action (an e-mail, a reboot etc.) after i.e. an ethernet link goes down for an amount of times ?
How does the log looks like when it goes down?
You can then search every 5 min for the message in the log.
Increment a counter every time.
Then do some action after 5 times.
But this is the treatment of the symptoms and not of the cause, why should a reboot help?