turbot/pagerduty
steampipe plugin install pagerduty

PagerDuty + Steampipe

PagerDuty is a platform for agile incident management.

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

List disabled services in your PagerDuty account:

select
name,
id,
status
from
pagerduty_service
where
status = 'disabled';
+-----------+---------+--------+
| name | id | status |
+-----------+---------+--------+
| Steampipe | PE0PJEP | active |
+-----------+---------+--------+

Documentation

Get started

Install

Download and install the latest PagerDuty plugin:

steampipe plugin install pagerduty

Credentials

ItemDescription
CredentialsGet your user token or if you have Admin, Global Admin or Account Owner access within your PagerDuty account, generate a general authorization token.
Resolution1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/pagerduty.spc).
2. Credentials specified in environment variables, e.g., PAGERDUTY_TOKEN.

Configuration

Installing the latest pagerduty plugin will create a config file (~/.steampipe/config/pagerduty.spc) with a single connection named pagerduty:

connection "pagerduty" {
plugin = "pagerduty"
# Account or user API token
# This can also be set via the `PAGERDUTY_TOKEN` environment variable.
# token = "u+AtBdqvNtestTokeNcg"
}

Postgres FDW

This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- pagerduty

The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.

To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.

CREATE EXTENSION IF NOT EXISTS steampipe_postgres_pagerduty;
CREATE SERVER steampipe_pagerduty FOREIGN DATA WRAPPER steampipe_postgres_pagerduty OPTIONS (config '<your_config>');
CREATE SCHEMA pagerduty;
IMPORT FOREIGN SCHEMA pagerduty FROM SERVER steampipe_pagerduty INTO pagerduty;

SQLite Extension

This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- pagerduty

The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.

To configure the SQLite extension, load the extension module and then run the steampipe_configure_pagerduty function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_pagerduty.so
sqlite> select steampipe_configure_pagerduty('<your_config>');

Export

This plugin is available as a standalone Export CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- pagerduty

You can pass the configuration to the command with the --config argument:

steampipe_export_pagerduty --config '<your_config>' <table_name>