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: restfly.session.APISession)[source]
current_locale()[source]

Retrieves the current system locale that Tenable Security Center has been set to.

system: locale

Returns

locale resource

Return type

dict

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.

system: get

Returns

The response dictionary

Return type

dict

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.

system: diagnostics-generate

system: diagnostics-download

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, and upgradeLog. If nothing is specified, it will default to ['all'].

  • task (str, optional) – Which task to perform. Available options are appStatus and diagnosticsFile. If nothing is specified, it will default to diagnosticFile.

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.

system: locales

Returns

locales dictionary

Return type

dict

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.

system: set-locale

Parameters

locale (str) – The plugin locale name

Returns

The new plugin locale.

Return type

str

Examples

Set the system locale to Japanese:

>>> sc.system.set_locale('ja')
status()[source]

Retrieves the current system status

system: diagnostics

Returns

The status dictionary

Return type

dict

Examples

>>> status = sc.system.status()