source: ocsinventory-agent/trunk/fuentes/lib/Ocsinventory/Agent/Backend/OS/Solaris.pm @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 1.1 KB
Line 
1package Ocsinventory::Agent::Backend::OS::Solaris;
2
3use strict;
4use vars qw($runAfter);
5$runAfter = ["Ocsinventory::Agent::Backend::OS::Generic"];
6
7sub check {$^O =~ /^solaris$/}
8
9sub run {
10  my $params = shift;
11  my $common = $params->{common};
12
13  my $OSName;
14  my $OSComment;
15  my $OSVersion;
16  my $OSLevel;
17  my $HWDescription;
18  my ( $karch, $hostid, $proct, $platform);
19
20  #Operating system informations
21  chomp($OSName=`uname -s`);
22  chomp($OSLevel=`uname -r`);
23  chomp($OSComment=`uname -v`);
24
25   open(FH, "< /etc/release") and do {
26       chomp($OSVersion = readline (FH));
27       $OSVersion =~ s/^\s+//;
28       close FH;
29   };
30
31  chomp($OSVersion=`uname -v`) unless $OSVersion;
32  chomp($OSVersion);
33  $OSVersion=~s/^\s*//;
34  $OSVersion=~s/\s*$//;
35     
36  # Hardware informations
37  chomp($karch=`arch -k`);
38  chomp($hostid=`hostid`);
39  chomp($proct=`uname -p`);
40  chomp($platform=`uname -i`);
41  $HWDescription = "$platform($karch)/$proct HostID=$hostid";
42
43  $common->setHardware({
44      OSNAME => "$OSName $OSLevel",
45      OSCOMMENTS => $OSComment,
46      OSVERSION => $OSVersion,
47      DESCRIPTION => $HWDescription
48    });
49}
50
51
521;
Note: See TracBrowser for help on using the repository browser.