Giter VIP home page Giter VIP logo

windows.server.webservice.logdirectorywatcher's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

windows.server.webservice.logdirectorywatcher's Issues

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
    
    

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

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.