russellcardullo / go-pingdom

No longer maintained: Pingdom API access from Go
MIT License
29 stars 75 forks source link

Added TCP Checks support #34

Closed kamermans closed 6 years ago

kamermans commented 6 years ago

Added support for TCP Checks. This includes full CRUD support on TCPCheck objects, and allows users to create TCP checks with the required Port and optional StringToSend and StringToExpect fields.

Note that I've also fixed a bug that prevents saving tags on Ping checks.

[CC @tiddnet]

deedubs commented 6 years ago

Unfortunately, this seems to have broken HTTPChecks as it has made ResponseTimeThreshold a mandatory attribute

    newCheck := pingdom.HttpCheck{
        Name:                  check.Namespace + "/" + check.Name,
        Hostname:              check.Spec.Host,
        Resolution:            1,
        Tags:                  fmt.Sprintf("%s", check.Namespace),
    }

    resp, err := client.Create(&newCheck)

400 Bad Request: Invalid parameter value => responsetime_threshold`

    newCheck := pingdom.HttpCheck{
        Name:                  check.Namespace + "/" + check.Name,
        Hostname:              check.Spec.Host,
        Resolution:            1,
        Tags:                  fmt.Sprintf("%s", check.Namespace),
        ResponseTimeThreshold: 30000,
    }

    resp, err := client.Create(&newCheck)

200 OK

kamermans commented 6 years ago

@deedubs are you sure it was my PR? I see there were many other changes pulled in on the same day and I don't see how my changes have affected this, but I'm happy to fix it if they have!

I'll take a look around at the other updates: https://github.com/russellcardullo/go-pingdom/compare/7c255c6...ee6ac889eb232f148d9343062f7888e0a3421862

kamermans commented 6 years ago

Here you go, this is the commit by @mdibaiee that did it: https://github.com/russellcardullo/go-pingdom/commit/3ad6c5135bc2d867b83b120fd77470118d3da01e, it was merged in PR #30

deedubs commented 6 years ago

Apologies Steve. I guess I need more sleep too

Dan Williams

On Fri, Oct 19, 2018, 2:43 AM Steve Kamerman, notifications@github.com wrote:

Here you go, this is the commit by @mdibaiee https://github.com/mdibaiee that did it: 3ad6c51 https://github.com/russellcardullo/go-pingdom/commit/3ad6c5135bc2d867b83b120fd77470118d3da01e, it was merged in PR #30 https://github.com/russellcardullo/go-pingdom/pull/30

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/russellcardullo/go-pingdom/pull/34#issuecomment-431261373, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAnUxoNXnVWZmn_x-Iio0OdRKAflu-wks5umXSngaJpZM4W0qbL .