How to get the statistics of all the virtual machines that is going down the network packet last week?

Hello

I have this script (new) to Mr. LucD grace who 'supposed' to collect the list of any package of network statistics dropped as scheduled:$start = Get-Date ' 01/01/2015 00:00 "

$finish = Get-Date "21/01/2015 14:30"

$metrics = "net.droppedRx.summation","net.droppedTx.summation"
foreach($esx in (Get-VMHost)){
    $vms = Get-VM -Location $esx
    if($vms){
        Get-Stat -Entity $vms -Stat $metrics -Start $start -Finish $finish -ErrorAction SilentlyContinue |
        where {$_.Instance -ne ""} |
        Group-Object -Property {$_.Entity.Name,$_.Instance} | %{
            $_.Group | Group-Object -Property Timestamp | %{
                New-Object PSObject -Property @{
                    VMHost = $esx.Name
                    VM = $_.Group[0].Entity.Name
                    VmNic = $_.Group[0].Instance
                    "Receive Dropped Packets" = $_.Group | where {$_.MetricId -eq "net.droppedRx.summation"} | Select -ExpandProperty Value
                    "Transmit Dropped Packets" = $_.Group | where {$_.MetricId -eq "net.droppedTx.summation"} | Select -ExpandProperty Value
                    Timestamp = $_.Group[0].Timestamp
                    "Interval (seconds)" = $_.Group[0].IntervalSecs
                }
            }
        }
    }
} | Export-CSV -path C:\Temp\Result.CSV

but somehow there is no results coming out of this script?

How can I get the result the. CSV file?

The ForEach loop do not put anything in the pipeline, but that can be fixed by using the call operator (and)

$finish = get-Date ' 21/01/2015 14:30 '.

$metrics = "net.droppedRx.summation", "net.droppedTx.summation".

& {foreach ($esx in (Get-VMHost)) {}

$vms = get-VM-location $esx

{if ($VMS)}

Get-Stat - $vms - Stat $metrics entity - start $start - finishing $finish - ErrorAction SilentlyContinue |

where {$_.} {Example - don't ""} |

Group-object - property {$_.} @entity.name, $_. Instance} | %{

$_. Group | Group-object - property Timestamp | %{

New-object PSObject-property @ {}

VMHost = $esx. Name

VM = $_. Group [0]. @entity.name

VmNic = $_. Group [0]. Instance

"Receive ignored packages" = $_. Group | where {$_.} MetricId - eq "net.droppedRx.summation"} | Select value - ExpandProperty

"Transmit ignored packages" = $_. Group | where {$_.} MetricId - eq "net.droppedTx.summation"} | Select value - ExpandProperty

Timestamp = $_. Group [0]. Timestamp

'Interval (seconds)' = $_. Group [0]. IntervalSecs

}

}

}

}

}} | Export-CSV-path C:\Temp\Result.CSV

Tags: VMware

Similar Questions

  • How to get the date - 7 days (week)

    Hi all

    I am beginner in Java and JSP

    I'm JSP search form (VO) where I need to set a default value for the start_date - 7 days

    OK I get this display today date but how to get that displays a date-7 days?


    < %
    DateFormat df = new SimpleDateFormat ("JJ. MM.yyyy");
    Date date = new Date();
    String default = 'StartDate =' + df.format (new Date());
    % >

    ID
    Thank you

    Simple approach if you're not worried about leap years: -.

    Date todayMinus7 = new Date(System.currentTimeMillis() - 7 * 24 * 60 * 60 * 1000);
    

    Alternatively take a look at the GregorianCalendar class and the add() method.

  • How to get the particular record last

    Hello

    I want the query because if a particular record available when enter as a last record.

    Ex,

    name
    ----------
    s
    t
    h

    but t is always the last record. How to get?


    Thank you
    Alphadi.

    Welcome to the forum.

    Do you mean you want to 'h' to appear as the last record?
    Try:

    SQL> -- generating sample data:
    SQL> with t as (
      2  select 'h' name from dual union
      3  select 's' from dual union
      4  select 't' from dual
      5  )
      6  --
      7  -- actual query:
      8  --
      9  select name
     10  from   t
     11  order by case
     12             when name = 'h' then 2
     13             else 1
     14           end;
    
    NAME
    --------------------
    s
    t
    h
    
    3 rows selected.
    
  • How to get the first and last record

    Hai All

    I have a table called T1 and there are more than 8 lakhs Archives and I have a column named Timestamp, so I need to get the first record value and time stampvalue and last record and time stamp value so that I can conclude that for example
    form June 13 to 15 June data are here


    Kind regards

    SrikkanthM

    What is the problem with:

    select min(timestamp),max(timestamp)
    from T1;
    

    ?

  • How to get the ASA packets that come in and out on the same interface?

    Hi all

    How can I configure the ASA5520 routes the packets that come in and out on the same interface? I ve more than 1 network behind the camera of the SAA. It s separated by internal router. They can communicate with each other.

    I've seen it's PIX design problem. She applies to the platform of the ASA?

    Please advice.

    Thank you

    Nitass

    This golden rule remains immutable. the only exception is the vpn traffic. ASA for example (or pix v7) would act as a hub for traffic between two rays rediect vpn.

    regarding your question.

    Internet <-->asa <-->1 <-->lan router <-->lan 2

    assuming the host to lan 1 to asa as the gateway default, even asa has a static route to the internal router of the point for local network 2, the golden rule will reject this operation.

    one solution is to re - configure the dhcp on the LAN 1 scope and make the internal router as the default gateway; and the internal router has the asa as the default gateway.

  • Get the firstday and last month lastday

    Hello

    How to get the first and last day of the last month?

    I've used this, but it returns January 1, 2010

    FirstDay:
    Select TRUNC (SYSDATE, 'year') of double

    LASTDAY:
    Select LAST_DAY (ADD_MONTHS (SYSDATE-1)) of the double

    You're close

    SQL> select TRUNC(ADD_MONTHS (SYSDATE, -1),'month') fom,
      2         LAST_DAY(ADD_MONTHS (SYSDATE,-1)) eom
      3  from dual;
    
    FOM       EOM
    --------- ---------
    01-DEC-09 31-DEC-09
    

    John

  • How to get the printer laserjet 3015 of all-in-one to work with hp520 touchsmartpc 64-bit with windows 7

    How to get the printer laserjet 3015 of all-in-one to work with hp520 touchsmartpc 64-bit with windows 7

    Hi baldwinj,

    Follow the steps outlined in the document below to install the OS driver in for this printer in Win 7 64 bit.

    HP LaserJet Color LaserJet and products of LaserJet AiO/MFP - install the driver included in the operating system Windows 7 (OS)

    Download drivers and software

  • All-in-one HP Officejet 7300/7400 series, it will work with Windows 7 and how to get the OCR software work?

    I have a HP Officejet 7300/7400 series all-in-one, it will work with Windows 7 and how to get the OCR software work?

    By installing complete software functionality of the HP cd or online installation and connection of the printer only when the installation says too much

    http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?OS=4062&LC=en&cc=UK&DLC=en&sw_lang=&product=391182#n193

  • How to get the message to debug all to running page request OFA?

    Hello

    How to get the message to debug all to running page request OFA? do not use JDeveloper

    Thank you

    Renon,

    this.writeDiagnostics will be work AM and not CO. You mentioned that your code is AM, which is why I give (this.writeDiagnostics).

    You get an error when you use what to ? AM

    in CO, you must use pageContext. writeDiagnostics();

    You don't need to put any profile (other than DNF: Diagnostics), you just need to go to the Diagnostics - select the log on screen and choose the level that you used in the writeDiagnostics method.

    See you soon

    AJ

  • How can I use statistics for all the tables in a schema in SQL Developer? and how long will it take on average?

    Hello

    How can I use statistics for all the tables in a schema in SQL Developer? and how long will it take on average?

    Thank you

    Jay.

    Select the connection and right-click on it and select schema statistics collection

  • How to get the IP Address of the Console for all my guests

    How to get the IP Address of the Console for all my guests

    a simple...

    Get-VMHost | Select Name, @{N="ConsoleIP";E={(Get-VMHostNetwork $_).ConsoleNic | ForEach{$_.IP}}}
    
  • Re: How to get the Tempo to work properly?

    Hello

    I have problems with the service of Tempo.

    I don't get updates via this application (all the settings of this application are accurate, i.e. "full control"). I know this because there are updates available online to my laptop via the pilot site of toshiba.

    When I installed first Tempo, updates for about a month, I received, and then all of a sudden, no update came through. My firewall is blocking either of this application.

    I tried to reinstall the application, but no change in the situation.

    Does anyone know if ALL updates are available via the website of driver toshiba out tempo? Because, in the month that this service worked, I got an update of the bios, but I recently saw a bios update online and Tempo has not always reports that it is available.

    Any ideas on how to get the Tempo to work properly?

    Thank you.

    I saw in your other thread you have installed SP1 on your Vista laptop.
    There may be some compatibility problems between SP1 and Tempo

    And Yes, as far as I know Tempo bring all available updates!

  • Satellite Pro M50 with Vista: how to get the S-video on the job?

    Hi all

    I have a vista equipped Satellite Pro M50. Does anyone know how to get the S-video on the job? I can't understand.

    Inadvance, see you soon

    Phil

    Did you look in the user manual?
    This doc is always pre-installed on laptop and provides useful information. Also how to connect a TV and use simple notebooks ports.

    A hint; You must use an s-video cable to connect the laptop to the TV.
    Then use the FN + F5 key combination to switch between display devices.
    Sometimes the special s-video option must be enabled on the TV.

    I would recommend consulting the manual of the TV also.

    Good bye

  • How to get the webcam to work?

    Hello

    As I don't have a book of instruction for this computer, can someone tell me how to get the webcam to work please?
    It is supposed to be something that appears on the side of the screen, but I left the sit of mouse here for centuries on all sides and nothing. Please help me.

    Kit_e

    Hello

    I agree with the user above. The user manual you can find on your computer because it s preinstalled.

    The webcam, you can use with programs like Skype communication. You can make a video call with friends and they see the webcam image. ;)

  • How to get the icons to display correctly in the Finder?

    At the time of the "classic" Mac OS, if the icons are not correctly display in the Finder, we could 'rebuild the desktop file' to correct the problem. I've recently updated to Yosemite, and most things work well, but for some reason, most of the files in the Finder .webloc now show as blank icons (but not all; a few show the correct icon). There is no model, I can see: some very old .webloc files now show a white icon (where I know that their icons used to be correct), while the most recent show the icon of correct - although I just created four (by dragging the URL of the Safari, the usual method) which are all empty. Sometimes they appear with the older icon, with the symbol @ (although those who seem to have changed vacuum after running and restart maintenance). I tried from an external disk, repair permissions and repair the file system, as well as cleaning with the utility of Maintenance (which clears the web browser and other caches), nothing works. Does anyone know how to get the computer to display these icons correctly?

    May be a corrupt .plist.

    Make a backup, preferably 2 backups on 2 separate drives.

    Go to Finder and select your user folder. With this Finder window as the windshield, select Finder/display/display options for presenting or order - J.  When the display options opens, check "show the library folder. This should make your visible user library folder in your user folder.  Select the library. Then go to Preferences/com.apple.finder.plist and com.apple.desktop.plist.  Move the .plists on your desktop.

    Relaunch the Finder by restarting the computer and test. If it works fine, delete the plists from the desktop.

    If the same, return the .plists to where you obtained since, by crushing the latest.

    Thanks to leonie for certain information contained in this.

Maybe you are looking for

  • I can not see the internet address bar or toolbar command on Firefox 3.6

    When I open my Firefox, it shows my home page but I don't see the window of internet address to change or what I see my options of command at the top of the page.

  • How can I crack comps password forget

    original title: How can I crack comps password forget after. My opreating system is windows 7. There are so many problems after that I forgot the password computer ny. Please give me a solution.  give me an answer in 5 minutes. give me the solution.

  • Cannot restore to Windows 7 from Windows 10

    * Original title: update windows 7 As windows 10 insists to upgrade windows 7. As I don't want. Finally, it was destroyed. I have reinstall my purchase DVD of windows 7 again. noway I can't update. even I tried all Microsoft solutions. Is is a way to

  • Computer is slow it says download adw cleaner

    Original title: Window 7 Pro-32 - download adw-Mbar-vacuum cleaner My computer start sometimes slow, sometimes it is slow Google for gmail, someone said that I should download adw cleaner and run it then download Mbar and run it, and I should downloa

  • IllegalStackSizeexception: no Graphics.pop in class

    "Unpaired Graphics.pop (paint) in the BB * d 5 real class! = (expected) clip 8. Why I get this kind of exception. I use JDE 4.7.0 and tactile 9500 simulator, I'm the exception when I try to scroll the content of this page upwards or downwards (by dra