# Activate Script

**URL:** <https://forum.mikrotik.com/t/activate-script/156916>\
**Category:** Scripting\
**Created:** [March 29, 2022, 8:44pm UTC](https://forum.mikrotik.com/t/activate-script/156916 "2022-03-29T20:44:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Jotne](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/jotne/32/56097_2.png) [@Jotne](https://forum.mikrotik.com/u/Jotne)\
**Post date:** [March 31, 2022, 5:27am UTC](https://forum.mikrotik.com/t/activate-script/156916/2 "2022-03-31T05:27:54Z")

</div>

No need to use ping in script.

What you do is to use netwatch.  
There you can have a script for up/down information.

Script name: Netwatch

```plaintext
####################################
# Netwatch script
#
# Used as both up and down script
# Created Jotne 2021 v1.5
#
####################################
:local Host $host
/tool netwatch
:local Status [get [find where host="$Host"] status]
:local Comment [get [find where host="$Host"] comment]
:local Interval [get [find where host="$Host"] interval]
:local Since [get [find where host="$Host"] since]
:log info "script=netwatch watch_host=$Host comment=\"$Comment\" status=$Status interval=$Interval since=\"$Since\""

```

Then add an IP to monitor like this:

```plaintext
/tool netwatch
add down-script=Netwatch host=8.8.8.8 up-script=Netwatch

```

See more information here: [http://forum.mikrotik.com/t/tool-using-splunk-to-analyse-mikrotik-logs-4-0-graphing-everything/153043/3](http://forum.mikrotik.com/t/tool-using-splunk-to-analyse-mikrotik-logs-4-0-graphing-everything/153043/3)

---

_[View the full topic](https://forum.mikrotik.com/t/activate-script/156916)._
