Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Pagerduty V2 PD-CEF fields #33

Open
wants to merge 1 commit into
base: master
from

Conversation

@atomicules
Copy link

atomicules commented May 31, 2019

Per PR 119 on pdagent, this extends the Pagerduty V2 API support to
pdagent-integrations by:

  • Sending through the required PD-CEF fields (these need to be sent to
    pdagent even if using V1 api per the current status of PR 119, even if
    not actually used for V1 api call)

  • Adding a command line flag to select the API version (defaults to V1)

  • Adds default mappings for certain PD-CEF fields from Sensu check results

  • Allows an optional argument to customise the mappings for PD-CEF
    fields from Sensu check results. That works as follows:

      --event-map "event_source,check.name"
    

    Comma separated and then the field we want from the check result in
    dot notation. It's fairly simplistic, not going to support fields
    that actually use dots in their name (but probably pretty rare in
    Sensu).

    That argument can be supplied multiple times for the different
    fields.

It's fairly well error handled (not perfectly) so that if a mapping fails
(e.g. because that field doesn't exist in the Sensu check result)
then it will just set that PD-CEF to an empty string

Have tried to copy command structure of PR 119 as much as is applicable.

Have not looked at tests yet.

References: PagerDuty/pdagent#119

Per PR 119 on pdagent, this extends the Pagerduty V2 API support to
pdagent-integrations by:

- Sending through the required PD-CEF fields (these need to be sent to
pdagent even if using V1 api per the current status of PR 119, even if
not actually used for V1 api call)
- Adding a command line flag to select the API version (defaults to V1)
- Adds default mappings for certain PD-CEF fields from Sensu check results
- Allows an optional argument to customise the mappings for PD-CEF
fields from Sensu check results. That works as follows:

        --event-map "event_source,check.name"

    Comma separated and then the field we want from the check result in
    dot notation. It's fairly simplistic, not going to support fields
    that actually use dots in their name (but probably pretty rare in
    Sensu).

    That argument can be supplied multiple times for the different
    fields.

It's _fairly_ well error handled (not perfectly) so that if a mapping fails
(e.g. because that field doesn't exist in the Sensu check result)
then it will just set that PD-CEF to an empty string

Have tried to copy command structure of PR 119 as much as is applicable.

Have not looked at tests yet.

References: PagerDuty/pdagent#119
@atomicules

This comment has been minimized.

Copy link
Author

atomicules commented May 31, 2019

I've not marked it as WIP as it works although I suppose strictly speaking should be considered WIP as I've not touched tests yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.