Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How do I log into a specific node or cancel a job on a node I'm not logged into?

StephenHey
Mega Guru

We've had to cancel some background jobs that were running longer than anticipated, but those jobs sometimes get put on a node that we're not logged into.   Depending on the severity, we have the whole team log in until they get the node it's running on (by checking all active transactions).

 

Is there any way to specify a node to log into as an admin or a way to see all jobs across all nodes?

1 ACCEPTED SOLUTION

nairvine
Giga Contributor

Hi,


You can use certain add-on's like "edit cookie" and many more. The cookie contains the sys id if of the node. Hence when you log in for the first time into service now the sys id is stored in the cookie which is used later to log in to the same node again.


Just get the sys id of the node you want to log in and make use of edit cookie to update the cookie with the new sys id.


Log in again and you should be taken to the desired node.



Thanks,


Vineeth


View solution in original post

17 REPLIES 17

Hello Stephen ,




Yes you can login into the specific node via setting "BIGipServerpool_InstanceName" Cookies value into ur browser.




To find out the node where that job is running check claimed by field in triggers.




Thanks - PP


This thread is a little old, but this question still comes up a lot. Technical not supported but very useful and will save you a call to support.



This python script will print a list of node names and their BIGipServerpool_InstanceName values for your instance. I like to use the EditThisCookie Chrome plugin, but there are others.



Hope this is useful.



Thanks, Brandon



import requests




def main():


  #Instance Name


  #Just update the instance value save and run.


  instance = 'demonightlyjakarta'




  #The stats.do will report the node name, plus it is quick to load.


  url = 'https://' + instance + '.service-now.com/stats.do'


  result_set = ''


  #Attempts 10 times to get the different nodes. This number may need to be increased if you have a larger instance.


  for l in range(1,10):


  r = getbigip(url)


  if r not in result_set:


  result_set = result_set + r + '\n'


  #Output the list of node and bigip values


  print result_set




def getbigip(url):


  node_bigip=''


  response = requests.get(url)


  # Check for HTTP codes other than 200


  if response.status_code != 200:


  print('There request failed with a status of ', response.status_code)


  exit()


  else:


  # Get the node name


  node_name = ''


  if '<br/>Connected' in str(response.content):


  node_name = str(response.content).split('<br/>Connected')[1].split('<')[0].split(':')[1].strip()


  else:


  print('There was an issue, could not parse the node name')


  exit()


  coo = response.cookies


  bigip = ''


  for k in coo.keys():


  if 'BIGip' in k:


  bigip = coo[k]


  if node_name <> '':


  if bigip <> '':


  node_bigip = 'Node: ' + node_name +'   |   BIGip Value: ' + bigip


  else:


  print('There was an issue, no big ip token was found in the header')


  print('Cookies', response.cookies)


  else:


  print('There was an issue, could not parse the node name from the /stats.do page')


  exit()


  return node_bigip




if __name__ == "__main__": main()










FYI - ServiceNow is migrating to ADCV2 in October 2020, a new Load Balancer technology, and our cookie will be changing from "BIGipServerpool_instancename" to "adcsession" cookie.

As mentioned above, direct cookie manipulation is not a documented/supported activity.