Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reboot Script Help Needed

Status
Not open for further replies.

jojogogo

MIS
Mar 9, 2004
2
0
0
US
I have a MetaFrame XPe FR3 server farm. I am trying to figure out how to setup a reboot script for the servers so that it checks to see if there are users logged in with Active sessions before rebooting.

I have users globally and have a small window to reboot the servers in, but I would like to do this as seamlessly as possible. I'm no scripting guru but here is the basic logic I would like the script to follow:

DISABLE NEW METAFRAME LOGINS

NOTIFY USERS THAT THE SERVER WILL BE REBOOTED IN 15 MINUTES PLEASE LOGOUT

WAIT 15 MINUTES

CHECK TO SEE IF THERE ARE ANY ACTIVE USERS ON THE SERVER

IF ACTIVE USERS WERE FOUND THEN GOTO RE-ENABLE LOGINS

IF NO ACTIVE USERS WERE FOUND THEN REBOOT

RE-ENABLE LOGINS

END

I know that I may end up with a server that doesn't get rebooted at each scheduled time, but it is critical to prevent users from loosing data they are trying to input. I'm open to using VBSCRIPT or KIX or whatever anyone might suggest, but I'm having trouble finding the syntax necessary use the logic to check for active sessions. Any help is greatly appreciated!
 
jojogogo,

Unable to give you any direct scripting help, but I have had a similar situation whereby users were scattered all over the world, the actual window we have for normal working hours is 2 hours, this does not take into account people starting early or working late so we ended up with a tiered reboot cycle that requires a little extra work but has proved effective.

We have a 6 server farm and have spread the apps into three groups, a US, EU and AP (US Users, European/Africa and Asia Pacific)

Applications are published from each "pair" of regional servers for the relevant group of users. Now I realise this makes an effective mockery of Load balancing, but as our users were fairly equally split through the regions this worked very well for us.

Then its simply a case of rebooting the relevant server at a time convenient for that time zone US reboots at 1am Centrel Time, EU at 1am GMT etc.

We still do the warning messages, but since implementing this solution have never had a single complaint from a user that the server kicked them off during a reboot cycle.

Hope this helps,

Regards


Nostferatu

"Yesterday is History,
Tomorrow A Mystery,
Today is a gift,
That's why they call it the Present"
 
The logic seems sound with the exception of the fact that users can sit is an active idle state indefinitely unless you set parameters for idle timeout... If you have load balancing capabilities you can create a server load evaluator that shows full load when a single user is logged on (yourself) and then wait for the users to log off and connect to another server. This way you can patch the server or reboot it in the middle of the day instead of using a script. Otherwise TSSHUTDOWN.exe will help with the notification of users and countdown portions of your script.

Post what you have currently maybe that will help.
 
I run the following script, if anyone is on and working, they get more than enough notification:-

AT 03:15 u:\winnt\msg1.cmd
AT 03:20 u:\winnt\msg1.cmd
AT 03:25 u:\winnt\msg1.cmd
AT 03:30 u:\winnt\msg1.cmd
at 03:35 u:\winnt\msg2.cmd
AT 03:40 u:\winnt\msg3.cmd
AT 03:45 u:\winnt\system32\tsshutdn.exe /DELAY:120 /REBOOT
AT 04:00 u:\winnt\autoreb.cmd

Autoreb.cmd is the above script!!!!

Cheers,
Carl.

PS...Where are the comments from the original poster of this question???
 
Oh Yes:-

Msg1.Cmd

msg * "Server will reboot at 3:45am, Save your work and Log Off Please"

Msg2.Cmd

msg * "Server will reboot in 10 minutes, Save your work and Log Off Please"

Msg3.Cmd

msg * "Server will reboot in 5 minutes, Save your work and Log Off Please"

Cheers,
Carl.
 
Do you have resource manager installed? This comes with a reboot facility that can be tuned on a per server or per farm basis. It works for me and gives the users all the warning they could need.
 
Thanks for the feedback.

I'm not worried about giving users notification to logoff. That's an easy given. I'm more concerned about not interrupting there work and preventing the server from rebooting if anyone is logged on.
 
Hi,

Unless you are running 24x7, and must reboot, give them notice, it's only 5 minutes downtime!

I'd prefer to give them the messages above and then reboot regardless! At the end of the day (night) it's their choice to ignore the warnings, and I bet they only do it a handful of times!

You can only help users so much!!!!!!

Cheers,
Carl.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top