--- projects/cms/source/host/ihost-perl/ihost.pl 2001/01/26 17:26:11 1.2 +++ projects/cms/source/host/ihost-perl/ihost.pl 2001/01/29 09:19:16 1.8 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -w +#!/usr/bin/perl -w # ----------------------------------------------------------- # Perl i-scream Host. @@ -9,7 +9,7 @@ # - pjm2@ukc.ac.uk # # $Author: pjm2 $ -# $Id: ihost.pl,v 1.2 2001/01/26 17:26:11 pjm2 Exp $ +# $Id: ihost.pl,v 1.8 2001/01/29 09:19:16 pjm2 Exp $ #------------------------------------------------------------ $| = 1; @@ -88,7 +88,7 @@ sub tcp_configure() { chop $response; $last_modified = $response; - print "Config last modified: ". scalar localtime $last_modified . "\n"; + print "Config last modified: ". (scalar localtime $last_modified/1000) . "\n"; print $sock "FILELIST\n"; $response = <$sock>; @@ -107,7 +107,7 @@ sub tcp_configure() { chop $response; $tcp_update_time = $response; - print "UDP packet period: $udp_update_time seconds.\nTCP heartbeat period: $tcp_update_time.\n"; + print "UDP packet period: $udp_update_time seconds.\nTCP heartbeat period: $tcp_update_time seconds.\n"; print $sock "ENDCONFIG\n"; $response = <$sock>; @@ -169,9 +169,9 @@ sub send_udp_packet() { $disk_info .= ""; my($hostname) = hostname(); - $hostname =~ s/^([^\.]*?).*$/$1/; - my($domainname) = `cat /etc/resolv.conf`; - $domainname =~ s/domain\s*([^\s]*?)/$1/; + $hostname =~ s/\..*$//g; + `cat /etc/resolv.conf` =~ /domain\s+([^\s]+)/; + my($domainname) = $1; my($machine_name) = "$hostname.$domainname"; my($ip) = inet_ntoa(scalar(gethostbyname($hostname)) || 'localhost');