Results 1 to 5 of 5

Thread: Help with checking a server's status

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    23

    Help with checking a server's status

    My problem is I need to detect if a server is running, I tried using detect if file exists and it worked just fine on my Administrator box, but when I tried it on a computer with less access it isnt working, so Im thinking I have a permisions problem with this method, is there any other way to check if another computer is up and running without detecting a folder or file? Here is what I have.

    VB Code:
    1. Dim TheFile2 As String
    2.             Dim Results2 As String
    3.  
    4.             TheFile2 = "\\mga-ts1\C$\Shell\testpacket.txt"
    5.             Results2 = Dir$(TheFile2)
    6.             '============================================
    7.  
    8.             'Change icons to display connectivity =======
    9.  
    10.             If Results2 = "" Then
    11.                 picMGATS1.Image = picDisabled.Image
    12.                 mgats1status = 0
    13.             Else
    14.                 picMGATS1.Image = picEnabled.Image
    15.                 mgats1status = 1
    16.             End If
    17.         End If

  2. #2
    Addicted Member corwin_ranger's Avatar
    Join Date
    Sep 2004
    Location
    CT
    Posts
    198

    Re: Help with checking a server's status

    Hi,

    I'm pretty new to the whole development thing, but I'm fairly knowledgeable as a Network Administrator.

    This process is going to run in the security context of the user logged into the PC. Generally speaking, a standard user is NOT going to have permission to access files through an administrative share like "\\mga-ts1\C$". As a test, from that user's PC with them logged in, just try to map a drive to \\mga-ts1\C$. If you can't, then that's your problem. If so, just create another share with the test file in it and assign permissions to everyone, or to a group that the users who have access to this application would be in (ex. \\mga-ts1\Test\) put the file here and change your code to match. This will allow you to test, and have a more "production" friendly solution that doesn't give users more access to a server than needed.

    Hope this helps,

    Steve

  3. #3
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: Help with checking a server's status

    You can also ping your server.

    Regards
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

  4. #4
    Addicted Member corwin_ranger's Avatar
    Join Date
    Sep 2004
    Location
    CT
    Posts
    198

    Re: Help with checking a server's status

    Asgorath,

    I had considered responding as you did. What I've discovered, however, is that a ping test isn't always a valid test regarding a server. There are any number of reasons why a server might be able to respond to a ping but not other requests. The most common reason is that the server is in a dealock condition, or simply "too busy" to respond to any other kind of request in a timely fashion. Checking for a file will at least establish that the server is responding to common "User" requests. I'm not suggesting that your answer is wrong, just that there are different ways to skin that cat and that no one way is perfect for all situations. I went along with the original poster's method because I didn't know enough to suggest an alternate method.

    Just my thoughts on why I approached it the way I did. My guess is, that if you ask this question of ten different people, who have different needs as it relates to a server, you'd get 10 different answers.

    Cheers,

    Steve

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    23

    Re: Help with checking a server's status

    Thanks for the help Steve What I had to end up doing was map the network drive on the Data Collection Machine and it works great now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width