{"id":129,"date":"2007-01-18T14:56:33","date_gmt":"2007-01-18T12:56:33","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=129"},"modified":"2007-01-18T15:04:01","modified_gmt":"2007-01-18T13:04:01","slug":"monitor-if-a-share-is-accessible","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=129","title":{"rendered":"Monitor if a share is accessible"},"content":{"rendered":"<p>This script will check\u00c2\u00a0if a file in a share is accessible, if not, it will generate a local event.<\/p>\n<p><code>strFile = \"\\\\ntlcs\\share\\file_check.txt\"<br \/>\nSet objFSO = CreateObject(\"Scripting.FileSystemObject\")<br \/>\nIf objFSO.FileExists(strFile) Then<\/p>\n<p>Else<br \/>\n\u00c2\u00a0\u00c2\u00a0 Const EVENT_WARNING = 2<br \/>\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 Set objShell = CreateObject(\"Wscript.Shell\")<br \/>\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 objShell.LogEvent 2, strFile & \" is not accessible.\"<br \/>\nEnd If<\/p>\n<p><\/code><\/p>\n<ol>\n<li>Create a new script and paste the script<\/li>\n<li>Create a new event rule to run the script every X minute as respond<\/li>\n<li>Create a new event rule to collect event ID 2 and event type of Warning<\/li>\n<li>Commit configuration change<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This script will check\u00c2\u00a0if a file in a share is accessible, if not, it will generate a local event. strFile = &#8220;\\\\ntlcs\\share\\file_check.txt&#8221; Set objFSO = CreateObject(&#8220;Scripting.FileSystemObject&#8221;) If objFSO.FileExists(strFile) Then Else \u00c2\u00a0\u00c2\u00a0 Const EVENT_WARNING = 2 \u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 Set objShell = CreateObject(&#8220;Wscript.Shell&#8221;) \u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 objShell.LogEvent 2, strFile &#038; &#8221; is not accessible.&#8221; End If Create a new script &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=129\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[2,13],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/129"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=129"}],"version-history":[{"count":0,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}