{"id":457,"date":"2022-01-04T08:26:50","date_gmt":"2022-01-04T08:26:50","guid":{"rendered":"https:\/\/sznetwork.systems\/?p=457"},"modified":"2025-06-02T08:24:04","modified_gmt":"2025-06-02T06:24:04","slug":"mikrotik-using-netwatch-to-check-host-availability-online-offline-and-send-email-then-host-up-or-down","status":"publish","type":"post","link":"https:\/\/sznetwork.systems\/?p=457","title":{"rendered":"Mikrotik using Netwatch to check host availability (ONLINE, OFFLINE) and send email then host up or down (Migrated)"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Mikrotik routers have default service to check host availability, its name Netwatch. Configuration Netwatch service to send emails through default Mikrotik email client if host is offline or returned online.<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Video<\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Mikrotik Netwatch to check host availability (ONLINE, OFFLINE) and send email then host up or down\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/FGnn048jN48?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Winbox is connected,\nGoing to the section Tools -&gt; Netwatch<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-1-1024x546.jpg\" alt=\"mikrotik netwatch\" class=\"wp-image-459\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-1-1024x546.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-1-300x160.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-1-768x409.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-1.jpg 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Adding new Netwatch host<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-2-1024x546.jpg\" alt=\"mikrotik netwatch\" class=\"wp-image-460\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-2-1024x546.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-2-300x160.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-2-768x409.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-2.jpg 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Enter IP address of host\nInterval - how frequently will be checked host\nTimeout - max time of without activity to trigger. <\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-3-1024x546.jpg\" alt=\"mikrotik netwatch\" class=\"wp-image-461\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-3-1024x546.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-3-300x160.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-3-768x409.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-3.jpg 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Script to send Email then host is UP (ONLINE)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\"><strong>Script for UP<\/strong>\n\nlocal host YourServerName\nlocal status ONLINE\nlocal mailTo simplelbase@gmail.com\nlocal mailFrom simplelbase@gmail.com\n\/tool e-mail send from=$mailFrom  to=$mailTo body=\"$host $status\" subject=\"$host $status\"<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-4-1024x546.jpg\" alt=\"mikrotik netwatch\" class=\"wp-image-462\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-4-1024x546.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-4-300x160.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-4-768x409.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-4.jpg 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Script to send Email when host is DOWN (OFFLINE)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\"><strong>Script for DOWN<\/strong>\n\nlocal host YourServerName\nlocal status OFFLINE\nlocal mailTo simplelbase@gmail.com\nlocal mailFrom simplelbase@gmail.com\n\/tool e-mail send from=$mailFrom  to=$mailTo body=\"$host $status\" subject=\"$host $status\"\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-5-1024x546.jpg\" alt=\"mikrotik netwatch\" class=\"wp-image-463\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-5-1024x546.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-5-300x160.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-5-768x409.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-5.jpg 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Checking in Log file that email sent when host is OFFLINE. <\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-6-1024x546.jpg\" alt=\"mikrotik netwatch\" class=\"wp-image-464\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-6-1024x546.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-6-300x160.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-6-768x409.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2022\/01\/netwatch_email-6.jpg 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Mikrotik routers have default service to check host availability, its name Netwatch. Configuration Netwatch service to send emails through default Mikrotik email client if host is offline or returned online.. <a class=\"read-more-link\" href=\"https:\/\/sznetwork.systems\/?p=457\">read more&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[37],"tags":[58,56,33,57,31,54,53,52,32,55],"class_list":["post-457","post","type-post","status-publish","format-standard","hentry","category-mikrotik","tag-availability","tag-down","tag-email","tag-host","tag-mikrotik","tag-netwatch","tag-offline","tag-online","tag-script","tag-up"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts\/457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=457"}],"version-history":[{"count":6,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts\/457\/revisions"}],"predecessor-version":[{"id":1902,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts\/457\/revisions\/1902"}],"wp:attachment":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}