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.
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')
...