none
How to monitor website FTP website in IIS5 using .net RRS feed

  • Question

  • I am trying to monitor website and FTP site hosted on IIS5. as well as windows services also.(To check is it started or stopped)?

    server is windows server 2000. 

    Below code is working in IIS8, but as per google search it will not work in IIS lower versions.

    Can any body guide me how could we monitor FTPwebsite and services hosted on IIS5.


        class Program
            {
                public enum SimpleServiceCustomCommands
                { StopWorker = 128, RestartWorker, CheckWorker };
                static void Main(string[] args)
                {
                    ServiceController[] scServices;
                    scServices = ServiceController.GetServices();

                    foreach (ServiceController scTemp in scServices)
                    {

                        if (scTemp.ServiceName == "Simple Service")
                        {
                            // Display properties for the Simple Service sample
                            // from the ServiceBase example.
                            ServiceController sc = new ServiceController("Simple Service");
                            Console.WriteLine("Status = " + sc.Status);
                            Console.WriteLine("Can Pause and Continue = " + sc.CanPauseAndContinue);
                            Console.WriteLine("Can ShutDown = " + sc.CanShutdown);
                            Console.WriteLine("Can Stop = " + sc.CanStop);

    Thanks in advance for your help.

            
    Thursday, June 1, 2017 4:42 PM

All replies

  • Why not? Service Manager is also available on Win2000. You just need to check the status of "msftpsvc" service.

    However, I think the most effective way is to connect to port 21 of target computer with System.Net.Sockets.TcpClient and then use a Timer to send null character ('\0') every 25 seconds. If failed and retry 3 times still failing, declare the FTP server dead.

    Friday, June 2, 2017 3:01 AM
    Answerer
  • Hi TCPK,

    If you want to retrieve web site information in the iis, you could try IIS ADSI Provider and DirectoryEntry, and the following article provide a sample for your reference.

    https://www.codeproject.com/Articles/99634/Use-C-to-manage-IIS

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 2, 2017 3:02 AM
    Moderator