Data ONTAP® PowerShell Toolkit

Switch to Data ONTAP Cluster-mode documentation.

Cmdlet: Get-NaSystemLog


NAME
Get-NaSystemLog

SYNOPSIS
Get the messages log, auditlog, ems log, or snapmirror log file.

SYNTAX
Get-NaSystemLog -MessageLog [-Source <String[]>] [-EventType <String[]>] [-S
everity <String[]>] [-StartTime <DateTime>] [-EndTime <DateTime>] [[-Path] <
String>] [-Content <String>] [-Follow] [-Controller <NaController>] [<Common
Parameters>]

Get-NaSystemLog -EmsLog [-Source <String[]>] [-EventType <String[]>] [-Start
Time <DateTime>] [-EndTime <DateTime>] [[-Path] <String>] [-Process <String[
]>] [-Follow] [-Controller <NaController>] [<CommonParameters>]

Get-NaSystemLog -SnapMirror [-EventType <String[]>] [-StartTime <DateTime>]
[-EndTime <DateTime>] [[-Path] <String>] [-Content <String>] [-Follow] [-Con
troller <NaController>] [<CommonParameters>]

Get-NaSystemLog -AuditLog [-Source <String[]>] [-Severity <String[]>] [-Star
tTime <DateTime>] [-EndTime <DateTime>] [[-Path] <String>] [-Keyword <String
[]>] [-Target <String[]>] [-Content <String>] [-Follow] [-Controller <NaCont
roller>] [<CommonParameters>]


DESCRIPTION
Get the messages log, auditlog, ems log, or snapmirror log file.


PARAMETERS
-MessageLog
If specified, the messages log files in /etc will be parsed.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Source <String[]>
Filter log entries by source. Wildcards are accepted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-EventType <String[]>
Filter log entries by event type. Wildcards are accepted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Severity <String[]>
Filter log entries by severity level. Wildcards are accepted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-StartTime <DateTime>
Display log entries that occurred after this time.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-EndTime <DateTime>
Display log entries that occurred before this time.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Path <String>
Absolute path to a log file to parse.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Content <String>
Log file content to parse. This parameter can be used to parse Snapmirr
or, Message, or AuditLog text directly without requiring the cmdlet to r
etrieve the log text from the controller.

Required? false
Position? named
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-Follow
If specified, the last 4KB of the active log file will be read, then the
cmdlet will wait for further updates. The cmdlet can be stopped using
ctrl-C.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Controller <NaController>
The Data ONTAP controller object, embodied by an NaController object. T
his parameter is returned by the Connect-NaController cmdlet. If not sp
ecified, the value in the global variable CurrentNaController is used.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-EmsLog
If specified, the ems log files will be parsed.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Process <String[]>
Filter log entries by owning process. Wildcards are accepted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-SnapMirror
If specified, the snapmirror logs will be parsed.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-AuditLog
If specified, the auditlog files will be parsed.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Keyword <String[]>
Filter log entries by keyword. Wildcards are accepted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Target <String[]>
Filter log entries by target. Wildcards are accepted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS



NOTES


Category: system
API: file-read-file

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

C:\PS>Get-NaSystemLog -MessageLog -Severity error


Get all of the messages entries with the error severity level.


TimeStampDT : 6/14/2011 5:33:09 PM
TimeStamp : Tue Jun 14 17:33:09 GMT
Source : fas2040rre1
EventType : fci.initialization.failed
Severity : error
Message : replayed event: Initialization failed on Fibre Channel adapter
0a.
FullLine : Tue Jun 14 17:33:09 GMT [fas2040rre1: fci.initialization.faile
d:error]: replayed event: Initialization failed on Fibre Channel adapter 0a.


-------------- Example 2 --------------

C:\PS>Get-NaSystemLog -AuditLog -Keyword API


Get the API calls logged in the auditlog.


TimeStamp : Tue Jun 21 09:34:24 EDT
TimeStampDT : 6/21/2011 9:34:24 AM
EventSource : root@10.61.169.73
Event : api_mpool_03
Severity : debug
Source : fas2040rre1
Keyword : API
Target : https in
Value : <netapp version='1.0' xmlns='http://www.netapp.com/filer/admin
'><volume-get-root-name /></netapp>
FullLine : Tue Jun 21 09:34:24 EDT [fas2040rre1: api_mpool_03:debug]: roo
t@10.61.169.73:API:https in:<netapp version='1.0' xmlns='http://www.netapp.c
om/filer/admin'><volume-get-root-name /></netapp>


-------------- Example 3 --------------

C:\PS>Get-NaSystemLog -EmsLog -StartTime (New-Object DateTime @(2011,7,14,0,
0,0)) -EndTime (New-Object DateTime @(2011,7,14,11,59,59))


Get all ems log entries that occurred on July 14, 2011.


NodeName : fas2040rre1
Date : 14Jul2011 07:00:00
SystemTime : 1310641200
SystemTimeDT : 7/14/2011 11:00:00 AM
GenerationAndSequence : 1308072774/3735
Priority : 6
OwningProcess : statd
EventName : kern_uptime_filer_1
EventAttributes : {[msg, 7:00am up 29 days, 17:26 0 NFS ops, 2932250
8 CIFS ops, 121 HTTP ops, 0 FCP ops, 107434148 iSCSI ops], [secs, 2568387],
[nfsOps, 0], [cifsOps, 29322508]...}


-------------- Example 4 --------------

C:\PS>Get-NaSystemLog -MessageLog -Follow | select -ExpandProperty FullLine


Get the last 4KB of the active messages log file, then wait for updates to t
he active messages log file. Format the output to show the raw text from th
e log file.


Mon Jul 18 12:00:00 EDT [fas2040rre1: kern.uptime.filer:info]: 12:00pm up 3
3 days, 22:26 0 NFS ops, 33466075 CIFS ops, 244 HTTP ops, 0 FCP ops, 1237067
72 iSCSI ops
Mon Jul 18 12:36:09 EDT [fas2040rre1: monitor.chassisTemperature.ok:notice]:
Chassis temperature is ok
Mon Jul 18 13:00:00 EDT [fas2040rre1: kern.uptime.filer:info]: 1:00pm up 3
3 days, 23:26 0 NFS ops, 33467659 CIFS ops, 244 HTTP ops, 0 FCP ops, 1238915
79 iSCSI ops


-------------- Example 5 --------------

C:\PS>Get-NaSystemLog -SnapMirror -EventType src


Get all snapmirror source activity log entries.


TimeStamp : Mon Jul 25 12:38:20 EST
TimeStampDT : 7/25/2011 12:38:20 PM
EventInfo : kenneth:testvol vfiler2:lemon_vol0_mirror Request (192.168.0.1
06)
Type : src
FullLine : src Mon Jul 25 12:38:20 EST kenneth:testvol vfiler2:lemon_vol0
_mirror Request (192.168.0.106)

TimeStamp : Mon Jul 25 12:38:21 EST
TimeStampDT : 7/25/2011 12:38:21 PM
EventInfo : kenneth:testvol vfiler2:lemon_vol0_mirror Abort (Destination n
ot allowed)
Type : src
FullLine : src Mon Jul 25 12:38:21 EST kenneth:testvol vfiler2:lemon_vol0
_mirror Abort (Destination not allowed)


-------------- Example 6 --------------

C:\PS>$messages = Read-NaFile /vol/vol0/etc/log/messages
Get-NaSystemLog -MessageLog -Content $messages


This command reads the file from the controller, then uses Get-NaSystemLog t
o parse the content.


TimeStampDT Source Severity EventType
Message
----------- ------ -------- ---------
-------
10/7/2012 12:00:01 AM notice kern.log.rotate
System kenneth (ID 009992762...
10/7/2012 12:00:31 AM info wafl.snap.autoDelete
Deleting snapshot 'hourly.1'...
10/7/2012 12:00:32 AM info wafl.snap.autoDelete
Deleting snapshot 'hourly.0'...
10/7/2012 12:00:32 AM info wafl.snap.autoDelete
Deleting snapshot 'nightly.0...
10/7/2012 12:06:47 AM info wafl.snap.autoDelete
Deleting snapshot 'hourly.0'...
10/7/2012 12:06:48 AM info wafl.snap.autoDelete
Deleting snapshot 'nightly.0...
10/7/2012 12:50:00 AM warning mgr.stack.openFail
Unable to open function name...
10/7/2012 1:00:00 AM info kern.uptime.filer
1:00am up 3 days, 13:50 0 N...
10/7/2012 1:00:01 AM notice raid.rg.scrub.start
/compliance/plex0/rg0: start...



RELATED LINKS







 Data ONTAP® PowerShell Toolkit