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

Add pingdom support #44

Closed
jasongwartz opened this issue Apr 12, 2018 · 10 comments
Closed

Add pingdom support #44

jasongwartz opened this issue Apr 12, 2018 · 10 comments
Assignees
Labels
kind/enhancement New feature or request workflow/done

Comments

@jasongwartz
Copy link

Saw the Medium article, great tool!

We use Pingdom, which also has a decent API (though a fair bit different from the UptimeRobot API).

If this isn't already in the works, I'll have a crack at it 😄 - seems like there might be some changes needed to the httpClient layer to make it happen.

@waseem-h waseem-h added the kind/enhancement New feature or request label Apr 13, 2018
@rasheedamir
Copy link
Member

@jasongwartz please go ahead and crack it! currently we don't have any plans to support pingdom but will be very happy if you can help us to add it.

@rasheedamir rasheedamir changed the title Pingdom support Add pingdom support Apr 13, 2018
@mmiller1
Copy link

@jasongwartz have you started any work towards this? I'd be willing to chip in as well to see this happen.

@jasongwartz
Copy link
Author

@mmiller1 great! I started to take a look at it a few days ago. The httpClient is written pretty exclusively for UptimeRobot, and large parts of it need to be rewritten to work with the Pingdom API - it currently only implements POST, and Pingdom needs both POST and GET, as well as requiring HTTP Basic Auth in addition to an API token parameter. There's also a big chunk of work to model all the Pingdom API responses as structs to be unmarshaled.

When I get a chance, I'll push my current work (not yet running) up to my fork, so you can take a look at it and extend if possible.

@mmiller1
Copy link

I have a working solution based off of this pingdom go client https://github.com/russellcardullo/go-pingdom. I ended up making a few changes outside of just implementing the monitor service interface. Most notably I'm passing all annotations into the monitor objects in order to parse for additional configuration values. it's working fine for pingdom, but has not been tested for regression against up time robot.

@ahmadiq
Copy link
Contributor

ahmadiq commented Apr 24, 2018

@mmiller1 Cool. If you can create a pull request the team can review and test with uptime robot as well.

@rasheedamir
Copy link
Member

@mmiller1 @jasongwartz

Hi guys, It will be awesome if anyone of you can plz test this implementation of pingdom? We don't have account with pingdom to verify it!

#55

@jasongwartz
Copy link
Author

@rasheedamir Our workflow has changed a bit but I will definitely give it a try as soon as I can, not sure how soon it will be.

@mmiller1
Copy link

mmiller1 commented May 31, 2018

I've tested your branch, the monitors are created, but with the incorrect host / path. The following diff makes it work

diff --git a/src/pingdom-monitor.go b/src/pingdom-monitor.go
index b2238ca..e1275e2 100644
--- a/src/pingdom-monitor.go
+++ b/src/pingdom-monitor.go
@@ -109,7 +109,7 @@ func (service *PingdomMonitorService) Remove(m Monitor) {
 
 func (service *PingdomMonitorService) createHttpCheck(monitor Monitor) pingdom.HttpCheck {
        httpCheck := pingdom.HttpCheck{}
-       url, err := url.Parse(service.url)
+       url, err := url.Parse(monitor.url)
        if err != nil {
                log.Println("Unable to parse the URL: ", service.url)
        }

edit: I realized what the problem was immediately after commenting - super simple fix.

@waseem-h
Copy link
Contributor

Closed with #55

@rasheedamir
Copy link
Member

@mmiller1 is it working as expected or you still see some issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request workflow/done
Projects
None yet
Development

No branches or pull requests

5 participants