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.
- .NET Runtime 8 or later
- Freshping account
- โ Freshworks disabled the ability to sign up for new Freshping accounts in 2023, so if you don't already have an account, you can't create one anymore.
- All billing plans are compatible: Sprout (free, 5 integrations), Blossom (10 integrations), and Garden (15 integrations)
- Ability to listen on a public WAN TCP port for incoming HTTP requests from Freshping without being blocked by a NAT or firewall
- PagerDuty account (the free plan is sufficient)
- Download the ZIP file for your operating system and CPU architecture from the latest release page.
- 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
.
- When installing updates, don't overwrite
- 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
.
- If this PowerShell script doesn't run, try removing the Mark of the Web by unblocking the file or calling
- 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 editfreshpager.service
to match.
- If the installation directory is not
- Windows:
- Create an Integration in PagerDuty and get its Integration Key.
- Sign into your PagerDuty account.
- Go to Services โบ Service Directory.
- Select an existing Service for which you want to publish events, or create a new Service.
- In the Integrations tab of the Service, add a new Integration.
- Under Most popular integrations, select Events API V2, then click Add.
- 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.
- Edit the
appsettings.json
configuration file.Key Example Value Description pagerDutyIntegrationKeysByFreshpingCheckId
{ "123": "abcโฆ" }
Object where each key is the numeric ID of a check in Freshping (go to a Report page and copy the value of the check_id
query parameter), and its value is the Integration Key you created for the matching PagerDuty Service in Step 1.kestrel.endpoints.https.url
http://0.0.0.0:37374
URI specifying the hostname and TCP port on which to listen for HTTP requests from the Freshping webhook client. Must be publicly accessible on the WAN. - Create a Webhook integration in Freshping.
- Sign into your Freshworks account.
- Go to your Freshping Dashboard.
- Go to Settings โบ Integrations.
- Under Webhook, select + Create Integration.
- Set the Webook Name to any name you want.
- Set the Event Type to Up/Down.
- Select the Checks that should trigger the alert.
- Set the Callback URL to the location of your FreshPager server, such as
http://myserver.example.com:37374/
. - Leave the request body set to Simple.
- Click Save.
- Start the service.
- Windows:
Restart-Service Freshpager
- Linux with systemd:
sudo systemctl restart freshpager.service
- Windows:
Freshping detects and confirms that a Check is down.
Freshping sends an HTTP POST request to each Webhook integration subscribed to Up/Down events on that Check.
- Your
FreshPager server receives the HTTP POST request from
Freshping.
FreshPager looks up the Integration Key in its configuration based on the Check ID from the request body.
FreshPager sends an Events API V2 request to
PagerDuty to trigger an alert on the Service that contains the Integration Key.
PagerDuty creates a new incident for this alert, and returns a unique key for this alert, which
FreshPager stores in memory.
- When
Freshping detects that the Check is up again, it sends another POST request to
FreshPager, which resolves the previously-created
PagerDuty alert using the same unique key.