1 package System::Introspector::Probe::Host;
4 use System::Introspector::Util qw(
11 has hostname_file => (is => 'ro', default => sub {'/etc/hostname' });
15 return transform_exceptions {
17 hostname => $self->_gather_hostname,
18 uname => $self->_gather_uname_info,
34 sub _gather_uname_info {
37 for my $field (@UnameFields) {
38 (my $option = $field) =~ s{_}{-}g;
39 my $value = output_from_command [uname => "--$option"];
41 $uname{ $field } = $value;
46 sub _gather_hostname {
48 my $hostname = output_from_file $self->hostname_file;
50 $hostname =~ s{(?:^\s+|\s+$)}{}g;
60 System::Introspector::Host - Gather generic host information
64 Gathers the hostname and information provided by C<uname>.
70 =item L<System::Introspector>