AFAdmin.GetDiagnostics Method
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Gets diagnostic information from the system.
Namespace: OSIsoft.AF.Diagnostics
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static IDictionary<string, long> GetDiagnostics( PISystem system )
Public Shared Function GetDiagnostics ( system As PISystem ) As IDictionary(Of String, Long) Dim system As PISystem Dim returnValue As IDictionary(Of String, Long) returnValue = AFAdmin.GetDiagnostics(system)
public: static IDictionary<String^, long long>^ GetDiagnostics( PISystem^ system )
static member GetDiagnostics : system : PISystem -> IDictionary<string, int64>
Parameters
- system
- Type: OSIsoft.AFPISystem
The operation will be performed on the specified PISystem.
Return Value
Type: IDictionaryString, Int64Returns a dictionary of the diagnostic items which is keyed by diagnostic name. The AFAdminDiagnosticNames class contains a list of the known names that can be used as keys for the returned dictionary. Additional items may be present in the dictionary.
Exceptions
| Exception | Condition |
|---|---|
| SecurityException | This exception is thrown when attempting to execute without Admin security rights. |
| ArgumentNullException | This exception is thrown when attempting to execute on a PISystem that is null or deleted. |
| NotSupportedException | This exception is thrown when attempting to execute on a PISystem that does not support the AdminFunctionality feature. |
Remarks
This method returns information on things like the size of the AF SQL database files and the number of changed item records on the system. The information can be used to assess system health.
Use the PISystem.Supports method to check if the PISystem supports the AdminFunctionality feature.
| Requires the Admin right to execute. |
| This method will error on servers before AF 2018 R2 (2.10.5). |