Adisegna wrote:
> So far this is what I have come up with doing some research.
>
> import urllib
> for line in urllib.urlopen('http://mywebsit.com/folder/folder/test.asp'):
> if '400 Bad Request' in line:
>
> text_file = open("mysite.log", "a")
> text_file.writelines(line)
> text_file.w
Adisegna wrote:
> Hi,
>
> I just started learning Python and would like to try writing a
> monitoring script.
>
> What I would like to do is use Telnet to send a GET via port 80 to a
> status page in a directory to verify my site is up.
I use httplib for this. You can probably do it with urlli
So far this is what I have come up with doing some research.
import urllib
for line in urllib.urlopen('http://mywebsit.com/folder/folder/test.asp'):
if '400 Bad Request' in line:
text_file = open("mysite.log", "a")
text_file.writelines(line)
text_file.writelines("\n")
text_file.close()
Hi,
I just started learning Python and would like to try writing a monitoring script.
What I would like to do is use Telnet to send a GET via port 80 to a status page in a directory to verify my site is up.
Psuedo code:
Connect = telnet website.com 80
Send = GET /folder/folder/test.asp HTTP/1.