Automation

 View Only
  • 1.  Powershell scripts to show health and alarms?

    Posted Dec 03, 2015 10:46 AM

    Hello,

    Is there a powercli script that any other you can share that I can use daily to give me a health view of our vCenter environment.  I have some powercli scripts already running that email snapshot and datastore info, this done via the Windwos scheduler tool and would like to do a similar thing for the hosts?

    Thanks



  • 2.  RE: Powershell scripts to show health and alarms?

    Posted Dec 03, 2015 11:03 AM

    The vCheck script comes to mind.

    You can configure the snapins you want to use in the report.



  • 3.  RE: Powershell scripts to show health and alarms?

    Posted Dec 03, 2015 11:03 AM

    Alan Renouf's vCheck is excellent, http://www.virtu-al.net/vcheck-pluginsheaders/vcheck/



  • 4.  RE: Powershell scripts to show health and alarms?

    Posted Dec 04, 2015 10:56 AM

    Thanks VCheck looks amazing.

    It's currently running, but I keep getting the odd:

    Security warning

    Run only scripts that you trust. While scripts from the internet can be useful,

    this script can potentially harm your computer. If you trust this script, use

    the Unblock-File cmdlet to allow the script to run without this warning

    message. Do you want to run C:\vmware\powercli\vCheck\Plugins\20 Cluster\38

    Cluster Configuration Issues.ps1?

    [D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"):

    I did set the set-execusionpolicy to unrestricted too

    any ideas?



  • 5.  RE: Powershell scripts to show health and alarms?

    Posted Dec 04, 2015 11:12 AM

    When you download scripts, you will have to unblock them (provided you trust them of course).

    When you have downloaded and extracted everything into a folder C:\vCheck, you can do

    Get-ChildItem C:\vCheck | Unblock-File



  • 6.  RE: Powershell scripts to show health and alarms?

    Posted Dec 04, 2015 11:56 AM

    So I should continue with hitting "R" then when finished run?

    Get-ChildItem C:\vCheck | Unblock-File



  • 7.  RE: Powershell scripts to show health and alarms?

    Posted Dec 04, 2015 12:27 PM

    Try with the Confirm switch

    Unblock-File -Confirm:$false



  • 8.  RE: Powershell scripts to show health and alarms?

    Posted Dec 04, 2015 12:44 PM

    It run through it all and seemed to run lots of plugins and miss some then open a blank html?

    [12:42:00] ..start calculating VMs Ballooning or Swapping by Alan Renouf, Frederic Martin v1.1 [70 of 110]

    . : File C:\vmware\powercli\vCheck\Plugins\60 VM\12 VMs Swapping or Ballooning.ps1 cannot be loaded. The file

    C:\vmware\powercli\vCheck\Plugins\60 VM\12 VMs Swapping or Ballooning.ps1 is not digitally signed. You cannot run this

    script on the current system. For more information about running scripts and setting execution policy, see

    about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.

    At C:\vmware\powercli\vCheck\vCheck.ps1:669 char:56

    +    $TTR = [math]::round((Measure-Command {$Details = . $_.FullName}).TotalSecond ...

    +                                                        ~~~~~~~~~~~

        + CategoryInfo          : SecurityError: (:) [], PSSecurityException

        + FullyQualifiedErrorId : UnauthorizedAccess

    [12:42:00] ..finished calculating VMs Ballooning or Swapping by Alan Renouf, Frederic Martin v1.1 [70 of 110]

    [12:42:00] ..start calculating Invalid or inaccessible VM by Alan Renouf v1.1 [71 of 110]

    . : File C:\vmware\powercli\vCheck\Plugins\60 VM\13 Invalid or inaccessible VMs.ps1 cannot be loaded. The file

    C:\vmware\powercli\vCheck\Plugins\60 VM\13 Invalid or inaccessible VMs.ps1 is not digitally signed. You cannot run

    this script on the current system. For more information about running scripts and setting execution policy, see

    about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.

    At C:\vmware\powercli\vCheck\vCheck.ps1:669 char:56

    +    $TTR = [math]::round((Measure-Command {$Details = . $_.FullName}).TotalSecond ...

    +                                                        ~~~~~~~~~~~

        + CategoryInfo          : SecurityError: (:) [], PSSecurityException

        + FullyQualifiedErrorId : UnauthorizedAccess

    [12:42:00] ..finished calculating Invalid or inaccessible VM by Alan Renouf v1.1 [71 of 110]

    [12:42:00] ..start calculating VMs restarted due to Guest OS Error by Alan Renouf v1.1 [72 of 110]

    [12:42:00] ..finished calculating VMs restarted due to Guest OS Error by Alan Renouf v1.1 [72 of 110]

    [12:42:01] ..start calculating Guests with less than $MBFree MB by Alan Renouf v1.1 [73 of 110]

    [12:42:01] ..finished calculating Guests with less than $MBFree MB by Alan Renouf v1.1 [73 of 110]

    [12:42:01] ..start calculating Checking VM Hardware Version by Alan Renouf v1.1 [74 of 110]

    [12:42:01] ..finished calculating Checking VM Hardware Version by Alan Renouf v1.1 [74 of 110]

    [12:42:01] ..start calculating VMs in inconsistent folders by Alan Renouf v1.2 [75 of 110]

    [12:42:01] ..finished calculating VMs in inconsistent folders by Alan Renouf v1.2 [75 of 110]

    [12:42:01] ..start calculating No VM Tools by Alan Renouf v1.1 [76 of 110]

    [12:42:01] ..finished calculating No VM Tools by Alan Renouf v1.1 [76 of 110]



  • 9.  RE: Powershell scripts to show health and alarms?

    Posted Dec 04, 2015 12:46 PM

    last part that ran was this:

    [12:43:14] ..start calculating Disconnecting from vCenter by Alan Renouf v1.1 [110 of 110]

    . : File C:\vmware\powercli\vCheck\Plugins\80 Finish\999 VeryLastPlugin Used to Disconnect.ps1 cannot be loaded. The

    file C:\vmware\powercli\vCheck\Plugins\80 Finish\999 VeryLastPlugin Used to Disconnect.ps1 is not digitally signed.

    You cannot run this script on the current system. For more information about running scripts and setting execution

    policy, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.

    At C:\vmware\powercli\vCheck\vCheck.ps1:669 char:56

    +    $TTR = [math]::round((Measure-Command {$Details = . $_.FullName}).TotalSecond ...

    +                                                        ~~~~~~~~~~~

        + CategoryInfo          : SecurityError: (:) [], PSSecurityException

        + FullyQualifiedErrorId : UnauthorizedAccess

    [12:43:14] ..finished calculating Disconnecting from vCenter by Alan Renouf v1.1 [110 of 110]

    Get-ReportHTML : The term 'Get-ReportHTML' is not recognized as the name of a cmdlet, function, script file, or

    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try

    again.

    At C:\vmware\powercli\vCheck\vCheck.ps1:748 char:13

    + $MyReport = Get-ReportHTML

    +             ~~~~~~~~~~~~~~

        + CategoryInfo          : ObjectNotFound: (Get-ReportHTML:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

    [12:43:17] ..Displaying HTML results



  • 10.  RE: Powershell scripts to show health and alarms?

    Posted Dec 04, 2015 12:53 PM

    You can, if that is allowed in your environment, remove the script signature requirement by changing the execution policy.

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned