Windows Vista Forums

Powershell script for measuring performance of servers over time

  1. #1


    guv Guest

    Powershell script for measuring performance of servers over time

    I need assistance with a script to check performance on our servers such as
    cpu, memory, disk and network.

    I have been using some of the win32 classes below:



    win32_perfrawdata_perfos_memory to get availableMbytes
    win32_perfrawdata_perfos_processor to get processortime
    win32_perfrawdata_perfos_disk to get disktime
    win32_perfrawdata_perfdisk_physicaldisk to ge disktime
    win32_perfrawdata_perfdisk_logicaldisk to get freespace
    win32_perfrawdata_perfos_system to get systemuptime
    win32_perfrawdata_termservice_terminalservicessession to get processor time
    win32_perfrawdata_tcpip_nbtconnections to get bytes per second

    When I use the above classes with get-wmiobject I can get values on
    mentioned above properties, but it does not tell you much, you want to get a
    sample of values, such as get a average value over a period of time such as
    1 hour. How can I combine the above in a script which will give me the
    average values I am looking for. Is there a script I can download which is
    already setup for performance counters.

    Also is it possible to to get average values for the last 7 days or maybe
    setup a script which will take averages in the next 7 days.

    In terms of the values I am looking for values which are readable such as
    memory in available GB/MB but not with a long integer value which looks
    confusing. Also other values as well which looks easy to understand like
    processor time in % and freespace in GB and system uptime in days and hours.

    Also there is a timestamp value as part of the properties of the classes
    above, do you know what this means and how it can be used.

    Sorry for the many questions, but I would really like to get a script setup
    to get this required information.





      My System SpecsSystem Spec

  2. #2


    Marco Shaw [MVP] Guest

    Re: Powershell script for measuring performance of servers over time

    > When I use the above classes with get-wmiobject I can get values on

    > mentioned above properties, but it does not tell you much, you want to get
    > a sample of values, such as get a average value over a period of time such
    > as 1 hour. How can I combine the above in a script which will give me the
    > average values I am looking for. Is there a script I can download which
    > is already setup for performance counters.
    >
    > Also is it possible to to get average values for the last 7 days or maybe
    > setup a script which will take averages in the next 7 days.
    At this point, I would suggest you consider looking at some other tool,
    unless this is a pet project of yours.

    If you do want to go down this route, you'll need to find some place to log
    your data, whether it be a simple text file, Excel, Access or SQL Server.

    Then you'll have to deal with data archiving/purging, and the logic you'll
    want to use when averaging.

    Marco


      My System SpecsSystem Spec

  3. #3


    stej Guest

    Re: Powershell script for measuring performance of servers over time

    What you describe is a complex solution that could not be answered
    here. Instead of that you should look for a tool that meets your
    needs. PowerShell is capable to do that but it needs real coding.
    For some ideas check my blog - http://www.leporelo.eu/blog.aspx?id=...-read-the-data
    - it's a 4 parts series about collecting data from perf counters and
    displaying them.

    On Dec 14, 3:06*pm, "guv" <guv@> wrote:

    > I need assistance with a script to check performance on our servers such as
    > cpu, memory, disk and network.
    >
    > I have been using some of the win32 classes below:
    >
    > win32_perfrawdata_perfos_memory to get availableMbytes
    > win32_perfrawdata_perfos_processor to get processortime
    > win32_perfrawdata_perfos_disk to get disktime
    > win32_perfrawdata_perfdisk_physicaldisk to ge disktime
    > win32_perfrawdata_perfdisk_logicaldisk to get freespace
    > win32_perfrawdata_perfos_system to get systemuptime
    > win32_perfrawdata_termservice_terminalservicessession to get processor time
    > win32_perfrawdata_tcpip_nbtconnections to get bytes per second
    >
    > When I use the above classes with get-wmiobject I can get values on
    > mentioned above properties, but it does not tell you much, you want to get a
    > sample of values, such as get a average value over a period of time such as
    > 1 hour. *How can I combine the above in a script which will give me the
    > average values I am looking for. *Is there a script I can download which is
    > already setup for performance counters.
    >
    > Also is it possible to to get average values for the last 7 days or maybe
    > setup a script which will take averages in the next 7 days.
    >
    > In terms of the values I am looking for values which are readable such as
    > memory in available GB/MB but not with a long integer value which looks
    > confusing. *Also other values as well which looks easy to understand like
    > processor time in % and freespace in GB and system uptime in days and hours.
    >
    > Also there is a timestamp value as part of the properties of the classes
    > above, do you know what this means and how it can be used.
    >
    > Sorry for the many questions, but I would really like to get a script setup
    > to get this required information.

      My System SpecsSystem Spec

Powershell script for measuring performance of servers over time

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Script to audit windows 2003 servers guv PowerShell 3 16 Dec 2009
snmp script to change settings on 150 servers gram VB Script 0 06 Jan 2009
script to change SNMP Community name on 150 servers gram VB Script 0 25 Sep 2008
Logon script check for servers Pasi Heino VB Script 1 15 Aug 2008
Script that goes out over the network to all servers Windoohs Guy VB Script 1 09 Jun 2008