November Happy Hour will be moved to Thursday December 5th.

Get server IP/name when running scheduled job

Vote:
 

Hi,

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?

Thanks,

Mark

#150935
Jul 04, 2016 10:48
Vote:
 

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.

#150937
Jul 04, 2016 11:41
Vote:
 

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.

#150945
Jul 04, 2016 16:01
Vote:
 

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

#150963
Jul 05, 2016 16:03
Vote:
 

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

#151069
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.