jamess

Web based Maintenance Mode Scripts

Discussion created by jamess on Jun 17, 2009
Latest reply on Jul 31, 2009 by jamess

This is my first post, so go easy on me if I'm not doing it right. :smileyhappy:

I've written a set of tools that we use to get servers into maintenace mode.  That is, to automatically create a Pre-processing Rule to drop all alerts.  It also clears any open alarms.

Maintenance mode will do the following:
. Create pre-processing rule for the Message Mask (this gest most alerts)

. Create pre-processing rule for the Hostname Mask (this gets the rest, ie. for disk space alerts that don't have the hostname in the message string)

. Close all alarms that are already triggered by the host you're adding

. An email will be sent when you add or remove anything to/from maintance mode

. The user who put the server into maintenance mode will be listed, as well as the date it was entered.

. You must have the proper security permissions to be able to use this tool (ie. be in the Administrators security group)

. This uses RegEx, so adding "sjclvappl" to maintenance mode will add ALL sjclvappl servers. (ie. sjclvappl001, sjclvappl002, etc.)

. This also means that if you put "s" into maintenance mode, ALL servers that have an S in the name will be in maintenance mode. So please be careful


Ok, here is the files I use to add and remove a server from maintenance mode within Nimbus:
index.html - just lets you choose whether you will be adding or removing something from maintenance mode
add.pl - Perl script to add to maintenance mode
remove.pl - Perl script to remove from maintenance mode
pass.cfg - file containing the nimbus administrators password (management didn't want it in the script)

I use PERL.  I'm no PERL expert, but it works for us as it is.

The perl modules used are as follows:
Tie::File;
CGI qw/:standard/;
CGI;
Net::smileyfrustrated:MTP;
DBI;

I use the username and security credentials of the user logged onto the webpage to get and edit the nas configuration.
I use the Nimbus administrator account to restart the NAS and close all nimbus alarms.

IIS Settings.  Currently we have a subfolder specifically for maintenance mode.
disable anonymous access
enable Basic authentication
enter the default domain

This will allow only users that have proper permissions to add or remove a server from maintenance mode.

Just a note, I don't think it's neccissary anymore, but I don't really want to test it because everything is working now.  I do have permissions for c:\windows\system32\cmd.exe set to allow the Internet Guest Account for Read & Execute.

Please let me know if anything doesn't work.  I think I covered everything.

Oh, I also have three similar scripts.  One can put servers into maintenance for a certain amount of time, such as 5 minutes, 24 hours, etc.  It uses windows scheduled tasks for that.  Another allows you to put a server into maintenance mode from the command prompt.  The last allows lesser privilaged users to put server groups into maintenance mode.  This is useful if you have someon that, for example, works on a certain farm, and needs to deploy and reboot all of them.

The last script I have emails our team daily reminding us which servers are in maintenance mode.

Let me know if you are interested in seeing any of those other scripts.

Also, I'm interested in how useful this is to people.  We've found it very useful.

Outcomes