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.
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()
Hello,
I found this script to send mail online. It works fine but requires me
to enter an mail server. I'm looking for something else that doesn't
require and SMTP server. Having to specify a mail server prohibits me
from sending to alternate domains.
Thanks in advance
smtpserver = 'my.mailser
l too. What if I wanted to send an email to 3
different people on three different domains hosted by 3 different mail servers? Smtlib prohibits this
functionality. Do you see what I mean now...?
Thanks for replying...On 11/20/05, Danny Yoo <
[EMAIL PROTECTED]> wrote:
On Sat, 19 Nov 2005, Adi
I guess I should keep the same subject line (above)
from now on since my last few posts (urllib, smtplib) are about the
same program.
My question is how to use a loop to go through a tuple of URLs. Please feel free to suggest an easier way to do the same thing.
Here is my rudimentary program so
How do I get the counting loop to come
back around? It makes one pass fine. How do I get it to come back up
and go through again?
Thanks
---
import urllib, smtplib
urls = ("http://website0.net/imalive.asp",
"http://website1.net/imal
ormat=flowed
Adisegna wrote:
> How do I get the counting loop to come back around? It makes one pass
> fine. How do I get it to come back up and go through again?
You
have to indent the statement 'count += 1' so it is part of the loop.
But you misunderstand the for loop - the count v
This worked for me. Thanks!
--
for web in urls:
for site in urllib.urlopen(web):
---
You
have to indent the statement 'count += 1' so it is part of the loop.
But you misunderstand the for loop