--- projects/cms/source/host/ihost-perl/ihost.pl 2001/02/27 19:14:26 1.17 +++ projects/cms/source/host/ihost-perl/ihost.pl 2001/02/28 10:52:16 1.19 @@ -9,8 +9,8 @@ # methods as you see fit. # - pjm2@ukc.ac.uk # -# $Author: pjm2 $ -# $Id: ihost.pl,v 1.17 2001/02/27 19:14:26 pjm2 Exp $ +# $Author: tdb $ +# $Id: ihost.pl,v 1.19 2001/02/28 10:52:16 tdb Exp $ #------------------------------------------------------------ $| = 1; @@ -209,26 +209,7 @@ sub send_udp_packet() { } $disk_info .= ""; - my($hostname) = hostname(); - $hostname =~ s/\..*$//g; - my($resolv) = `cat /etc/resolv.conf`; - my($domainname); - my($machine_name); - if($resolv =~ /domain\s+([^\s]+)/) { - # some machines have domain in resolv.conf - $domainname = $1; - $machine_name = "$hostname.$domainname"; - } - elsif($resolv =~ /search\s+([^\s]+)/) { - # some machines have search in resolv.conf - $domainname = $1; - $machine_name = "$hostname.$domainname"; - } - else { - # we can't find out the domain - $machine_name = $hostname; - } - my($ip) = inet_ntoa(scalar(gethostbyname($hostname)) || 'localhost'); + my($ip) = inet_ntoa(scalar(gethostbyname(hostname())) || 'localhost'); # Build the XML packet this way, as we can clearly # see the structure and contents... I like this ;-) @@ -236,7 +217,7 @@ sub send_udp_packet() { # larger than 8196 bytes] my($xml) = < + $packet{"packet.load.load1"} $packet{"packet.load.load5"} @@ -283,6 +264,8 @@ EOF # Make the packet smaller by stripping out newlines and leading spaces. $xml =~ s/\n\s*//g; + +print $xml; my($sock) = new IO::Socket::INET ( PeerPort => $udp_port,