snogo

package module
v0.0.0-...-aff06aa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2019 License: MIT Imports: 11 Imported by: 1

README

Snogo

Go Report CardMaintainabilityBuild Statuscodecov.io MIT License

A Prometheus webhook receiver that generates ServiceNow incidents.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites
  • golang
yum/apt-get/brew install go
Installing

Setup your local environment and produce the snogo binary.

$ export GOPATH='/home/me/some/path'
$ go get -u github.com/healthpartnersoss/snogo

This will produce a working binary.

Use environment variables to change the behavior of Snogo.

export SERVICE_NOW_INSTANCE_NAME='service_now_org'
export SERVICE_NOW_USERNAME='me'
export SERVICE_NOW_PASSWORD='secretme'

Execute snogo.

./snogo

When executed, Snogo will begin listening on port 8080 and is ready to receive Alertmanager events.

The last step (external to running this binary) is to point an alertmanager webhook receiver at Snogo.

- name: service-now
  webhook_configs:
  - send_resolved: false
    url: http://localhost:8080/

Running the tests

We use the built-in go test mechanism for coverage.

go test

Deployment

  • Execute the binary as a system user
  • Open port 8080 (by default)

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer()

Types

type IncidentCreationPayload

type IncidentCreationPayload struct {
	AssignmentGroup  string      `json:"assignment_group"`
	CmdbCI           string      `json:"cmdb_ci"`
	ContactType      string      `json:"contact_type"` //Auto Ticket
	Customer         string      `json:"caller_id"`
	Description      string      `json:"description"`
	Impact           json.Number `json:"impact"`
	ShortDescription string      `json:"short_description"`
	State            json.Number `json:"state"`
	Urgency          json.Number `json:"urgency"`
}

IncidentCreationPayload Data to create an incident in service-now

type ServiceNowInstance

type ServiceNowInstance struct {
	// contains filtered or unexported fields
}

ServiceNowInstance should hold the necessary data for a client of the ServiceNow TableAPI

func DefaultServiceNowClient

func DefaultServiceNowClient() *ServiceNowInstance

DefaultServiceNowClient get the client from the environment vars

func NewInstance

func NewInstance(name, user, pass string) *ServiceNowInstance

NewInstance - Create new service-now instance

func (*ServiceNowInstance) Create

func (inst *ServiceNowInstance) Create(table string, body []byte) (string, error)

Create an incident in service-now based on a post body

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL