alanrenouf / vCheck-vSphere

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

Report is emailed even though it is blank #512

Closed cwiley2566 closed 7 years ago

cwiley2566 commented 8 years ago

I set email report even if its blank to false but I still get an email? Am I missing something?

Send the report by e-mail even if it is empty?

$EmailReportEvenIfEmpty = $false

Sneddo commented 8 years ago

hmmmm can you attach a copy of the report?

What do you have $TimeToRun and $reportOnPlugins set to? If they are $true, this is probably the cause. Might need to exclude these from counting towards an empty report...

cwiley2566 commented 8 years ago

I thought that too but I set them to false:

Do you want to include plugin details in the report?

$reportOnPlugins = $false

List Enabled plugins first in Plugin Report?

$ListEnabledPluginsFirst = $false

Set the following setting to $true to see how long each Plugin takes to run as part of the report

$TimeToRun = $false

Report on plugins that take longer than the following amount of seconds

$PluginSeconds = 30

End of Settings

cwiley2566 commented 8 years ago

capture A screen shot of the report is attached.

Sneddo commented 8 years ago

hmmm interesting!

Maybe try exporting the $PluginResult variable so we can see why it is setting $emptyReport to $false (which should only happen if there is at least one result in $PluginResult that has some output from a plugin). Add $pluginReport | Export-Clixml ./PluginResult.xml to the start of the output section around line 820.

Then we can Import-Clixml .\PluginResult.xml and see what is in the variable...

Out of interest, what version of Powershell are you running? From memory PS2.0 and lower had some quirky behavior with foreach loops, which would always iterate once even on an empty variable...though $Plugin.Details should still be false...

cwiley2566 commented 8 years ago

Here is the contents of the file capture

Sneddo commented 8 years ago

Yeah interesting, the result is null...maybe we can try an additional check.

What version of Powershell are you using?

cwiley2566 commented 7 years ago

Powershell = 4.0 VMware vSphere PowerCLI 6.3 Release 1 build 3737840 vCheck = 6.23

Sneddo commented 7 years ago

OK, I worked out what is causing this.

The connection plugin is returning the status messages as content, so technically the plugin has content even if it isn't displayed.

I've pushed a fix to the dev branch

cwiley2566 commented 7 years ago

Ok thanks very much!!

bossnass commented 6 years ago

Hello,

I am still encountering it, despite using vCheck v6.25. Also: PowerShell = 5.1.15063.786 PowerCLI = 6.5.3 build 6826660

As a workaround I have commented out all Write-CustomOut lines in the "00 Connection Plugin for vCenter.ps1", which ceased the unnecessary output in that plugin. It seems that those are going into $PluginResult.Details for some reason.