Disable Netwatch

Can anyone tell me what’s wrong with this?

# Disable netwatch for host 1.1.1.1
/tool netwatch disable [find host=1.1.1.1]

apr/06/2006 02:24:52 System-Error: script error: no such command or directory (find)

Thanks in advance.

Disable netwatch for host 1.1.1.1

/tool netwatch disable [/tool netwatch find host=1.1.1.1]

Didnt test this, but you need to fully qualify the find command within the most likely.

Sam

Thank you, Sir! That works fine.

The only problem now is that I have another script that re-enables this netwatch but re-enabling fires an UP event which I don’t want to do. Is there any way to stop this?

Maybe you can use another (better) solution. Remove the on down and on up scripts from the netwatch, and write a script that does the following:
Looks out all the hosts from netwatch that are not disabled, ping them x times with timeout y, when only z of the x icmp packets come back, then run down_script, and saves the host’s “down” state to a globally declared array. In next run, from this global array you can read the host’s previously registered state. If on next run the pinging success, and the host’s state was “down” before, you can fire the up_script, and set the host’s state in the global array to “up”

Schedule this script to run every minutes, or whatever you want.

The script above is more intelligent that Netwatch, because Netwatch measurements are based on one ping only, that’s generates many false alarms (what if ONLY that measuring packet was lost?).