need to monitor port on my PC
Results 1 to 6 of 6

Thread: need to monitor port on my PC

  1. #1
    Senior Member
    Join Date
    Feb 2002
    Posts
    518

    need to monitor port on my PC

    Im running a specialized application on my PC that crashes quite often. I need to monitor the port it uses (4000) and when it does go down I want to automate the restart of the service.
    This is on windows 2000 server...
    things Ive done so far:
    added it as a service
    told win2000 to restart the service every time it fails (but, it doesnt detect when it stops respondingto port 4000)
    Ive looked into whatsup gold, and that dont seem to poll port 4000.
    any suggestions?
    Remember -
    The ark was built by amatures...
    The Titanic was built by professionals.

  2. #2
    Purveyor of Lather Syini666's Avatar
    Join Date
    Aug 2001
    Posts
    553
    hmm, you could try comparing the firewall log against the Application Log, it could possibly give you some useful information.
    You're not your post count, You're not your avatar or sig, You're not how fast your internet connection is, You are not your processor, hard drive, or graphics card. You're the all-singing, all-dancing crap of AO
    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786
    CHECK.BAT =

    NETSTAT >THERE.TXT

    FIND /C "IDENTIFYING.CHARACTERS LISTENING" there.txt >COUNT.BAT

    CALL COUNT.BAT



    ----------------------

    0.BAT =

    NET SEND MYCOMPUTERNAME "The stupid program stopped again"

    stupidprogram.exe


    ----------------------

    re-direct netstat to there.txt

    find /c will search the text for the the number of times the string appears.

    re-direct the return to count.bat

    set check.bat to go off every x number of minutes

    as long as the number that gets placed in count.bat is not zero it will be trying to run an app nambed '1' as soon as '0' is the cammand that it calls it will run 0.bat which will send you a message.

    you could even have 0.bat call a CSCRIPT to open the app again if thats what you want.
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  4. #4
    Junior Member
    Join Date
    Sep 2002
    Posts
    20
    You could also use ethereal, wich is a free software that allow you to 'sniff' what's going on your network :-) If you use a port, I guess there is some communication going on, and if there is communication, there is network packets, and to sniff packets, there is http://www.ethereal.com :-)
    Code free or die.

  5. #5
    Senior Member
    Join Date
    Aug 2002
    Posts
    651
    One other idea is to try using portmon from the Sysinternals site. It monitors port activity for you with a handy interface. I haven't had the chance to use it, but their other tools work pretty well. It won't send an alert or restart the service, but maybe it will help you to get an idea what's going on with the traffic to your port(s). Hope this helps...
    Opinions are like holes - everybody\'s got\'em.

    Smile

  6. #6
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786
    my appologies avenger_jcc.

    it was pointed out to me i made a mistake.

    instead of:

    FIND /C "IDENTIFYING.CHARACTERS LISTENING" there.txt >COUNT.BAT

    should hace been:

    type there.bat |find /C "machname:4000" >count.bat

    unless the file is piped threw "find" to creat count.bat the results will always include the filename first, defeating the purpose.
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

Posting Permissions

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