Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import urllib2
- import re
- nginx = ['nginx1.tld',
- 'nginx2.tld',
- 'nginx3.tld',
- 'nginx4.tld'
- ]
- def getStats():
- for key in nginx:
- url = "http://" + key + "/status"
- req = urllib2.Request(url)
- res = urllib2.urlopen(req)
- out = re.findall(r'\d{1,8}', res.read())
- return out[0]
- def main():
- print getStats()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement