| 1 |
< |
#!/usr/local/bin/perl -w |
| 1 |
> |
#!/usr/bin/perl -w |
| 2 |
|
|
| 3 |
|
# ----------------------------------------------------------- |
| 4 |
|
# Perl i-scream Host. |
| 88 |
|
chop $response; |
| 89 |
|
$last_modified = $response; |
| 90 |
|
|
| 91 |
< |
print "Config last modified: ". scalar localtime $last_modified . "\n"; |
| 91 |
> |
print "Config last modified: ". (scalar localtime $last_modified/1000) . "\n"; |
| 92 |
|
|
| 93 |
|
print $sock "FILELIST\n"; |
| 94 |
|
$response = <$sock>; |
| 107 |
|
chop $response; |
| 108 |
|
$tcp_update_time = $response; |
| 109 |
|
|
| 110 |
< |
print "UDP packet period: $udp_update_time seconds.\nTCP heartbeat period: $tcp_update_time.\n"; |
| 110 |
> |
print "UDP packet period: $udp_update_time seconds.\nTCP heartbeat period: $tcp_update_time seconds.\n"; |
| 111 |
|
|
| 112 |
|
print $sock "ENDCONFIG\n"; |
| 113 |
|
$response = <$sock>; |
| 169 |
|
$disk_info .= "</disk>"; |
| 170 |
|
|
| 171 |
|
my($hostname) = hostname(); |
| 172 |
< |
$hostname =~ s/^([^\.]*?)/$1/; |
| 172 |
> |
$hostname =~ s/\..*$//g; |
| 173 |
|
my($domainname) = `cat /etc/resolv.conf`; |
| 174 |
< |
$domainname =~ s/domain\s*([^\s]*?)/$1/; |
| 174 |
> |
$domainname =~ /domain\s+([^\s]+)/; |
| 175 |
> |
$domainname = $1; |
| 176 |
|
my($machine_name) = "$hostname.$domainname"; |
| 177 |
|
my($ip) = inet_ntoa(scalar(gethostbyname($hostname)) || 'localhost'); |
| 178 |
|
|