0

So, me and my team uses Pingdom for up time monitoring among other things. During our release process Pingdom alerts us that some of our websites are down, which is expected.

I would like to automate the process of pausing the necessary Pingdom checks. I have tried the following methods.

curl -X PUT -u 'username:Password' -H 'Content-Type: application/json' -H 'App-Key: applicationkey' -d 'paused=true' https://api.pingdom.com/api/2.0/checks/2477066

And followed a guide on how to do the same thing via a Python script (I have very minimal knowledge of Python).

    #!/usr/bin/python
    import sys
    import pingdom 
    sys.path.append('/home/ec2-user/git-repo/pingdom-cli')
    p = pingdom.Pingdom(username='username', password='password', appkey='applicationkey')
    p.pause_check('2477066')

As I said my knowledge is very minimal so I'm sure I've done something obviously wrong, any help would be appreciated.

Cheers.

1 Answer 1

1

Instead of import pingdom use import pingdomlib as this is the right name of the library.

import sys
import pingdomlib 
...
p = pingdomlib.Pingdom(username='username', password='password', apikey='applicationkey')
...
Sign up to request clarification or add additional context in comments.

7 Comments

There is no pause_check() function. Check it out in the api and correct it accordingly. github.com/KennethWilke/PingdomLib/…
Hi @omri_saadon thanks for the reply, I tried switching pingdom to pingdomlib and I get the following error: Traceback (most recent call last): File "pingdom.py", line 3, in <module> import pingdomlib ImportError: No module named pingdomlib
Cheers, I'm really showing my inexperience of Python here - Excuse me!
I've updated my script to this #!/usr/bin/python import sys import pingdom import pingdomlib sys.path.append('/home/ec2-user/git-repo/pingdom-cli') p=pingdomlib.Pingdom(username='username',password='password',appkey='appkey') p.pause_check('2238054')
And I now get the following error: TypeError: __init__() got an unexpected keyword argument 'appkey'
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.