From your question it is hard to see what exactly you want to achive but you can take a look at the HealthCheck in ASP.NET Core here. You can also take a look at this example.
How to extract the application status info using Process class
You can use the Process class from the System.Diagnostics namespace in order to extract this information from the server where you application process is running. Here you can see the implementation of the Process.cs class.
For memory you can simple use one of the properties:
Process.GetCurrentProcess().PrivateMemorySize64;
Process.GetCurrentProcess().VirtualMemorySize64;
Process.GetCurrentProcess().WorkingSet64;
For getting CPU usage:
There are some properties from Process class which you can use for example:
Process.GetCurrentProcess().TotalProcessorTime
But if you want to get it in percentage you can calculate it yourself. Here is an example how you can do it.