Code Monkey home page Code Monkey logo

freshpager's Introduction

Freshping FreshPager

When Freshping detects an outage, trigger an alert in PagerDuty (and resolve when it's up again).

This is helpful because Freshping's only built-in notification system is email, and the Gmail Android app is extremely slow to notify you of new messages: notifications are often hours late. PagerDuty, on the other hand, has realtime alerting with SMS messages and mobile app push notifications for Android and iOS.

This is a free, open-source, no sign-up, self-hostable alternative to the Zapier Freshping + PagerDuty integration.

  1. Prerequisites
  2. Installation
  3. Configuration
  4. Execution
  5. Signal Flow

Prerequisites

Installation

  1. Download the ZIP file for your operating system and CPU architecture from the latest release page.
  2. Extract the ZIP file to a directory of your choice, such as C:\Program Files\FreshPager\ or /opt/freshpager/.
    • When installing updates, don't overwrite appsettings.json.
  3. Install the service so it will start automatically when your computer boots.
    • Windows: & '.\Install service.ps1'
      • If this PowerShell script doesn't run, try removing the Mark of the Web by unblocking the file or calling Set-ExecutionPolicy RemoteSigned.
    • Linux with systemd:
      sudo cp freshpager.service /etc/systemd/system/
      sudo systemctl daemon-reload
      sudo systemctl enable freshpager.service
      • If the installation directory is not /opt/freshpager/, make sure to update freshpager.service to match.

Configuration

  1. Create an Integration in PagerDuty and get its Integration Key.
    1. Sign into your PagerDuty account.
    2. Go to Services โ€บ Service Directory.
    3. Select an existing Service for which you want to publish events, or create a new Service.
    4. In the Integrations tab of the Service, add a new Integration.
    5. Under Most popular integrations, select Events API V2, then click Add.
    6. Expand the newly-created Integration and copy its Integration Key, which will be used to authorize this program to send Events to the correct Service.
  2. Edit the appsettings.json configuration file.
    Key Example Value Description
    pagerDutyIntegrationKeysByService
    { "My Server": "y5mfpโ€ฆ" }
    Object where each key is the name of a check in Freshping, and its value is the Integration Key you created for the matching PagerDuty Service in Step 1.
    httpServerPort 37374 The TCP port on which to listen for HTTP requests from the Freshping webhook client. Must be publicly accessible on the WAN.
  3. Create Webhook integration in Freshping.
    1. Sign into your Freshworks account.
    2. Go to your Freshping Dashboard.
    3. Go to Settings โ€บ Integrations.
    4. Under Webhook, select + Create Integration.
    5. Set the Webook Name to any name you want.
    6. Set the Event Type to Up/Down.
    7. Select the Checks that should trigger the alert.
    8. Set the Callback URL to the location of your FreshPager server, such as http://myserver.example.com:37374/.
    9. Leave the request body set to Simple.
    10. Click Save.

Execution

  1. Start the service.
    • Windows: Restart-Service Freshpager
    • Linux with systemd: sudo systemctl restart freshpager.service

Signal Flow

  1. Freshping Freshping detects and confirms that a Check is down.
  2. Freshping Freshping sends an HTTP POST request to each Webhook integration subscribed to Up/Down events on that Check.
  3. Your Aldaviva FreshPager server receives the HTTP POST request from Freshping Freshping.
  4. Aldaviva FreshPager looks up the Integration Key in its configuration based on the Check name from the request body.
  5. Aldaviva FreshPager sends an Events API V2 request to PagerDuty PagerDuty to trigger an alert on the Service that contains the Integration Key.
  6. PagerDuty PagerDuty creates a new incident for this alert, and returns a unique key for this incident, which Aldaviva FreshPager stores in memory.
  7. When Freshping Freshping detects that the Check is up again, it sends another POST request to Aldaviva FreshPager, which resolves the previously-created PagerDuty PagerDuty alert using the same unique key.

freshpager's People

Contributors

aldaviva avatar

Watchers

 avatar

freshpager's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.