{"id":5632,"date":"2018-10-03T11:14:03","date_gmt":"2018-10-03T08:14:03","guid":{"rendered":"https:\/\/msbro.ru\/?p=5632"},"modified":"2018-10-03T11:16:01","modified_gmt":"2018-10-03T08:16:01","slug":"proverka-sostoyaniya-baz-exchange","status":"publish","type":"post","link":"https:\/\/msbro.ru\/index.php\/archives\/5632","title":{"rendered":"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0431\u0430\u0437 Exchange"},"content":{"rendered":"<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0431\u0430\u0437 Exchange. \u041e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0431\u0430\u0437, \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b. \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0431\u0430\u0437, \u0431\u0430\u0437 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043b\u044e\u0431\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0444\u0430\u0439\u043b \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0432\u0441\u0435\u0445 \u0431\u0430\u0437 Exchange \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u0422\u0430\u043a \u0436\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 \u043b\u044e\u0431\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0432 DAG (\u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435).<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 Zabbix. \u0410\u0433\u0435\u043d\u0442 Zabbix \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0444\u0430\u0439\u043b\u0430 &#8211; \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 &#8220;0&#8221;, \u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0431\u0430\u0437.<\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043a\u0430\u0436\u0434\u0443\u044e \u043c\u0438\u043d\u0443\u0442\u0443.<\/p>\n<p><!--more--><\/p>\n<p>\u0421\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre>cls\r\nadd-pssnapin Microsoft.Exchange.Management.PowerShell.E2010\r\nSleep 5\r\n$my_Path_File_StatusCheck = \"C:\\Script\\Exch_DB_Status\\dbStatus.txt\"\r\n$myVar_Error = 0\r\n$Array1 = Get-MailboxDatabase -Status | Get-MailboxDatabaseCopyStatus\r\nForEach ($Entry in $Array1) {\r\nWrite-host \u201c\u0411\u0430\u0437\u0430: \u201c$Entry.name \" ___ \" \"\u0421\u0442\u0430\u0442\u0443\u0441: \" $Entry.status\r\nIf (($Entry.Status -eq \"Mounted\") -or ($Entry.Status -eq \"Healthy\")){\r\nWrite-host \u201cOK\u201c\r\n}\r\nElse {\r\nWrite-host \u201cPROBLEM\u201c\r\n$myVar_Error = 1\r\n}\r\n}\r\nif ($myVar_Error -ne \"0\") {\r\n$Array1 | Select-Object name, status | export-csv $my_Path_File_StatusCheck -Delimiter \",\" -encoding utf8 -NoTypeInformation\r\nWrite-host \u201c-----\u201c\r\nWrite-host \u201cERROR\u201c\r\n}\r\nif ($myVar_Error -eq \"0\") {\r\nclear-content $my_Path_File_StatusCheck\r\nWrite-host \u201c----\u201c\r\nWrite-host \u201cNOT PROBLEM\u201c\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0431\u0430\u0437 Exchange. \u041e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0431\u0430\u0437, \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b. \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0431\u0430\u0437, \u0431\u0430\u0437 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043b\u044e\u0431\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0444\u0430\u0439\u043b \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0432\u0441\u0435\u0445 \u0431\u0430\u0437 Exchange \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u0422\u0430\u043a \u0436\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 \u043b\u044e\u0431\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0432 DAG (\u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435). \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f &#8230;<\/p>\n<p><a href=\"https:\/\/msbro.ru\/index.php\/archives\/5632\" class=\"more-link\">Continue reading &lsquo;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0431\u0430\u0437 Exchange&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,10],"tags":[1732,29,17],"class_list":["post-5632","post","type-post","status-publish","format-standard","hentry","category-exchange","category-scripts","tag-exchange","tag-exchange-2010","tag-powershell"],"_links":{"self":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/5632"}],"collection":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/comments?post=5632"}],"version-history":[{"count":2,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/5632\/revisions"}],"predecessor-version":[{"id":5634,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/5632\/revisions\/5634"}],"wp:attachment":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/media?parent=5632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/categories?post=5632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/tags?post=5632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->