1

We have a windows service that was developped a while ago which use a lot of scheduled tasks on a distant server. This might seem like a bad idea and it probably is, but since we are working with another company that will only work like that to activate their system, we don't really have more choice than to go with it.

In order for this to happen, we we told to use SCHTASKS command, which can easily start a service on another distant server. We then store the output of this call to a log. Normally, we get this :

2012-02-06 09:40:55 : SUCCESS: Attempted to run the scheduled task "W_PALREI".

This is the normal message we get when everything is good. Sometime we get this :

2012-02-20 15:53:29 : INFO: scheduled task "W_PALMO2" is currently running.
SUCCESS: Attempted to run the scheduled task "W_PALMO2".

This is still nothing serious since we know the task can take up some time and we know it will get back to available soon. Sometime we get this :

2012-02-13 08:50:03 : INFO: Scheduled task "W_PALMO2" has already been disabled.

This is not good but we know this means someone disabled the tasks on the other server so we can act accordingly.

This is where it gets weird. We notices that after a while (about 2 weekes of continued running), the tasks would not respond. Everytime we checked it seemed everything was running fine (the service was running and we could see the content of our database being worked on), but the tasks would still not be started. When we looked at the log file, we found this :

2012-02-22 15:50:15 : ERROR: Class does not exist.

And after a while, we got this message :

2012-02-22 15:21:15 : ERROR: Not enough storage is available to process this command.

Then the other message appears after and so on. After a while, we simply get this

2012-02-22 16:32:38 : 

Meaning either the Process.Start no longer get the ouptut, either the SCHTASKS no long send it or the process stop being called for some reason. I looked on Google but can't really find anything about SCHTASKS giving out this so I suspect process.start might be the problem

did anybody ever got this and how to correct this ? Or is it the process start and is there any other way to correctly start a task from a distant server, providing you have the credentials... ?

Any other thins we might want to check on the server to diagnose the problem ? Thanks,

David Brunelle
  • 6,528
  • 11
  • 64
  • 104

1 Answers1

1

Or is it the process start and is there any other way to correctly start a task from a distant server, providing you have the credentials... ?

There are a number of ways to start processes remotely...a couple of options come to mind:

  • Remote execution of Power Shell scripts. However, if the company is having you automate scheduled tasks from a remote location, odds aren't great that they will be savvy and/or willing to set up this for execution.
  • What exactly does your Process.Start call look like? There might be some other ways to structure this call.

Someone needs to do some more diagnostics on the remote machine. Or just come up with a plan to power cycle the machines every n days.

Some places to look:

  • The Event Log. See if any errors are getting logged there.
  • PerfMon. Monitor memory usage to see if memory isn't getting cleaned up.
RQDQ
  • 15,461
  • 2
  • 32
  • 59