#!/usr/bin/perl

use IO::Socket;

#################################################################
# This is a small script to report an IP to a server.
# Note that it is silent and will not do anything if it fails.
#################################################################

#Enter the ID Number (REQUIRED) This is what uniquely identifies
# This server from any other on your network.

my $uniid = 0;

#Enter an ID String Below if You want an additional Identification
#String sent to the server.

my $idstring = "";

#Enter the host and port your server is listening on.

my $host = "report.domain.com";
my $port = 4010;


#################################################################

##########################################################
#######         End Of Modifiable Variables.       #######
##########################################################

#open a socket connection to a given destination
my $socket = IO::Socket::INET->new(
    PeerAddr => $host,
    PeerPort => $port,
    Proto    => "tcp",
    Type     => SOCK_STREAM
    ) or exit(1);

sleep(1);

print $socket "$uniid"."\t";

if($idstring ne ""){
	print $socket $idstring;
	}

sleep(2);

close ($socket);
