--- projects/cms/source/host/ihost-perl/ihost.pl 2001/02/05 17:20:07 1.14 +++ 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.14 2001/02/05 17:20:07 pjm2 Exp $ +# $Author: tdb $ +# $Id: ihost.pl,v 1.19 2001/02/28 10:52:16 tdb Exp $ #------------------------------------------------------------ $| = 1; @@ -32,6 +32,7 @@ use vars qw ( $tcp_port $filter_addr $file_list + $fqdn ); if (@ARGV != 2) { @@ -119,6 +120,13 @@ sub tcp_configure() { print "File list obtained: $file_list\n"; + print $sock "FQDN\n"; + $response = <$sock>; + chop $response; + $fqdn = $response; + + print "FQDN returned: $fqdn\n"; + print $sock "UDPUpdateTime\n"; $response = <$sock>; chop $response; @@ -190,23 +198,18 @@ sub send_udp_packet() { my($disk_info) = ""; my($i) = 0; while (defined $packet{"packet.disk.p$i.attributes.mount"}) { - $disk_info .= ""; - $disk_info .= qq/$packet{"packet.disk.p$i.attributes.name"}<\/name>/; - $disk_info .= qq/$packet{"packet.disk.p$i.attributes.kbytes"}<\/kbytes>/; - $disk_info .= qq/$packet{"packet.disk.p$i.attributes.used"}<\/used>/; - $disk_info .= qq/$packet{"packet.disk.p$i.attributes.avail"}<\/avail>/; - $disk_info .= qq/$packet{"packet.disk.p$i.attributes.mount"}<\/mount>/; - $disk_info .= ""; + $disk_info .= " + $packet{"packet.load.load1"} $packet{"packet.load.load5"} @@ -261,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,