summaryrefslogtreecommitdiffstats
path: root/etc/smokemail.dist
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2005-02-11 21:22:38 +0100
committerTobi Oetiker <tobi@oetiker.ch>2005-02-11 21:22:38 +0100
commit3623e33d0ae10eaeca653e00a3796495dbc0f713 (patch)
treea0835e8015f995402c2b8046255d7d101e7f9a59 /etc/smokemail.dist
downloadsmokeping-3623e33d0ae10eaeca653e00a3796495dbc0f713.tar.gz
smokeping-3623e33d0ae10eaeca653e00a3796495dbc0f713.tar.xz
initial import
Diffstat (limited to 'etc/smokemail.dist')
-rw-r--r--etc/smokemail.dist65
1 files changed, 65 insertions, 0 deletions
diff --git a/etc/smokemail.dist b/etc/smokemail.dist
new file mode 100644
index 0000000..5b4d4da
--- /dev/null
+++ b/etc/smokemail.dist
@@ -0,0 +1,65 @@
+From: <##FROM##>
+To: <##TO##>
+Subject: SmokePing Agent
+
+Hi,
+
+Please execute the attache Perl Script on your computer. It will register
+your IP with SmokePing. You have to rerun this script at least everytime
+your IP changes. You can run the script as often as you want.
+
+The script is written in Perl. If you don't have Perl available on your
+system, you must have a Windows Box. You can easily fix this prolem by
+downloading ActivePerl from www.activestate.com
+
+As soon as you have run the SmokePing Agent, the SmokePing server will
+start monitoring your host. Check out:
+<##URL##>?target=<##PATH##>
+
+Cheers
+<##OWNER##>
+
+------------8<------------------------
+#!/usr/bin/perl -w
+
+my $url = '<##URL##>';
+my $path = '<##PATH##>';
+my $secret = '<##SECRET##>';
+
+use strict;
+use IO::Socket;
+
+my $post="target=${path}&secret=${secret}";
+my $clen=length $post;
+
+$url =~ m|http://([^/]+)(/.+)|;
+my $host = $1;
+my $script = $2;
+
+my $remote = IO::Socket::INET->new( Proto => "tcp",
+ PeerAddr => $host,
+ PeerPort => "http(80)",
+ );
+exit 0 unless $remote;
+$remote->autoflush(1);
+
+print $remote <<"REQUEST";
+POST $script HTTP/1.0\r
+User-Agent: smokeping-agent/1.0\r
+Host: ${host}:80\r
+Pragma: no-cache\r
+Content-Length: ${clen}\r
+Content-Type: application/x-www-form-urlencoded\r
+\r
+${post}\r
+REQUEST
+
+my $head = 1;
+while (<$remote>) {
+ /^\s*$/ && do {$head=0;next};
+ print unless $head;
+}
+
+close $remote;
+exit;
+------------8<------------------------