Use SQL to instantly query resources from PagerDuty. Open source CLI. No DB required.

image

PagerDuty Plugin for Steampipe

Use SQL to query infrastructure services, teams, escalation policies and more from your PagerDuty account.

Quick start

Install the plugin with Steampipe:

steampipe plugin install pagerduty

Configure your credentials and config file.

Run a query:

select
  name,
  id,
  status
from
  pagerduty_service
where
  status = 'disabled';

Developing

Prerequisites:

Clone:

git clone https://github.com/turbot/steampipe-plugin-pagerduty.git
cd steampipe-plugin-pagerduty

Build, which automatically installs the new version to your ~/.steampipe/plugins directory:

make

Configure the plugin:

cp config/* ~/.steampipe/config
vi ~/.steampipe/config/pagerduty.spc

Try it!

steampipe query
> .inspect pagerduty

Further reading:

Contributing

Please see the contribution guidelines and our code of conduct. All contributions are subject to the Apache 2.0 open source license.

help wanted issues:

Owner
Turbot
Get cloud work done with Turbot — Creators of https://turbot.com/v5 and https://steampipe.io
Turbot
Comments
  • Simple query to pagerduty_incident table fails

    Simple query to pagerduty_incident table fails

    Describe the bug

    Query:

    SELECT id, summary FROM pagerduty_incident WHERE created_at >= '2022-09-28' ORDER BY created_at DESC
    Error: HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002) (SQLSTATE HV000)
    

    Plugin Logs:

    2022-09-29 16:35:52.100 UTC [ERROR] steampipe-plugin-pagerduty.plugin: [ERROR] 1664469241413: pagerduty_incident.listPagerDutyIncidents: query_error="HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)"
    2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: doList callHydrateWithRetries (pagerduty-1664469241413) returned err HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)
    2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: QueryData StreamError HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002) (pagerduty-1664469241413)
    2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: streamRows for pagerduty-1664469241413 - execution has failed (HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)) - calling queryCache.AbortSet
    2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: executeForConnection pagerduty returned error HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)
    2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: error channel received HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)
    

    Database Logs:

    2022-09-29 16:35:52.100 UTC [WARN]  hub: stream receive error rpc error: code = Unknown desc = HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002) (0xc0004f81a0)
    2022-09-29 16:35:52.101 UTC [5657] ERROR:  rpc error: code = Unknown desc = HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)
    2022-09-29 16:35:52.101 UTC [5657] STATEMENT:  select id, summary FROM pagerduty_incident WHERE created_at >= '2022-09-28' ORDER BY created_at DESC
    

    Steampipe version (steampipe -v)

    steampipe version 0.16.0
    

    Plugin version (steampipe plugin list)

    +--------------------------------------------------+---------+-------------+
    | Name                                             | Version | Connections |
    +--------------------------------------------------+---------+-------------+
    | hub.steampipe.io/plugins/turbot/aws@latest       | 0.78.0  | aws         |
    | hub.steampipe.io/plugins/turbot/jira@latest      | 0.6.0   | jira        |
    | hub.steampipe.io/plugins/turbot/okta@latest      | 0.8.0   | okta        |
    | hub.steampipe.io/plugins/turbot/pagerduty@latest | 0.2.1   | pagerduty   |
    | hub.steampipe.io/plugins/turbot/steampipe@latest | 0.6.0   | steampipe   |
    | local/battlestar                                 | local   | battlestar  |
    +--------------------------------------------------+---------+-------------+
    

    To reproduce Steps to reproduce the behavior (please include relevant code and/or commands).

    Expected behavior List of incidents is returned.

    Additional context It takes a minute or so for query to fails.

  • Allow filtering for service_ids or team_ids in table pagerduty_incident

    Allow filtering for service_ids or team_ids in table pagerduty_incident

    Is your feature request related to a problem? Please describe. When querying longer time ranges (e.g. last 14 days) in a PagerDuty account with a lot of services and high amount of total incidents, the query takes a lot of time (last 30 days = 25 minutes).

    Describe the solution you'd like The PagerDuty API allows additional filter parameters like service ids or team ids which could limit the requested amount of data and therefore the query runtime significantly. I would like to implement the additional filter parameters so they are used when the user adds a where clause for team id and / or service id to the query

    Additional context I would be happy to also implement the options to filter by service id or team id, but not sure how this could be achieved with the current table structure, since service and team infos are json objects in the results without a dedicated team_id or service_id column.

  • fix: fixed offset calculation for pagination

    fix: fixed offset calculation for pagination

    While executing queries on our PagerDuty account I got unrealistic results (e.g. number of incidents per Service), during further investigation I found a major bug in the offset calculation which not only resulted in the the same incidents appearing multiple times in the response, but also the very slow query runtimes mentioned in #18.

    Query to check for duplicate incidents

    select
        incident_number,
        count(*)
    from
        pagerduty_incident
    group by
        incident_number
    HAVING
        count(*) > 1
    
    +-----------------+-------+
    | incident_number | count |
    +-----------------+-------+
    +-----------------+-------+
    
  • Fix `title` column reference in `pagerduty_incident` and `pagerduty_incident_log` table

    Fix `title` column reference in `pagerduty_incident` and `pagerduty_incident_log` table

    Describe the bug In table pagerduty_incident and pagerduty_incident_log, the reference used for title column seems incorrect. Hence, the value comes as null.

    Steampipe version (steampipe -v) Example: v0.16.0

    Plugin version (steampipe plugin list) Example: v0.1.0

    To reproduce Run any query against the above-mentioned tables, and check the title column value.

    Expected behavior title should contain the value, i.e. ID or Summary.

    Additional context Add any other context about the problem here.

  • Recompile plugin with steampipe-plugin-sdk v4.1.4 and Go version 1.19

    Recompile plugin with steampipe-plugin-sdk v4.1.4 and Go version 1.19

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

  • Add table pagerduty_vendor

    Add table pagerduty_vendor

    References Add any related links that will help us understand the resource, including vendor documentation, related GitHub issues, and Go SDK documentation.

  • Add table pagerduty_service_integration

    Add table pagerduty_service_integration

    References Add any related links that will help us understand the resource, including vendor documentation, related GitHub issues, and Go SDK documentation.

  • Add table pagerduty_incident_log

    Add table pagerduty_incident_log

    References Add any related links that will help us understand the resource, including vendor documentation, related GitHub issues, and Go SDK documentation.

  • Add PagerDuty plugin initial tables, docs. Closes #1

    Add PagerDuty plugin initial tables, docs. Closes #1

    Tables Added

    • pagerduty_escalation_policy
    • pagerduty_priority
    • pagerduty_ruleset
    • pagerduty_ruleset_rule
    • pagerduty_service
    • pagerduty_tag
    • pagerduty_team
    • pagerduty_user
Use SQL to instantly query resources, data sources and more from Terraform code. Open source CLI. No DB required.
Use SQL to instantly query resources, data sources and more from Terraform code. Open source CLI. No DB required.

Terraform Plugin for Steampipe Use SQL to query data from Terraform configuration files. Get started → Documentation: Table definitions & examples Com

Dec 22, 2022
Use SQL to instantly query users, groups, applications and more from Okta. Open source CLI. No DB required.
Use SQL to instantly query users, groups, applications and more from Okta. Open source CLI. No DB required.

Okta Plugin for Steampipe Use SQL to query infrastructure including users, groups, applications and more from Okta. Get started → Documentation: Table

Nov 10, 2022
Use SQL to instantly query instances, networks, databases, and more from Scaleway. Open source CLI. No DB required.
Use SQL to instantly query instances, networks, databases, and more from Scaleway. Open source CLI. No DB required.

Scaleway Plugin for Steampipe Use SQL to query infrastructure servers, networks, databases and more from your Scaleway project. Get started → Document

Nov 16, 2022
Use SQL to instantly query Algolia indexes and configuration. Open source CLI. No DB required

Use SQL to instantly query Algolia indexes and configuration. Open source CLI. No DB required

Oct 1, 2022
Use SQL to query host, DNS and exploit information using Shodan. Open source CLI. No DB required.

Shodan Plugin for Steampipe Query Shodan with SQL Use SQL to query host, DNS and exploit information using Shodan. For example: select * from shod

Nov 10, 2022
Use SQL to data from CSV files. Open source CLI. No DB required.
Use SQL to data from CSV files. Open source CLI. No DB required.

CSV Plugin for Steampipe Use SQL to query data from CSV files. Get started → Documentation: Table definitions & examples Community: Slack Channel Get

Nov 10, 2022
Use SQL to instantly query file, domain, URL and IP scanning results from VirusTotal.
Use SQL to instantly query file, domain, URL and IP scanning results from VirusTotal.

VirusTotal Plugin for Steampipe Use SQL to query file, domain, URL and IP scanning results from VirusTotal. Get started → Documentation: Table definit

Nov 10, 2022
Use SQL to query information including Users, Groups, Clients, Roles and more from Keycloak.

Keycloak Plugin for Steampipe [WIP] THIS IS NOT ACTIVE NOR WORKING YET - DO NOT USE Use SQL to query information including Users, Groups, Clients, Rol

Jan 6, 2023
Use SQL to query instances, domains and more from Prometheus.
Use SQL to query instances, domains and more from Prometheus.

Use SQL to instantly query Prometheus metrics, alerts, labels and more. Open source CLI. No DB required.

Nov 28, 2022
Use SQL to query databases, logs and more from PlanetScale

Use SQL to instantly query PlanetScale databases, branches and more. Open source CLI. No DB required.

Sep 30, 2022
This is the code example how to use SQL to query data from any relational databases in Go programming language.

Go with SQL example This is the code example how to use SQL to query data from any relational databases in Go programming language. To start, please m

Mar 12, 2022
Go-Postgresql-Query-Builder - A query builder for Postgresql in Go

Postgresql Query Builder for Go This query builder aims to make complex queries

Nov 17, 2022
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases, streaming sources and file formats using

Dec 29, 2022
A Go SQL query builder and struct mapper.

godb - a Go query builder and struct mapper godb is a simple Go query builder and struct mapper, not a full-featured ORM. godb does not manage relatio

Dec 6, 2022
Query and Provision Cloud Infrastructure using an extensible SQL based grammar
Query and Provision Cloud Infrastructure using an extensible SQL based grammar

Deploy, Manage and Query Cloud Infrastructure using SQL [Documentation] [Developer Guide] Cloud infrastructure coding using SQL InfraQL allows you to

Oct 25, 2022
Query redis with SQL
Query redis with SQL

reqlite reqlite makes it possible to query data in Redis with SQL. Queries are executed client-side with SQLite (not on the redis server). This projec

Dec 23, 2022
write APIs using direct SQL queries with no hassle, let's rethink about SQL

SQLer SQL-er is a tiny portable server enables you to write APIs using SQL query to be executed when anyone hits it, also it enables you to define val

Jan 7, 2023
Parses a file and associate SQL queries to a map. Useful for separating SQL from code logic

goyesql This package is based on nleof/goyesql but is not compatible with it any more. This package introduces support for arbitrary tag types and cha

Oct 20, 2021
Go-sql-reader - Go utility to read the externalised sql with predefined tags

go-sql-reader go utility to read the externalised sql with predefined tags Usage

Jan 25, 2022