Select to view content in your preferred language

Testing a windows VM for proper startup of ArcGIS Server following a reboot.

48
3
Jump to solution
4 hours ago
berniejconnors
Frequent Contributor

Hello,

We have three ArcGIS Servers in a site running on Windows Server 2016 VMs.  We reboot our ArcGIS Server VMs twice a week on a schedule.  We only reboot 1 VM per night.  Occassionally, ArcGIS Server fails to start after a reboot and it will get marked "unhealthy" by the web adaptors and it will be excluded from incoming requests.

I would like to create a script to test the VM for a healthy ArcGIS Server following a reboot.  If an unhealthy state is detected the script should correct the problem, possibly even reboot the VM.

Has anyone created a script like this?

Thanks,

Bernie.

0 Kudos
1 Solution

Accepted Solutions
CodyPatterson
MVP Regular Contributor

Hey @berniejconnors 

Ah I understand now, sorry about that! If your VM reboots at the same time every time, you can setup a Scheduled Task on that server after the server reboots, or another server 10~ or so minutes after so to be sure that everything lines up. Once done, you can setup a Powershell script to execute rebooting that server like this link here explains:

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/restart-computer...

Once that's setup, you'd be able to reboot the server in that case, I would check to see if it is successfully rebooted, and then after the conditional send the restart if not successful.

Hope that helps!

Cody

View solution in original post

3 Replies
CodyPatterson
MVP Regular Contributor

Hey @berniejconnors 

Following a reboot, you can make a request using Python's requests library to perform a GET request to this URL https://machine.domain.com/webadaptor/rest/info/healthcheck?f=json (replacing the data with your own server) and it will return the JSON response to your request, which you can check and send an email or reboot the VM if it's not "true".

Here is the documentation link if this helps! https://developers.arcgis.com/rest/services-reference/enterprise/health-check/

Cody

0 Kudos
berniejconnors
Frequent Contributor

Thanks for the response @CodyPatterson.  I am aware of the Health Check URL.  I was more interested in some guidance on how to implement this on a Windows VM so the script would trigger following a reboot.  What language to use?  How to force a reboot in a script? etc.  I would imagine it should be tricky to force a reboot.

Bernie.

0 Kudos
CodyPatterson
MVP Regular Contributor

Hey @berniejconnors 

Ah I understand now, sorry about that! If your VM reboots at the same time every time, you can setup a Scheduled Task on that server after the server reboots, or another server 10~ or so minutes after so to be sure that everything lines up. Once done, you can setup a Powershell script to execute rebooting that server like this link here explains:

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/restart-computer...

Once that's setup, you'd be able to reboot the server in that case, I would check to see if it is successfully rebooted, and then after the conditional send the restart if not successful.

Hope that helps!

Cody