SaaS CMS has officially launched! Learn more now.

Get server IP/name when running scheduled job



I would like to get the server IP address or name when running a scheduled job and return this in the job history. The reason for this is that we have a load balanced environment and would like to know which server in the environment executed the job.

Is this possible?



Jul 04, 2016 10:48

Hi Mark, 

As far as I know in load-balanced environments only one server should be running the schedule jobs. On all other servers, you should set enableScheduler="false" in applicationSettings in episerver.config.

Jul 04, 2016 11:41

Hi Shahid,

I believe the scheduler handles multiple servers so there is no need to set enableScheduler to false. Also, if that single server went down then none of the jobs would be run unless you updated the config file.

Jul 04, 2016 16:01

If anyone is interested I used Environment.MachineName which seems to do the trick

Jul 05, 2016 16:03

I think Shahid is right. What's the point running scheduler across multiple servers as all your Content Authoring server shares the same database. 

Jul 11, 2016 4:52
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.