Guest

Cisco Unified MeetingPlace

MeetingPlace Web Daily IIS Log Management with an Automated Script

Document ID: 62144



Contents

Introduction
Prerequisites
      Requirements
      Components Used
      Conventions
Manage IIS Logs
      Log Management Script
      Apply the Management Script
NetPro Discussion Forums - Featured Conversations
Related Information

Introduction

The Cisco MeetingPlace Web Gateway is a web-based application that generates heavy traffic. The Microsoft IIS Web Server default setting automatically creates daily logs that record this web traffic.

Unless reconfigured by the system manager, the default location for these IIS log files is c:\winnt\system32\LogFiles\W3SVC1\. Unfortunately, IIS does not have a built-in feature to manage these log files (for example, regular deletion). As a consequence, these log files can accumulate to the point that they take up most of the root partition disk space, which leads to a server crash.

It is also strongly recommended that you reconfigure IIS to store logs on a partition other than the operating system (OS) root c: partition (if other drives are available).

Prerequisites

Requirements

Readers of this document should have knowledge of these topics:

  • Windows IIS Web Server configuration

  • Basic DOS and scripting

Components Used

The information in this document is based on these software versions:

  • Cisco MeetingPlace Web (all versions)

  • Microsoft IIS Web Server

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Conventions

For more information on document conventions, refer to the Cisco Technical Tips Conventions.

Manage IIS Logs

You can use the DOS script provided in this document to manage the number of IIS logs stored on your web server.

Log Management Script

You should use the Microsoft Task Scheduler utility to automate this batch program to run each month. The code is shown here:

@echo off

setlocal

REM This assumes your PC date is in the format Fri 09/10/2004, where 09 is the month.
REM This also assumes the log filename contains the month, such as ex100904.log, 
REM where 10 is date, 09 is month, and 04 is year.

REM Set thismonth to the two digits after the fourth character in the Fri 09/10/2004 string.
REM Make changes as necessary if your date format is different.

set thismonth=%date:~4,2%

REM Ignore the first digit of month if it begins with 0.

if {%thismonth:~0,1%}=={0} set thismonth=%thismonth:~1,1%

REM Set oldmonth to this month minus two months.

set /a oldmonth=%thismonth% - 2

REM Some manipulation is necessary to avoid negative number situations.
if %oldmonth% LSS 1 set /a oldmonth=%oldmonth% + 12
if %oldmonth% LSS 10 set oldmonth=0%oldmonth%

REM Delete all filenames that contains the oldmonth value.
del "c:\winnt\system32\logfiles\w3svc1\ex??%oldmonth%*.log"

endlocal

See the Apply the Management Script section for details on how to use this script.

Apply the Management Script

Complete these steps:

  1. Open Notepad and cut and paste the code into the document. Save the document as a .bat file (the suggested filename is del_old_logs.bat).

  2. Read the comments in the code to see how it works and how to modify it to match your deployment condition.

  3. Modify the code as shown here (it is assumed that your date stamp is in the format Fri 09/10/2004):

    • Change the 2 in set /a oldmonth=%thismonth% - 2 to the number of months' worth of IIS log you want to keep.

    • Modify the file path (c:\winnt\system32\logfiles\w3svc1) to reflect the actual location of your files. Confirm the filename format of your IIS log. It should follow the pattern exddmmyy.log, where dd represents the day, mm represents the month, and yy represents the year.

  4. Set up the Task Scheduler (Start > Programs > Accessories > System Tools) to run del_old_logs.bat on the 1st or 30th of each month.

NetPro Discussion Forums - Featured Conversations

Networking Professionals Connection is a forum for networking professionals to share questions, suggestions, and information about networking solutions, products, and technologies. The featured links are some of the most recent conversations available in this technology.
NetPro Discussion Forums - Featured Conversations for Voice
Service Providers: Voice over IP
Voice & Video: Voice over IP
Voice & Video: IP Telephony
Voice & Video: IP Phone Services for End Users
Voice & Video: Unified Communications
Voice & Video: IP Phone Services for Developers
Voice & Video: General

Related Information



Updated: Jan 31, 2006Document ID: 62144