Skip to content

Commit

Permalink
enh(audit): better system detection (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
garnier-quentin authored Jan 27, 2022
1 parent 970869c commit 5c3ec73
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions centreon-gorgone/gorgone/modules/centreon/audit/class.pm
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ sub get_system {
my ($self, %options) = @_;

$self->{os} = 'unknown';

my ($rv, $message, $content) = gorgone::standard::misc::slurp(file => '/etc/os-release');
if ($rv && $content =~ /^ID="(.*?)"/mi) {
$self->{os} = $1
return ;
}

my ($error, $stdout, $return_code) = gorgone::standard::misc::backtick(
command => 'lsb_release -a',
timeout => 5,
Expand Down

0 comments on commit 5c3ec73

Please sign in to comment.