Skip to main content

Alert Commands

Alert commands are used for managing Key Manager alerts.

Alert management commonly involves procedures for verifying and resolving issues that initially caused the error. For additional information about alert types, including suggested actions for handling various alert types, see Key Manager Alerts.

count-alerts

Syntax:

ssh-mgr-client count-alerts [options] [-F <filter>] [-vvv] [-U <url>]

Returns the number of alerts that match the criteria.

For filtering (-F), you can use the same attributes that are available for the list-alerts command (see list-alerts).

The default command returns the number of alerts in the Key Manager system:

$ ssh-mgr-client count-alerts
15730

Example for returning the number of alerts on a certain host:

$ ssh-mgr-client count-alerts -F "host=example.server.com"
350

dismiss-alerts

Syntax:

ssh-mgr-client dismiss-alerts [options] (-F <filter> | -i <id>) [-vvv] [-U <url>]

Dismiss selected active alerts. You can select an alert by providing its ID (-i). Alternatively, you can select alerts using filters (-F). For filtering (-F), you can use the same attributes that are available for the list-alerts command (see list-alerts).

Example for dismissing an alert by ID:

$ ssh-mgr-client dismiss-alerts -i 64

Example for dismissing all alerts from a certain host:

$ ssh-mgr-client dismiss-alerts -F "host=example.server.com"

list-alerts

Syntax:

ssh-mgr-client list-alerts [options] [-F <filter>] \
[-vvv] [-U <url>] [-o <format>] [-C <columns>] [-H] \
[-O <sort-order>] [-S <start-from>] [-M <max-results>] [-E <delim>] [-B]

The default command displays all the alerts in the Key Manager system:

$ ssh-mgr-client list-alerts

2017-10-06T00:13:42.404Z,2017-10-06T00:13:42.404Z,server.example.com,Unmanaged ...
2017-09-21T12:06:21.502Z,2017-09-21T12:06:42.353Z,server.example.com,Legacy ...
2017-09-18T08:47:47.431Z,2017-09-18T08:47:47.432Z,,Host executor not available ...
2017-08-28T14:26:06.572Z,2017-08-28T14:26:06.573Z,,Job failed
...

The following columns can be used for filtering (-F) and output formatting (-C):

alert_type

Alert category

date

Date

description

Alert description. Only usable for output formatting (-C).

details

Alert details. Only usable for output formatting (-C).

host

Host

hostgroup

Name of host group that the alert concerns. Only usable for filtering (-F).

hostgroupid

Name of host group that the alert concerns. Only usable for filtering (-F).

id

Internal PrivX Key Manager id for alert

incidence_count

How many times this alert has occurred

last_updated

Date when the job was last updated

status

Alert status

For example, to list all the alerts that are active:

$ ssh-mgr-client list-alerts -F "status=active"

As another example, to display active alerts that are on a certain host:

$ ssh-mgr-client list-alerts -F "status=active&&host=example.server.com"

resolve-alerts

Syntax:

ssh-mgr-client resolve-alerts [options] (-F <filter> | -i <id>) [-vvv] [-U <url>]

Resolve the selected active alerts. You can select an alert by providing its ID (-i). Alternatively, you can select alerts using filters (-F). For filtering (-F), you can use the same attributes that are available for the list-alerts command (see list-alerts).

Example for resolving an alert by ID:

$ ssh-mgr-client resolve-alerts -i 64

Example for resolving all the alerts from a certain host:

$ ssh-mgr-client resolve-alerts -F "host=example.server.com"

show-alert

Syntax:

ssh-mgr-client show-alert -i <id> [options] \
[-vvv] [-U <url>] [-o <format>] [-C <columns>]

Displays the alert with the given ID.

For output formatting (-C), you can use the same attributes that are available for the list-alerts command (see list-alerts).

Example:

$ ssh-mgr-client show-alert -i 3