Alerts

class kismet_rest.Alerts(host_uri='http://127.0.0.1:2501', sessioncache_path='~/.pykismet_session', **kwargs)[source]

Alerts abstraction.

all(callback=None, callback_args=None, **kwargs)[source]

Yield all alerts, one at a time.

If callback is set, nothing will be returned.

Parameters:
  • callback – Callback function.
  • callback_args – Arguments for callback.
Keyword Arguments:
 
  • ts_sec (int) – Starting timestamp in seconds since Epoch.
  • ts_usec (int) – Microseconds for starting timestamp.
Yields:

dict – Alert json, or None if callback is set.

define(name, description, rate='10/min', burst='1/sec', phyname=None)[source]

Define an alert.

LOGIN REQUIRED

Define a new alert. This alert can then be triggered on external conditions via raise_alert(…)

Phyname is optional, and links the alert to a specific PHY type.

Rate and Burst are optional rate and burst limits.

Parameters:
  • name (str) – Name of alert.
  • description (str) – Description of alert.
  • rate (str) – Rate limit. Defaults to 10/min.
  • burst (str) – Burst limit. Defaults to 1/sec.
  • phyname (str) – Name of PHY. Defaults to None.
Returns:

True for success, False for failed request.

Return type:

bool

raise_alert(name, text, bssid=None, source=None, dest=None, other=None, channel=None)[source]

Raise an alert in Kismet.

Trigger an alert; the alert can be one defined via define_alert(…) or an alert built into the system.

The alert name and content of the alert are required, all other fields are optional.

Parameters:
  • name (str) – Name of alert.
  • text (str) – Descriptive text for alert.
  • bssid (str) – BSSID to filter for.
  • source (str) –

  • dest (str) –

  • other (str) –

  • channel (str) – Channel to filter for.