Community discussions

 
User avatar
doneware
Trainer
Trainer
Topic Author
Posts: 377
Joined: Mon Oct 08, 2012 8:39 pm
Location: Hungary

feature request: expose variables to netwatch scripts

Thu Jun 14, 2018 6:48 pm

it is cool to have scripting hooks in netwatch, like up-/down-script.

it would be however much more pleasant to have some variables exposed to the scripts, like
  • host
  • since (this time the timestamp of the last change, not the one that has fired the script)
  • routing-mark (which then implies the usage of in-vrf monitoring)
  • comment (to be able to add some unique identifier as well)
this way we could re-use scripts for multiple different netwatch entries.

and ability to specify the source-interface/source-ip-address.
and maybe to add some grace cycles, like x consecutive misses fire the down event, instead of a single one.
#TR0359
 
User avatar
Cha0s
Forum Veteran
Forum Veteran
Posts: 722
Joined: Tue Oct 11, 2005 4:53 pm

Re: feature request: expose variables to netwatch scripts

Fri Jun 15, 2018 2:14 pm

+1 :)
 
pe1chl
Forum Guru
Forum Guru
Posts: 4303
Joined: Mon Jun 08, 2015 12:09 pm

Re: feature request: expose variables to netwatch scripts

Fri Jun 15, 2018 4:42 pm

When you want to setup a complicated monitoring system that performs actions when reachability changes, it is better to avoid netwatch.
Not only is it limited by the recent changes to scripting policy, but also it has always had the problem that a single missed ping indicates a "down" condition.
(there is no way to specify a number of missed pings)
This tends to lead to false alarms in the presence of some packet loss, which could occur when lines are fully loaded etc.

It is probably better to make a script that itself contains a loop or is scheduled frequently for a single pass, and that uses other primitives
like /ping and /tool fetch etc to monitor. This allows you to set thresholds and also solves the problem you have with netwatch.
 
User avatar
doneware
Trainer
Trainer
Topic Author
Posts: 377
Joined: Mon Oct 08, 2012 8:39 pm
Location: Hungary

Re: feature request: expose variables to netwatch scripts

Fri Jun 15, 2018 8:13 pm

Not only is it limited by the recent changes to scripting policy, but also it has always had the problem that a single missed ping indicates a "down" condition.
(there is no way to specify a number of missed pings)
this is the reason why i asked for this as well:
and maybe to add some grace cycles, like x consecutive misses fire the down event, instead of a single one.
#TR0359
 
User avatar
doneware
Trainer
Trainer
Topic Author
Posts: 377
Joined: Mon Oct 08, 2012 8:39 pm
Location: Hungary

Re: feature request: expose variables to netwatch scripts

Fri Jun 15, 2018 8:17 pm

like /ping and /tool fetch etc to monitor. This allows you to set thresholds and also solves the problem you have with netwatch.
/ping is also a nice stuff to have, but currently it is lacking some serious functionality. it should be able to return at least the same output when run "as-value" as normally.
sadly it just returns the number of packets successfully received. at least the min/max/avg RTT would be fine. the success rate i can calculate by myself :-)

otoh i also asked for this some time ago:
viewtopic.php?f=1&t=45934&start=750#p665235

but hell, i'll do this right away as a standalone topic :-)
#TR0359

Who is online

Users browsing this forum: No registered users and 14 guests