{"id":1474,"date":"2013-12-14T18:49:55","date_gmt":"2013-12-14T16:49:55","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1474"},"modified":"2013-12-14T18:57:00","modified_gmt":"2013-12-14T16:57:00","slug":"connectivitywatchdog-inaccessible-tcp-based-service-notification-via-email","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1474","title":{"rendered":"ConnectivityWatchdog: Inaccessible TCP based Service Notification via Email"},"content":{"rendered":"<div>\n<p>This is dual &#8220;yet another&#8230;&#8221; and utility clearance series. Once again an attempt to easily automate network availability check for a service.<\/p>\n<p>The application is doing periodic TCP connectivity check and sends an email to notify on inaccessible service. If you got systems running at 2+ sites, they can be set up to check one another and inform timely on network issues.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1475\" alt=\"ConnectivityWatchdog Screenshot\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2013\/12\/Image001.png\" width=\"745\" height=\"406\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2013\/12\/Image001.png 745w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2013\/12\/Image001-320x174.png 320w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><\/p>\n<p>Configuration is provided through\u00c2\u00a0<code>ConnectivityWatchdog.ini<\/code>\u00c2\u00a0file to be put into the directory of the binary. Sample file is as follows:<\/p>\n<pre style=\"border: solid #ccc 1px; margin: 4px; padding: 4px;\"><code>[General]\r\n\r\n[Host]\r\n$(SomeUniqueIdentifer)=$(FriendlyName), tcp, $(TcpHostOrIpAddress), $(TcpPort)\r\n$(SomeUniqueIdentifer)=$(FriendlyName), tcp, $(TcpHostOrIpAddress), $(TcpPort)\r\n\r\n[Probe.TCP]\r\nConnection Time=45 ; Timeout for TCP connection attempt, seconds\r\nSuccess Idleness Time=60 ; Next attempt in case of successful connection, seconds\r\nFailure Idleness Time=10 ; Next attempt in case of failed connection, seconds\r\nNotification Failure Count=3, 33, 333 ; Numbers of failure attempts which trigger email notification \r\n\r\n[Notification]\r\nDelay=450 ; Delay in notification in order to combine messages into single email, seconds \r\n\r\n[Notification.SMTP]\r\nHost=smtp.gmail.com\r\nSender=$(UserName)@gmail.com\r\nTo=$(UserName)@gmail.com\r\nTLS=1\r\nAuthentication Methods=login\r\nAuthentication Name=$(UserName)@gmail.com\r\nAuthentication Password=$(Password)\r\n<\/code><\/pre>\n<p>Once the application notices TCP connectivity issues, it updates UI status and as configured (see &#8220;Notification Failure Count&#8221; value above) it will trigger a notification email:<\/p>\n<pre style=\"border: solid #ccc 1px; margin: 4px; padding: 4px;\"><code>The following are the updates on $(Host) system:\r\n\r\n * Remote host $(FriendlyName) connection SUCCEEDED after 8 failures [2013-12-12 02:15:06 - 4 minutes ago]\r\n * Remote host $(FriendlyName) connection FAILED 3 times in a row (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond - 0x8007274c) [2013-12-12 02:12:21 - 7 minutes ago]\r\n\r\n--\r\n  System: $(Host)\r\n  Time: 2013-12-12 02:19:51\r\n  Agent: Alax.Info ConnectivityWatchdog Application\/1.0.0.58\r\n<\/code><\/pre>\n<p>All $(&#8230;) values above are placeholders.<\/p>\n<p>The application has a convenient option to enable automatic startup with user logon.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1476\" alt=\"ConnectivityWatchdog Current User Startup\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2013\/12\/Image002.png\" width=\"403\" height=\"216\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2013\/12\/Image002.png 403w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2013\/12\/Image002-320x171.png 320w\" sizes=\"auto, (max-width: 403px) 100vw, 403px\" \/><\/p>\n<h3>Download links<\/h3>\n<ul>\n<li>Binaries:\u00c2\u00a0<a href=\"https:\/\/www.alax.info\/svn\/public\/trunk\/Toolbox\/ConnectivityWatchdog.exe\" target=\"_blank\">ConnectivityWatchdog.exe<\/a><\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is dual &#8220;yet another&#8230;&#8221; and utility clearance series. Once again an attempt to easily automate network availability check for a service. The application is doing periodic TCP connectivity check and sends an email to notify on inaccessible service. If you got systems running at 2+ sites, they can be set up to check one&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1474\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[460,458,132,459],"class_list":["post-1474","post","type-post","status-publish","format-standard","hentry","category-utilities","tag-notification","tag-tcp","tag-utility","tag-watchdog"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1474"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1474\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}