Click here to Skip to main content
15,435,438 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Is it possible to add fore ground and back ground to any app that is down? Pin
Richard Deeming1-Sep-21 21:47
mveRichard Deeming1-Sep-21 21:47 
GeneralRe: Is it possible to add fore ground and back ground to any app that is down? Pin
samflex2-Sep-21 3:02
Membersamflex2-Sep-21 3:02 
Questionproject code in .net for online banking transaction Pin
Jk 0724-Aug-21 5:12
MemberJk 0724-Aug-21 5:12 
AnswerRe: project code in .net for online banking transaction Pin
Richard MacCutchan24-Aug-21 5:40
mveRichard MacCutchan24-Aug-21 5:40 
GeneralRe: project code in .net for online banking transaction Pin
Member 1534301831-Aug-21 22:04
MemberMember 1534301831-Aug-21 22:04 
QuestionI am having problem creating a script to monitor Rest/API services. Pin
samflex23-Aug-21 8:11
Membersamflex23-Aug-21 8:11 
AnswerRe: I am having problem creating a script to monitor Rest/API services. Pin
Richard Deeming23-Aug-21 21:15
mveRichard Deeming23-Aug-21 21:15 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex24-Aug-21 5:08
Membersamflex24-Aug-21 5:08 
Hi Richard,

As always, thank you sir for your continued assistance.

I *think* this console app will do the trick:

using System.Net.NetworkInformation;
public static void ServerStatusBy(string url)
        {
            Ping pingSender = new Ping();
            PingReply reply = pingSender.Send(url);

            Console.WriteLine("Status of Host: {0}", url);

            if (reply.Status == IPStatus.Success)
            {
                Console.WriteLine("IP Address: {0}", reply.Address.ToString());
                Console.WriteLine("RoundTrip time: {0}", reply.RoundtripTime);
                Console.WriteLine("Time to live: {0}", reply.Options.Ttl);
                Console.WriteLine("Don't fragment: {0}", reply.Options.DontFragment);
                Console.WriteLine("Buffer size: {0}", reply.Buffer.Length);
            }
            else
                Console.WriteLine(reply.Status);
   }


Then this will be the call:

Console.Write("Enter server url:");
            var url = Console.ReadLine();
            Console.Clear();
            ServerStatusBy(url);
            Console.ReadLine();


I have some questions please.

1, There are 5 API servers as indicated and I can schedule this to run on each server, fine.

However, can you help with not having to interact with the app?

We don't want to have to enter server url in order to get the status.

We just want the app to contact the URL automatically.

So could that mean something like this:

public static void ServerStatusBy(string url)
url = "https://www.something.com/REST" for example?


The second question that I have is that I can essentially write something like:

if (reply.Status == IPStatus.Success)
            {
Console.WriteLine("Server APP One is running");
}
else
{
Console.WriteLine("Server APP One is running");
}


Once again, thank you very much sir for your help.
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
David Mujica24-Aug-21 6:04
MemberDavid Mujica24-Aug-21 6:04 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex24-Aug-21 6:09
Membersamflex24-Aug-21 6:09 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex25-Aug-21 4:18
Membersamflex25-Aug-21 4:18 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
David Mujica25-Aug-21 5:24
MemberDavid Mujica25-Aug-21 5:24 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex25-Aug-21 6:09
Membersamflex25-Aug-21 6:09 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
Richard Deeming25-Aug-21 6:18
mveRichard Deeming25-Aug-21 6:18 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex25-Aug-21 8:23
Membersamflex25-Aug-21 8:23 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
Richard Deeming25-Aug-21 22:12
mveRichard Deeming25-Aug-21 22:12 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex26-Aug-21 3:04
Membersamflex26-Aug-21 3:04 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
Richard Deeming26-Aug-21 3:52
mveRichard Deeming26-Aug-21 3:52 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex26-Aug-21 4:04
Membersamflex26-Aug-21 4:04 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex26-Aug-21 5:08
Membersamflex26-Aug-21 5:08 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
Richard Deeming26-Aug-21 5:19
mveRichard Deeming26-Aug-21 5:19 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex26-Aug-21 6:41
Membersamflex26-Aug-21 6:41 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
Richard Deeming26-Aug-21 21:28
mveRichard Deeming26-Aug-21 21:28 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
samflex27-Aug-21 3:21
Membersamflex27-Aug-21 3:21 
GeneralRe: I am having problem creating a script to monitor Rest/API services. Pin
Richard Deeming27-Aug-21 4:10
mveRichard Deeming27-Aug-21 4:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.