ASP.Net Restart IIS - iis

Long story short -- we have 2 webservers that run a 3rd party asp.net application. Randomly (so far) they just...stop working. I have an outside check that will tell me when it stops working within a minute or so. Right now I have to get onto the machines through RDP and issue an iisreset. Which is fine until I'm not at a machine and I have to get to one PDQ.
I wrote a simple page that will issue an iisreset on the offending remote machine(s). This works, usually. Sometimes "iisrestart \machinename" will stop the IIS service, but not restart it, which is bad.
Ideally, I'd like to know if I can just stop the service, try to start it, and if it doesn't start in 10 seconds, try to start it again. But I don't know how to monitor the status of a service remotely.
Can someone point me in the right direction?

This is the right direction: VBScript and WMI to stop, monitor, start the service on the remote machine.

Related

Google VM - process persistence

I have a Google VM, and i can start a web server. The command i issue is: python server.py.
My plan is to have the application running.
Since i will eventually close my pc (and thus the terminal), will the application continue running normally?
Or, do i have to start the server and then use disown, to make the app run in the background?
NOTE: If the second option is the case, does this mean that when i re-log in, and i want to shut down the server, the only way to do it is with pkill?

Openstack horizon issues not starting up

I have installed a openstack sigle mode in my vm, but when I restart the vm I cant log in to the horizon web page.
Any ideas?
thanks.
Looks like you are using devstack, right? When you restart your VM, some of devstack services are failing, so Horizon cannot connect to these services.
You should go to the screen sessions and go through all windows to restart all services.
Now so long ago you were able to run ./rejoin_stack.sh, but is was removed because it does not do this job right (look like).
So I believe it would be better for you to run ./unstack.sh and stack.sh again.
As said in the same question
DevStack is not meant and should not be used for running a cloud.

Azure Server Incaccessible

One of my 10 Azure VMs running windows has suddenly became inaccessible! Azure Management Console shows the state of this VM as "running" the Dashboard shows no server activity since my last RDP logout 16 hours ago. I tried restarting the instance with no success, still inaccessible ( No RDP access, hosted application down, unsuccessful ping...).
I have changed the instance size from A5 to A6 using the management portal and everything went back to normal. Windows event viewer showed no errors except the unexpected shutdown today after my Instance size change. Nothing was logged between my RDP logout yesterday and the system startup today after changing the size.
I can't afford having the server down for 16 hours! Luckily this server was the development server.
How can I know what went wrong? Anyone faced a similar issue with Azure?
Thanks
there is no easy way to troubleshoot this without capturing it in a stuck state.
Sounds like you followed the recommended steps, i.e.:
- Check VM is running (portal/PowerShell/CLI).
- Check endpoints are valid.
- Restart VM
- Force a redeployment by changing the instance size.
To understand why it happened it would be necessary to leave it in a stuck state and open a support case to investigate.
There is work underway to make both self-service diagnosis and redeployment easier for situations like this.
Apparently nothing is wrong! After the reboot the machine was installing updates to complete the reboot. When I panicked, I have rebooted it again, stopped it, started it again and I have even changed its configuration thinking that it is dead. While in fact it was only installing updates.
Too bad that we cannot disable the automatic reboot or estimate the time it takes to complete.

Azure RDP hangs in few seconds

Windows Azure, RDP for web/worker roles configured successfully. All works fine, I can connect to servers via RDP. I can see logon screen, desktop and so on. But after 3..10 seconds everything freezing. It's seems like disconnect. After reconnection it's all the same: I can work for 3..10 seconds. What should I do to fix it?
Solution:
This trouble was because of restarting. So before connecting via RDP try to stabilize node first :)
Does the role stay in a running state? I have RDP'ed into many instances of both Web and Worker roles and I have not seen this behavior.
Do you have any other details that you can share? Have you installed/modified anything as a Startup task that might be causing an issue? Have you tried from another client computer?
It looks like a connection problem. I suggest you contact with the MS support, give them your subscription ID and deployment ID, then the MS will go to your machine to verify deeply.

Restart WaWorkerHost on Azure (via RDP)

I have an Azure worker that works fine locally but crashes on live fabric. I want to hook up a remote debugger, but I can't because the program crashes before I can RDP in and attach a debugger.
Is there a way to manually restart WaWorkerHost.exe without restarting the system?
You can kill WaWorkerHost, it will be restarted automatically by WaHostBootstrapper (just give it a minute).
Responding to your comment:
If I understand you correctly you should
first deploy an empty worker (or one that does not crash)
connect to your role instance (remote desktop)
then deploy with the binaries you want to test.
A blog series on connecting debugger under azure (Putting here for other peoples reference I guess you have got this far)
http://blogs.u2u.be/peter/post/2011/06/21/Remote-debugging-an-Azure-Worker-role-using-Azure-Connect-Remote-desktop-and-the-remote-debugger.aspx
Now to the problem at hand what I would surgest doing is getting your worker to suspend it self in the startup code until the debugger is attached and logging.
So you can just use the following property and method. I would sleep the thred as well while waiting.
while (!(System.Diagnostics.Debugger.IsAttached && System.Diagnostics.Debugger.IsLogging()))
{
System.Threading.Thread.Sleep(1000);
}

Resources