Dies ist eine alte Version des Dokuments!


System Profiler remote über SSH aufrufen

Für Administratoren ist der System Profiler (Menü: Apfel → Über diesen Mac → Weitere Informationen) unverzichtbar. Er gibt sehr detailliert Überblick uA über die Hardware- oder Softwarekonfiguration des Macs. Wenn der entfernte Mac den Zugang über SSH erlaubt, können Sie diese Information bequem von Ihrem Arbeitsplatz abrufen. Da die Fülle der abrufbaren Informationen einen quasi erschlägt, ist die Benutzung diverser Filter unerlässlich. Ich gehe hier in diesen Artikel mal beispielhaft auf ein paar wenige ein. Da sich die Syntax über eine Remote Shell (SSH) nicht von der lokalen Shell (Terminal) unterscheidet, können Sie diese Beispiele auch in einem Terminal lokal auf Ihrem Rechner nachvollziehen:

Öffnen Sie ein Terminal und rufen sie die Hilfe des Befehls system_profiler auf:

$ system_profiler -usage 
Usage: system_profiler [-listDataTypes]
       system_profiler [-xml] [-detailLevel n]
       system_profiler [-xml] [dataType1 ... dataTypeN]

  -detailLevel n    specifies the level of detail for the report
                      mini = short report (contains no identifying or personal information)
                      basic = basic hardware and network information
                      full = all available information

  -listDataTypes    lists all the available datatypes

  -xml              generates xml output instead of plain text
                    if redirected to a file with the extension ".spx"
                    the file can be opened in System Profiler.app

Examples:

  system_profiler
     Generates a text report with the standard detail level.

  system_profiler -detailLevel mini
     Generates a short report without identifying/personal information.

  system_profiler -listDataTypes
     Shows a list of the available data types.

  system_profiler SPSoftwareDataType SPNetworkDataType
     Generates a text report containing only software and network data.

  system_profiler -xml >MySystem.spx
     Creates a XML file which can be opened by System Profiler.app

Mit sogenannten DataTypes können Sie die Suche auf bestimmte Bereiche eingrenzen. Um sich eine Liste der verfügbaren DataTypes anzeigen zu lassen, führen Sie den Befehl system_profiler -listDataTypes aus:

$ system_profiler -listDataTypes 
Available Datatypes:
SPHardwareDataType
SPNetworkDataType
SPSoftwareDataType
SPParallelATADataType
SPAudioDataType
SPBluetoothDataType
SPDiagnosticsDataType
SPDiscBurningDataType
SPEthernetDataType
SPFibreChannelDataType
SPFireWireDataType
SPDisplaysDataType
SPHardwareRAIDDataType
SPMemoryDataType
SPPCIDataType
SPParallelSCSIDataType
SPPowerDataType
SPPrintersDataType
SPSASDataType
SPSerialATADataType
SPUSBDataType
SPAirPortDataType
SPFirewallDataType
SPNetworkLocationDataType
SPModemDataType
SPNetworkVolumeDataType
SPWWANDataType
SPApplicationsDataType
SPDeveloperToolsDataType
SPExtensionsDataType
SPFontsDataType
SPFrameworksDataType
SPLogsDataType
SPManagedClientDataType
SPPrefPaneDataType
SPStartupItemDataType
SPSyncServicesDataType
SPUniversalAccessDataType

Beispiel: Versionen der installierten Applikationen anzeigen

Der DataType für die installierten Applikationen wäre SPApplicationsDataType. Da der folgende Befehl, je nach installierter Software, uU eine recht lange Liste produziert, filtere ich exemplarisch mit dem grep-Befehl einmal die Ausgabe auf zB Firefox und ein weiteres mal auf Adobe, wobei ich die Adobe Ausgabe ein wenig kürze:

$ system_profiler SPApplicationsDataType | grep Firefox 
    Firefox:
      Get Info String: Firefox 3.5.7, © 1998-2009 Contributors
      Location: /Applications/Firefox.app
prontos-Mac-Pro:~ pronto$ system_profiler SPApplicationsDataType | grep Adobe 
   Adobe Photoshop CS4:
      Get Info String: 11.0.1 (11.0.1x20090216 [20090216.r.522 2009/02/16:17:00:00 cutoff; r branch]) © 1990-2009 Adobe Systems Incorporated
      Location: /Applications/Adobe Photoshop CS4/Adobe Photoshop CS4.app
    Adobe Acrobat Pro:
      Get Info String: Adobe® Acrobat® 9.2.0, ©1984-2009 Adobe Systems Incorporated. All rights reserved.
      Location: /Applications/Adobe Acrobat 9 Pro/Adobe Acrobat Pro.app
    Adobe Illustrator CS4:
      Get Info String: 14.0.0, Copyright © 1987-2008 Adobe Systems Inc.  All rights reserved.
      Location: /Applications/Adobe Illustrator CS4/Adobe Illustrator.app
    Adobe Updater:
      Version: Adobe Updater 6.2.0.1474
      Get Info String: Adobe Updater 6.2.0.1474, Copyright 2002-2008 by Adobe Systems Incorporated. All rights reserved.
      Location: /Applications/Utilities/Adobe Utilities.localized/Adobe Updater6/Adobe Updater.app
    Adobe InDesign CS4:
      Get Info String: 6.0.4, Copyright 2000-2009 Adobe Systems Incorporated. All rights reserved.
      Location: /Applications/Adobe InDesign CS4/Adobe InDesign CS4.app

Beispiel: Hardwarekonfiguration anzeigen

Für Administratoren eine weitere wichtige Information wäre zB die Hardwarekonfiguration eines entfernten Rechners.

Diese Information kann über den DataTye SPHardwareDataType abgerufen werden:

$ system_profiler SPHardwareDataType 
Hardware:

    Hardware Overview:

      Model Name: Mac Pro
      Model Identifier: MacPro4,1
      Processor Name: Quad-Core Intel Xeon
      Processor Speed: 2,26 GHz
      Number Of Processors: 2
      Total Number Of Cores: 8
      L2 Cache (per core): 256 KB
      L3 Cache (per processor): 8 MB
      Memory: 6 GB
      Processor Interconnect Speed: 5.86 GT/s
      Boot ROM Version: MP41.0081.B07
      SMC Version (system): 1.39f5
      SMC Version (processor tray): 1.39f5
      Serial Number (system): CK94332xxxx
      Serial Number (processor tray): J594223GWxxxx     
      Hardware UUID: BAE97633-239E-5D98-923A-C9E417AExxxx

Spielen Sie ein wenig bei der Verwendung der DataTypes, Sie werden eine Menge wertvoller Informationen sammeln können.

Eine detaillierte Information über den system_profiler Befehl erhalten Sie auch in der Manpage (man system_profiler)

http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man8/system_profiler.8.html

Pronto 2010/01/25 22:15

mac/system_profiler.1302989519.txt.gz (13288 views) · Zuletzt geändert: 2011/04/16 23:31 von wikisysop
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0