Microsoft Virtualization Discussions

How to trigger an AutoSupport from Powershell?

PADMANTECH
9,599 Views

Hi All,

I know this sounds simple but i am unsure how to trigger an AutoSupport from Powershell? I know i can do this by using SSH to the filer and using the cmd "options autosupport.doit" but find i can do everything else in PowerShell.

Any help is much appreciated.

Jason

1 ACCEPTED SOLUTION

beam
9,598 Views

You may be able to use the Set-NaOption cmdlet:  Set-NaOption autosupport.doit

-Steven

View solution in original post

10 REPLIES 10

cknight
9,554 Views

Try Invoke-NaEmsAutosupportLog.  Just be sure to leave -GenerateAutosupport set to false, lest you trigger an immediate ASUP phone home action (unless that's what you want).

PADMANTECH
9,554 Views

Thanks for the feedback Clinton. I am trying to generate and immediate ASUP as i logged a technical support case. I tried doing a "get-help Invoke-NaEmsAutosupportLog" but the description is a little confusing to me and when i try to execute it requires a computer host name. Are you able to supply me with a command to just replicate a "options autosupport.doit" from the filer?

Thanks for your help.

RAVI_PALADUGU
9,554 Views

Hi Clinton,

I have the same question, its little confusing when I see the example below. Looks like it do not generate autosupport from the help description, can you please clarify this confusion?

This cmdlet is used by applications to log specific events occurring on a host system.

   

    --------------  Example 1 --------------

   

    C:\PS>Invoke-NaEmsAutosupportLog -ComputerName "host1" -EventId 100 -EventSource "powershell" -AppVersion "2.0"

    -Category "test" -EventDescription "this is a test message." -LogLevel 6

Thanks

Ravi

cknight
9,554 Views

Use the -GenerateAutosupport switch if you really want the filer to phone home now.  But please do that very sparingly, as there is overhead on both ends when that happens.

PADMANTECH
9,554 Views

Hi Clinton,

Thanks for helping me understand. Please let me know if I got it.

From what you are saying, there is no way of directly replicating the Data ONTAP cmd "options autosupport.doit" to only send ASUP info from the filer yet. I could however write out the whole powershell cmd as listed below with the "-GenerateAutosupport" flag which will also send log data from the Windows Host "host1"  and then send an ASUP with it?

C:\PS>Invoke-NaEmsAutosupportLog -ComputerName "host1" -EventId 100 -EventSource "powershell" -AppVersion "2.0" -Category "test" -EventDescription "this is a test message." -LogLevel 6 -GenerateAutosupport

I tried to run the cmd "Invoke-NaEmsAutosupportLog -GenerateAutosupport" directly but it then asked me to input all the info such as ComputerName:, EventId:, EventSource:, AppVersion:, Category:, EventDescription: and LogLevel: before the cmd would execute.

beam
9,599 Views

You may be able to use the Set-NaOption cmdlet:  Set-NaOption autosupport.doit

-Steven

bsti
9,554 Views

I get an error when I do that (but it still triggers the ASUP):

bsti
9,554 Views

I use Invoke-Nassh "options autosupport.doit test".  That works and doesn't generate an error.

cknight
9,554 Views

OK, so if you don't want to use Invoke-NaSsh, and Set-NaOption does trigger the ASUP, you can combine Set-NaOption with -ErrorAction SILENTLYCONTINUE.

Karhtik_Abhi
7,177 Views

Get-NaOption autosupport.doit "Test"

Public