System¶
The following methods allow for interaction into the Tenable Security Center System API. These API calls are typically used to understand timezones, system version, etc.
Methods available on sc.system
:
- class SystemAPI(api: APISession)[source]¶
- current_locale()[source]¶
Retrieves the current system locale that Tenable Security Center has been set to.
- Returns:
locale resource
- Return type:
Examples
>>> sc.system.current_locale()
- details()[source]¶
Retrieves information about the Tenable Security Center instance. This method should only be called before authentication has occurred. As most of the information within this call already happens upon instantiation, there should be little need to call this manually.
- Returns:
The response dictionary
- Return type:
Examples
>>> info = sc.system.details()
- diagnostics(task=None, options=None, fobj=None)[source]¶
Generates and downloads a diagnostic file for the purpose of troubleshooting an ailing Tenable Security Center instance.
- Parameters:
fobj (FileObject, optional) – The file-like object to write the diagnostics file to. If nothing is specified, a BytesIO object will be returnbed with the file.
options (list, optional) – If performing a diagnostics generation, then which items should be bundled into the diagnostics file? Available options are
all
,apacheLog
,configuration
,dependencies
,dirlist
,environment
,installLog
,logs
,sanitize
,scans
,serverConf
,setup
,sysinfo
, andupgradeLog
. If nothing is specified, it will default to['all']
.task (str, optional) – Which task to perform. Available options are
appStatus
anddiagnosticsFile
. If nothing is specified, it will default todiagnosticFile
.
- Returns:
A file-like object with the diagnostics file specified.
- Return type:
FileObject
Examples
>>> with open('diagnostics.tar.gz', 'wb') as fobj: ... sc.system.diagnostics(fobj=fobj)
- list_locales()[source]¶
Retrieves the available system locales that Tenable Security Center can be set to.
- Returns:
locales dictionary
- Return type:
Examples
>>> sc.system.list_locales()
- set_locale(locale)[source]¶
Sets the system locale to be used. This requires an administrator to perform this task and will be a global change. The locale determines which pluginset language to use.
Examples
Set the system locale to Japanese:
>>> sc.system.set_locale('ja')