-2

I have a scenario with 3 servers: A, B and C. The server A contains a C# Windows Service that regularly pings servers B and C. The problem is that server A doesn't reach server C (firewall issues). Server B reaches server C with no problem.

Is it possible, programmatically in C#, from the Windows Service on server A, to log on in server B and ping server C?

Fernando
  • 2,123
  • 4
  • 17
  • 21
  • the answer is yes, but you need more details/code for it to be good SO question. There is also likely better ways to do what you want (serverfault.com maybe place to ask you actual question). – Alexei Levenkov Apr 24 '13 at 18:52
  • I'm using this code to execute the ping: http://stackoverflow.com/questions/11800958/using-ping-in-c-sharp – Fernando Apr 24 '13 at 19:03
  • Server A is Windows, servers B and C are Linux – Fernando Apr 24 '13 at 20:09

1 Answers1

2

You could telnet into server B and ping C, and capture the output.

Mark Bertenshaw
  • 5,594
  • 2
  • 27
  • 40
  • 1
    I mean programmatically with C#, not manually.. – Fernando Apr 24 '13 at 19:04
  • Well, since ping can only happen from one host to another, you need a work-around. There will have to be a piece of software on B which will perform the actual ping to C. – Mark Bertenshaw Apr 24 '13 at 19:16
  • 1
    +1: @Fernando - how "telnet into server B" is not valid suggestion? Telnet is very simple protocol to use and can be used from C# code just fine. Note: I'd build webservice/site instead of enabling telnet (similar to many remote ping/proxy services on the net). – Alexei Levenkov Apr 24 '13 at 19:20
  • Alexei - I didn't know it is possible to telnet the server B from A and execute a ping from B to C. Do you know how to do that with C#? – Fernando Apr 24 '13 at 19:46