SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Monitoring Windows NT/2000 services

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Monitoring Windows NT/2000 services
Author Message
Liz



Joined: 08 May 2003
Posts: 2

Post Monitoring Windows NT/2000 services Reply with quote

I found this script on this site and thought it
will be very useful for me in a SQL Server2000/Win 2000 environment.
How do I implement this script in my environment?

Thanks you.


Thu May 08, 2003 10:32 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7968

Post Re: Monitoring Windows NT/2000 services Reply with quote

Please provide a link to the script.

: I found this script on this site and thought it
: will be very useful for me in a SQL Server2000/Win 2000 environment.
: How do I implement this script in my environment?

: Thanks you.

Thu May 08, 2003 11:46 am View user's profile Send private message
Liz



Joined: 08 May 2003
Posts: 2

Post Re: Monitoring Windows NT/2000 services Reply with quote

Actually, here is the script below....

ServiceGetStatus "MSSQLServer"

// verify that the service is running or starting
Dim status, string
Dim running, boolean
ServiceGetStatus "MSSQLServer", status

IsEqual status, "RUNNING", running
IfThen running, DONE

IsEqual status, ""START PENDING", running
IfThen running, DONE

START_SERVICE:
ServiceStart "MSSQLServer"

// verify that the service is running or starting
ServiceGetStatus "MSSQLServer", status

IsEqual status, "RUNNING", running
If running, NOTIFY_OK, NOTIFY_FAIL

NOTIFY_OK:
MailSend "SMTP", "myname", "myspassword", "sysadmin@mycompany", &

"SQL-Server Restarted", "24x7 Scheduler detected that SQL-Server was not running and successfully restarted it"
exit

NOTIFY_FAIL:
MailSend "SMTP", "myname", "myspassword", "sysadmin@mycompany", &

"SQL-Server Restart Failed", "24x7 Scheduler detected that SQL-Server was not running, but was not able to restart it"

DONE:
// Done
Exit


Thu May 08, 2003 1:48 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7968

Post Re: Monitoring Windows NT/2000 services Reply with quote

Sorry, I must be missing something. Why you cannot run it as is in your "environment?" Please explain what you mean by "my environment."

Do you have 24x7 Scheduler installed on your system?
Do you know that this is JAL (Job Automation Language Script) which can be run by the 24x7 Scheduler as a script type job?

: Actually, here is the script below....

: ServiceGetStatus "MSSQLServer"

: // verify that the service is running or starting
: Dim status, string
: Dim running, boolean
: ServiceGetStatus "MSSQLServer", status

: IsEqual status, "RUNNING", running
: IfThen running, DONE

: IsEqual status, ""START PENDING", running
: IfThen running, DONE

: START_SERVICE: ServiceStart "MSSQLServer"

: // verify that the service is running or starting
: ServiceGetStatus "MSSQLServer", status

: IsEqual status, "RUNNING", running
: If running, NOTIFY_OK, NOTIFY_FAIL

: NOTIFY_OK: MailSend "SMTP", "myname",
: "myspassword", "sysadmin@mycompany", &

: "SQL-Server Restarted", "24x7 Scheduler detected that
: SQL-Server was not running and successfully restarted it"
: exit

: NOTIFY_FAIL: MailSend "SMTP", "myname",
: "myspassword", "sysadmin@mycompany", &

: "SQL-Server Restart Failed", "24x7 Scheduler detected that
: SQL-Server was not running, but was not able to restart it"

: DONE: // Done
: Exit

Thu May 08, 2003 4:53 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.