workflow to check if the servers are running or down

Avatar

Avatar

rajAdobeDev

Avatar

rajAdobeDev

rajAdobeDev

21-01-2020

Hi,

 

How do i check other servers which are connecting through remote desk top
Eg :
firstServer.aws.cloud.epsilon
secndServer.aws.cloud.epsilon

 

I need a workflow(JS Activity) to check if the above servers are running or down?
please help on that

 

Regards,
Raj.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

adithyacs86

Avatar

adithyacs86

adithyacs86

21-01-2020

Hi Raj, 

 

I am sorry if i understand your question correctly, do you want to test if the servers are up and running from AC?

or if you want to establish the connection to remote servers. 

Looking at the server details you provided, it is AWS machines, through an external account you can get the connection established once you have the proper credentials.

 

Let me know if this was helpful. 

 

Thanks,
Adithya

Answers (3)

Answers (3)

Avatar

Avatar

Florian_Courgey

MVP

Avatar

Florian_Courgey

MVP

Florian_Courgey
MVP

22-01-2020

Hey Raj,

 

With some JS you can run checks if servers are running:

20200121-172548-screenshot-31.jpg

Init code:

instance.vars.i = 0;

 

Advanced Javascript code (containing 2 transitions: "continue" and "end":

var array = [
  'https://www.google.com/',
  'https://blog.floriancourgey.com',
  'https://yahoo.com', // returns an HTTP 302 code
];

if(instance.vars.i >= array.length){
  task.postEvent(task.transitionByName('end'));
  return;
}

instance.vars.website = array[instance.vars.i];
instance.vars.i++;
task.postEvent(task.transitionByName('continue'));

 

Download config:

20200121-172829-screenshot-32.jpg

 

 Note: in the Adavanced parameters, you may allow 302 HTTP codes not to trigger an error.

 

 

The above results in the following log:

Starting workflow (operator 'Florian Courgey ()')
httpTransfer Starting transfer of 'https://www.google.com/' to 'www_20200121162521a.google.com.html'
httpTransfer Starting transfer of 'https://blog.floriancourgey.com/' to 'blog_20200121162522a.floriancourgey.com.html'
httpTransfer Starting transfer of 'https://yahoo.com/' to 'yahoo_20200121162522a.com.html'
Workflow finished

 

Best regards

Florian

Avatar

Avatar

_Manoj_Kumar

MVP

Avatar

_Manoj_Kumar

MVP

_Manoj_Kumar
MVP

22-01-2020

Hello Raj,

 

There are different ways to check if a server is up of running. If you want to check it with adobe campaign.

 

You can create the workflow and add a JS activity which will ping the server and get a response if the response is 503 then you can send yourself an alert  saying which server is down.

 

The other way is to use services like Pingdom and httpstatus.

 

Let me know if that helps.

 

Thanks,

Manoj

 

 

Avatar

Avatar

Florian_Courgey

MVP

Avatar

Florian_Courgey

MVP

Florian_Courgey
MVP

21-01-2020

Hi,

You can use some JS and a Web Download activity in a loop:

20200121-172548-screenshot-31.jpg

 The init contains:

 

instance.vars.i = 0;

 

The Advanced JS contains:

 

var array = [
  'https://www.google.com/',
  'https://yahoo.com',
  'https://blog.floriancourgey.com',
];
if(instance.vars.i >= array.length){
  task.postEvent(task.transitionByName('end'));
  return;
}
instance.vars.website = array[instance.vars.i];
instance.vars.i++;
task.postEvent(task.transitionByName('continue'));

 

with 2 transitions "continue" and "end".

 

Web download activity details:

20200121-172829-screenshot-32.jpg

This results in the following log:

 

Starting workflow (operator 'Florian Courgey (fcourgey)')
httpTransfer	Starting transfer of 'https://www.google.com/' to 'www_20200121162521a.google.com.html'
httpTransfer	Starting transfer of 'https://yahoo.com/' to 'yahoo_20200121162522a.com.html'
httpTransfer	Starting transfer of 'https://blog.floriancourgey.com/' to 'blog_20200121162522a.floriancourgey.com.html'
Workflow finished

 

Any error (HTTP code different from "200") will trigger the Alert.

 

Replace the Start with a Scheduler and you're all set.

 

Please let me know if it works for you

Best

Sources:

- loop in a workflow

- advanced js transitions explanation

- original topic in a comment by Raj Shekar