alanrenouf / vCheck-vSphere

vCheck Daily Report for vSphere
MIT License
735 stars 326 forks source link

98 vSwitch Security error messages #103

Closed parodymshifter closed 10 years ago

parodymshifter commented 10 years ago

Are these error messages something I should do something about? Or is it something that needs attention in the way this plugin is coded?

3:54:40 AM ..start calculating vSwitch Security by Justin Mercier, Sam McGeown, John Sneddon v1.2 Add-PSSnapin : The Windows PowerShell snap-in 'VMware.VimAutomation.Vds' is not installed on this computer. At C:\Users\xxx\Downloads\vCheck-vSphere-master-2014-02-06\vCheck-vSphere-master\Plugins\98 vSwitch Security.ps1:24 char:10

Get-VDPortGroup : The term 'Get-VDPortGroup' 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:\Users\xxx\Downloads\vCheck-vSphere-master-2014-02-06\vCheck-vSphere-master\Plugins\98 vSwitch Security.ps1:49 char:4

3:55:43 AM ..finished calculating vSwitch Security by Justin Mercier, Sam McGeown, John Sneddon v1.2

Sneddo commented 10 years ago

Can you run the following and post the results?

Get-PowerCLIVersion Get-PSSnapin -Registered

Looks like the required module is not installed.

alanrenouf commented 10 years ago

Agreed, looks like this is an old version of PowerCLI, perhaps we should add a requires to the script?

requires -pssnapin VMware.VimAutomation.Core

requires -pssnapin VMware.VimAutomation.vds

Sneddo commented 10 years ago

I think it makes sense to do checks on a plugin level- most plugins will work fine on older versions of PowerCLI so just display a warning and move on. There is already a version check in there, probably just need to be tweaked.

Something to consider for the next major release- might tie in well with object requirements in plugins as well. i.e. "Plugin x requires VM and Host objects, PowerCLI version x, vSphere 5.1 or greater, vCheck 6.18" sort of thing.

parodymshifter commented 10 years ago

Here is the info you requested:

PowerCLI Version

VMware vSphere PowerCLI 5.1 Release 1 build 793510

Snapin Versions

VMWare AutoDeploy PowerCLI Component 5.1 build 768137 VMWare ImageBuilder PowerCLI Component 5.1 build 768137 VMware vCloud Director PowerCLI Component 1.5 build 793505 VMware License PowerCLI Component 5.1 build 669840 VMware vSphere PowerCLI Component 5.1 build 793489

Name : Microsoft.EnterpriseManagement.OperationsManager.Client PSVersion : 1.0 Description : Microsoft Operations Manager Shell Snapin

Name : Quest.ActiveRoles.ADManagement PSVersion : 1.0 Description : This Windows PowerShell snap-in contains cmdlets to manage Active Directory and Quest ActiveRoles Server.

Name : SqlServerCmdletSnapin100 PSVersion : 2.0 Description : This is a PowerShell snap-in that includes various SQL Server cmdlets.

Name : SqlServerProviderSnapin100 PSVersion : 2.0 Description : SQL Server Provider

Name : VeeamPSSnapIn PSVersion : 3.0 Description : This is a PowerShell snap-in that includes the Veeam's cmdlet.

Name : VeeamPSSnapIn.Plugin.Hp3PAR PSVersion : 3.0 Description : This PowerShell snap-in includes HP StoreServ SanPlugin cmdlet.

Name : VeeamPSSnapIn.Plugin.HpP4k PSVersion : 3.0 Description : This PowerShell snap-in includes HP StoreVirtual SanPlugin cmdlet.

Name : VMware.DeployAutomation PSVersion : 2.0 Description : Cmdlets for Rule-Based-Deployment

Name : VMware.ImageBuilder PSVersion : 2.0 Description : This Windows PowerShell snap-in contains VMware ESXi Image Builder cmdlets used to generate custom images.

Name : VMware.VimAutomation.Cloud PSVersion : 2.0 Description : This Windows Powershell snap-in contains cmdlets used to manage VMware vCloud Director.

Name : VMware.VimAutomation.Core PSVersion : 2.0 Description : This Windows PowerShell snap-in contains Windows PowerShell cmdlets for managing vSphere.

Name : VMware.VimAutomation.License PSVersion : 2.0 Description : This Windows Powershell snap-in contains cmdlets for managing License components.

Name : Windows.ServerBackup PSVersion : 2.0 Description : This Windows PowerShell snap-in for Windows Server Backup contains cmdlets used to configure, run, and manage backups.

Sneddo commented 10 years ago

hmmmm so it is because you're using an older version of PowerCLI - you should be running build 1012425 at the earliest (5.1 Update 2).

I think the version check needs to cast the regex match to [int], it will be doing string comparisons otherwise. I'll do a pull request tomorrow to fix this up. In the meantime, if you want this plugin to work, you need to update PowerCLI.

Sneddo commented 10 years ago

Hey @parodymshifter, if you pull the latest update of this plugin it should hopefully fix these for you. Bear in mind that the plugin will not run because your version of PowerCLI is too old, but you shouldn't get this error anymore (should just warn you that your version is out of date and move on).