Monitoring windows services in VisualBasic 6

370 pts.
Tags:
Visual Basic
I run an email server and have noticed that the POP server has started falling over about once every three to four weeks. I would like to write a VB routine to monitor the service every 30 mins or so and then if it's stopped to restart it. I have done numerous searches on google and can't find anything to point me in the right direction, everything seems to point to .NET which I don't have access to. Can anybody give me some pointers on where to look or what to look for. Thanks Jonathan
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

You seem to need an immediate answer. This is not the ultimate but will surely work for now.

Before you write your VB code, you can download and install IPCheck Server Monitor at https://searchsqlserver.techtarget.com/downloadPage/0,295339,sid87_gci1134634,00.html for server up and down time monitoring. Once this solves your problem, you can configure it to restart your server by perhaps calling your simple server-restrart code in VB.

You could alternatively download PrimalScript Professional 4.0 at https://searchsqlserver.techtarget.com/downloadPage/0,295339,sid87_gci1128378,00.html, a System Administrator Universal Development Environment. The learning curve is insignificant.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Invisflare
    Are you running your mail server on Windows NT? If you're running it on Win2000 and up, you should be able to use the Recovery tab on the service to force service restart (or even computer reboot) after service failure. If the service is indeed on NT, I used to use a piece of VBScript to monitor and restart services (w/ the help of NT scheduler of course). The key point is using WMI "W32_Service" instance's properties to check a service's status. Though you need a little work to get WMI (and maybe VBScript) installed on your NT box, depending on your configuration.
    0 pointsBadges:
    report
  • Invisflare
    Are you running your mail server on Windows NT? If you're running it on Win2000 and up, you should be able to use the Recovery tab on the service to force service restart (or even computer reboot) after service failure. If the service is indeed on NT, I used to use a piece of VBScript to monitor and restart services (w/ the help of NT scheduler of course). The key point is using WMI "W32_Service" instance's properties to check a service's status. Though you need a little work to get WMI (and maybe VBScript) installed on your NT box, depending on your configuration.
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: