Important

The Nessus Package is currently a Technology Preview

Server

Methods described in this section relate to the server API. These methods can be accessed at Nessus.server.

class ServerAPI(api: APISession)[source]
properties() Dict[source]

Retrieves the Tenable Nessus server properties.

Returns:

The various properties for this server.

Return type:

Dict

Example

>>> nessus.server.properties()
restart(reason: str | None = None, soft: bool | None = None, unlink: bool | None = None, when_idle: bool | None = None) None[source]

Initiates a restart of this Tenable Nessus service

Parameters:
  • reason (str, optional) – What is the reason for the restart to occur?

  • soft (bool, optional) – Should we only restart the web service (soft restart) or restart the whole Tenable Nessus service?

  • unlink (bool, optional) – Should the scanner be unlinked from it’s upstream controller before restarting?

  • when_idle (bool, optional) – Should the scanner restart once there are no running scans?

Example

>>> nessus.server.restart(reason='Time to restart',
...                       when_idle=True,
...                       soft=True
...                       )
status() Dict[source]

Retrieves the current server status.

Returns:

The server status

Return type:

Dict

Example

>>> nessus.server.status()