Git Product home page Git Product logo

windows.server.webservice.logdirectorywatcher's Introduction

Monitor Webservers Log directories

Management Pack which monitors the webserver's log directory size and rotates the logs on demand.

Introduction:

IIS, Apache and Tomcat can write log files. Often, these files occupy large space cause a disk filling up. This Management Pack discovers log-folders and raises alerts based on thresholds. - Thresholds and alert behavior can be overridden as usual.

State Views:

StateView_WebSites

Alert Views:

AlertView_WebSites

Recoveries:

Recoveries

Performance Rules:

Recoveries

More information on:

Documentation

Downloads:

ManagementPack-Sealed

ManagementPack-UnSealed

Source for VSAE 2017

Community Management Pack:

Keep this and many other management packs automatically up to date by installing the Community Management Pack

License Terms

Windows.Server.Webservice.LogdirectoryWatcher Copyright (C) 2018 Ruben Zimmermann (Juanito99)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

windows.server.webservice.logdirectorywatcher's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

windows.server.webservice.logdirectorywatcher's Issues

Volatile Properties

Hi
Looking at class Windows.Server.Webservice.LogdirectoryWatcher.WebSite.Base, I noticed that it contains at least 4 volatile properties: LogDirModifiedDate,LogDirScanDate, LogDirSizeInMB, LogDirNoOfFiles.

As per https://social.technet.microsoft.com/wiki/contents/articles/14256.operations-manager-management-pack-authoring-classes-and-relationships.aspx#Properties_that_Update_Too_Frequently you should not have properties in classes that change often (as it may cause config churn -- Some post from Kevin Holman). Logically those properties will change every time the discovery will run (every 14400 seconds).

Unless needed, I would recommend you stop discovering them..

HTH

Exception calling "Parse" with "1" argument(s): "Input string was not in a correct format."

User reported:

I got an error on the script on one exchange machine in my testscom:
System.Management.Automation.MethodInvocationException: #Exception calling "Parse" with "1" argument(s): "Input string was not in a correct format."At line:113 char:4

  • $webLogDirSizeMB = [double]::Parse(([Math]::Round((( ...

at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at Microsoft.EnterpriseManagement.Common.PowerShell.RunspaceController.RunScript[T](String scriptName, String scriptBody, Dictionary`2 parameters, Object[] constructorArgs, IScriptDebug iScriptDebug, Boolean bSerializeOutput)

Skriptnamn: MonitorLogDirectoryThreeState.ps1

Some logdirectorys come back with no size

Example oif one working and one that is not working.
PS C:\admin> $webLogDirectory2 = "D:\logs\W3SVC16"

PS C:\admin> ((Get-ChildItem -Path $webLogDirectory2 | Measure-Object -property length -sum).Sum / 1MB)
66,0026407241821

PS C:\admin> [double]::TryParse(([Math]::Round(((Get-ChildItem -Path $webLogDirectory2 | Measure-Object -property length -sum).Sum / 1MB), 1)),[ref]$webLogDirSizeMB)
True

PS C:\admin> $webLogDirSizeMB
66

PS C:\admin> $webLogDirectory = "D:\logs\W3SVC14"

PS C:\admin> ((Get-ChildItem -Path $webLogDirectory | Measure-Object -property length -sum).Sum / 1MB)
129,689879417419

PS C:\admin> [double]::TryParse(([Math]::Round(((Get-ChildItem -Path $webLogDirectory | Measure-Object -property length -sum).Sum / 1MB), 1)),[ref]$webLogDirSizeMB)
False

PS C:\admin> $webLogDirSizeMB
0

PS C:\admin> [double]::TryParse([Math]::Round(((Get-ChildItem -Path $webLogDirectory2 | Measure-Object -property length -sum).Sum / 1MB), 1))
Cannot find an overload for "TryParse" and the argument count: "1".
At line:1 char:1

  • [double]::TryParse([Math]::Round(((Get-ChildItem -Path $webLogDirecto ...
  •   + CategoryInfo          : NotSpecified: (:) [], MethodException
      + FullyQualifiedErrorId : MethodCountCouldNotFindBest
    
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.