AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
DAX
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.04.2017, 23:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: Check the Health of Your Retail Service in Dynamics 365 for Operations with PowerShell
Источник: https://stoneridgesoftware.com/check...th-powershell/
==============

A Production environment for Dynamics 365 for Operations (D365) is hosted by Microsoft and the underlying physical virtual machines are not exposed to the client. This is in stark contrast to a UAT, Test or Dev environment hosted by Microsoft for D365. The latter environments expose the RDP connection information as well as credentials which allow direct access to the VM’s as well as the underlying AOS services. This can make troubleshooting live issues a challenge in some scenarios when logging into a server is not possible.

If you have a Dynamics 365 for Operations with Retail deployment, it can be especially critical to be able to quickly check the health of the Retail Service (real-time service).  The real-time service is the backbone for the Microsoft Point of Sale (MPOS) client. It provides the communication channel between MPOS and the retail channels. Lifecycle Services (LCS) provides an Environment Monitoring portal for each service (the Retail Server is shown below), however, this requires logging into LCS, navigating to the Environment Monitoring Page and clicking on the Retail server.  You could bookmark the page for faster access, but this still won’t select the specific service view as it defaults to the AOS view.



A quick real-time service check can be performed by:
  1. Opening a web browser
  2. Entering: https://[PROD_URL]/healthcheck?testname=ping
  3. Hitting enter
This will perform a quick ping check on both the database and real-time service.  The results will show if the database and real-time service is up:



Or down:



Monitoring

With PowerShell, you could create a simple script that checks the service state, schedule it in Windows Task Scheduler to check it on a specific frequency and get failure notifications via email.  Here is a simple example of how you might accomplish this. Please note that this is a very basic example and is simply meant to demonstrate how you might accomplish this task in a few lines of code.  In a production scenario you would want a more robust solution and would not want to be prompted for credentials to email out the notification (for example use an encrypted file for the -Credential parameter rather than entering it as shown in the code below):

#Check the status of D365 Database and Retailtime Service$retailServiceCheck = Invoke-WebRequest -URI https://prod.operations.dynamics.com...e=ping#DBCheck Results Text$DBCheck = @($retailServiceCheck.ParsedHtml.getElementsByTagName("Table")).rows[1].cells[2].innertext#RetaltimeServiceCheck Results Text$RealtimeServiceCheck = @($retailServiceCheck.ParsedHtml.getElementsByTagName("Table")).rows[2].cells[2].innertextIF($DBCheck -ne "Success"){ $sendEmail = $true $subject = "CRITICAL - D365 PING Failure!" $body = "Dynamics 365 for Operations DBCheck Failed. Status is - $DBCheck"}ELSEIF($DBCheck -ne "Success"){ $sendEmail = $true $subject = "CRITICAL - D365 PING Failure!" $body = "Dynamics 365 for Operations RealtimeSerivceCheck Failed. Status is - $RealtimeServiceCheck"}Send-MailMessage -SmtpServer 'smtp.office365.com' -from Me@mytenant.com' -to 'Me@mytenant.com' -body $body -bodyashtml -Priority High -UseSsl -Subject $subject -Credential Get-CredentialAnd here is the email notification informing you of an outage condition:







Источник: https://stoneridgesoftware.com/check...th-powershell/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
stoneridgesoftware: Dynamics 365 and Microsoft AppSource – What does it mean for clients? Blog bot DAX Blogs 0 14.07.2016 01:14
stoneridgesoftware: Dynamics AX DIEF error: Package Execution Failed Please Check Event Log in DMF Service Box Blog bot DAX Blogs 0 26.05.2016 18:11
german_nav_developer: Buildnummern-Übersicht Microsoft Dynamics NAV 2013 Blog bot NAV: Blogs 0 15.05.2016 18:12
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 16 Blog bot Dynamics CRM: Blogs 0 23.01.2014 03:15
Freddys: Multiple Service Tiers Blog bot Dynamics CRM: Blogs 0 30.10.2008 01:59
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 17:37.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.