2012-12-15 03:10 AM
I'm trying to write a command that retrieves the local date and time of the filer. Code snippet below:
[parameter(Mandatory=$true, HelpMessage="Array name or IP address")]
# connect to controller
Connect-WFAController -Array $PrimaryArray -VFiler $VFilerName
$PrimaryDateTime = Get-NaTime
$PrimaryDateTimeLocal = $PrimaryDateTime.LocalTimeDT
Get-WFALogger -Info -message $($PrimaryDateTimeLocal)
However, Get-NaTime always seems to return null.
And the Get-WFALogger fails complaining that there is a null message as per extract below:
11:08:40.188 INFO [timezone test] Connected to controller
11:08:43.843 ERROR [timezone test] Cannot bind argument to parameter 'message' because it is null.
11:08:44.187 INFO [timezone test] Command completed, took 7030 milliseconds
If anyone has any ideas what might be going wrong I'd really appreciate it?
2012-12-15 12:51 PM
I've tested your command with a 7.3.5 array and its working fine.
Can you please add the following right after the "Connect-WfaController" so I can test if this is related to ONTAP version:
Get-WfaLogger -Info -message $(Get-NaSystemVersion)
BTW, regardless of this problem, the "Connect-WfaController" in your command i referring to $VFilerName which isn't defined as a parameter and is never initialized. It is safe to remove this.
2012-12-15 05:40 PM
Thanks for responding.
I've tried it with controllers running 7.3.4 and 8.1.1 but get the same response.
The commands run fine on those controllers when ran as part of a script or interactively i.e. it only seems to be an issue when running the commands from WFA.
I'll export the command and email you the DAR file in a few moments...
2012-12-15 06:13 PM
So I upgraded from WFA 2.0RC1 to the version on the download site
I ran the command again and it also failed. But this time it told me why:-) The user I am running the WFA service as doesnt have access to call the clock-get APIs. I nodified my roles on the filer and it now works...
Thanks for you help...