Modify watchcat

How can I modify watchcat package to do this ..

if ping has zero reply from certain IP than run this script.
My objective is to shutdown remote ssh server (eg :ssh root@192.168.1.11 -pw=xxxx halt), when there is 0 ping reply from certain IP (eg:192.168.1.12)

Or is there any other tool available to do so