Expand my Community achievements bar.

SOLVED

workflow to check if the servers are running or down

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Level 5

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

View solution in original post

9 Replies

Avatar

Correct answer by
Level 5

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

Avatar

Level 2
Hi, Yes mentioned servers are running in AWS and I have credentials to connect. Do you mean add those details in External account under platform. If yes could you please provide any working example.

Avatar

Level 6

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

Avatar

Community Advisor

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

 

 


     Manoj
     Find me on LinkedIn

Avatar

Level 2
Hi, Through JS Activity, Could you please provide any working example. So that i can try on my end and test.

Avatar

Level 2
If could you please provide any example that would be really helpful for me. Note my servers are like, For example. 1. FirstServer.aws.cloud.epsilon 2. SecondServer.aws.cloud.epsilon Regards, Rajshekar

Avatar

Level 6

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

Level 2
Hi, I see it is though Explicit URL, Can an provide example for External Account also.