Netwatch permissions with global variables

Netwatch has restricted permissions so it is not able to read or write global variables, this essentially makes it useless for integrating with complex monitoring scripting.
If you want to execute a script from netwatch, it can only have ‘read’ ‘write’ ‘reboot’ 'test’ permissions. Using global variables requires the ‘policy’ permission.

I saw some workarounds to this problem on another thread that essentially scripted the functionality of netwatch in a schedule. Another used static dns entries to replace global variables.

What worked for me was to schedule a status monitor for netwatch:

:global nwstatus  [/tool netwatch get [find comment="my netwatch host comment"] status]

This will be “up” or “down”

Hope it helps and if you have a better way, please share!

Thanks friend with this script reference, i did could write my own script in order to read state of an UPS! Kindly regards! from Loja,Ecuador, Latin America

very useful tip

thank you