simulated hostname file and ability to declare a different file for Host probe
[scpubgit/System-Introspector.git] / lib / System / Introspector / Probe / ResolvConf.pm
CommitLineData
afd7c030 1package System::Introspector::Probe::ResolvConf;
9cebf8c1 2use Moo;
3
f3d816a0 4use System::Introspector::Util qw(
13642dda 5 output_from_file
f3d816a0 6 transform_exceptions
7);
8
21fd4f46 9has resolv_conf_file => (
10 is => 'ro',
11 default => sub { '/etc/resolv.conf' },
12);
13
9cebf8c1 14sub gather {
15 my ($self) = @_;
13642dda 16 return {
17 resolv_conf_file => transform_exceptions {
18 my $file = $self->resolv_conf_file;
19 return {
20 file_name => $file,
21 body => scalar output_from_file $file,
22 };
23 },
f3d816a0 24 };
9cebf8c1 25}
26
9cebf8c1 271;
535e84b6 28
29__END__
30
31=head1 NAME
32
33System::Introspector::ResolvConf - Gather name resolution configuration
34
35=head1 DESCRIPTION
36
37Reads a C<resolv.conf> file to gather information about name resolution.
38
39=head1 ATTRIBUTES
40
41=head2 resolv_conf_file
42
43The path to the C<resolv.conf> file that should be read. Defaults to
44C</etc/resolv.conf>.
45
46=head1 SEE ALSO
47
48=over
49
50=item L<System::Introspector>
51
52=back
53
54=cut
55