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

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

Copyt trusty code

File size: 1.5 KB
Line 
1package Ocsinventory::Agent::Backend::OS::BSD::Archs::Alpha;
2
3use strict;
4
5sub check{
6    my $arch;
7    chomp($arch=`sysctl -n hw.machine`);
8    $arch eq "alpha";
9}
10
11sub run {
12  my $params = shift;
13  my $common = $params->{common};
14
15  my( $SystemSerial , $SystemModel, $SystemManufacturer, $BiosManufacturer,
16    $BiosVersion, $BiosDate);
17  my ( $processort , $processorn , $processors );
18
19  ### Get system model with "sysctl hw.model"
20  #
21  # example on *BSD
22  # hw.model = AlphaStation 255 4/232
23
24  chomp($SystemModel=`sysctl -n hw.model`);
25  $SystemManufacturer = "DEC";
26
27  ### Get processor type and speed in dmesg
28  #
29  # NetBSD:    AlphaStation 255 4/232, 232MHz, s/n
30  #            cpu0 at mainbus0: ID 0 (primary), 21064A-2
31  # OpenBSD:   AlphaStation 255 4/232, 232MHz
32  #            cpu0 at mainbus0: ID 0 (primary), 21064A-2 (pass 1.1)
33  # FreeBSD:   AlphaStation 255 4/232, 232MHz
34  #            CPU: EV45 (21064A) major=6 minor=2
35
36  for (`dmesg`) {
37      if (/^cpu[^:]*:\s*(.*)$/i) { $processort = $1; }
38      if (/$SystemModel,\s*(\S+)\s*MHz.*$/) { $processors = $1; }
39  }
40 
41
42  # number of procs with sysctl (hw.ncpu)
43  chomp($processorn=`sysctl -n hw.ncpu`);
44
45# Writing data
46  $common->setBios ({
47      SMANUFACTURER => $SystemManufacturer,
48      SMODEL => $SystemModel,
49      SSN => $SystemSerial,
50      BMANUFACTURER => $BiosManufacturer,
51      BVERSION => $BiosVersion,
52      BDATE => $BiosDate,
53    });
54
55  $common->setHardware({
56
57      PROCESSORT => $processort,
58      PROCESSORN => $processorn,
59      PROCESSORS => $processors
60
61    });
62
63
64}
65
661;
Note: See TracBrowser for help on using the repository browser.