Merge lp:~pakdel-gmail/ocsinventory-unix-agent/hpux into lp:ocsinventory-unix-agent
- hpux
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~pakdel-gmail/ocsinventory-unix-agent/hpux |
Merge into: | lp:ocsinventory-unix-agent |
Diff against target: |
1163 lines (+467/-409) 19 files modified
lib/Ocsinventory/Agent/Backend.pm (+1/-1) lib/Ocsinventory/Agent/Backend/OS/Generic/Processes.pm (+2/-2) lib/Ocsinventory/Agent/Backend/OS/HPUX.pm (+30/-11) lib/Ocsinventory/Agent/Backend/OS/HPUX/Bios.pm (+29/-38) lib/Ocsinventory/Agent/Backend/OS/HPUX/CPU.pm (+55/-76) lib/Ocsinventory/Agent/Backend/OS/HPUX/Controller.pm (+1/-1) lib/Ocsinventory/Agent/Backend/OS/HPUX/Drives.pm (+44/-48) lib/Ocsinventory/Agent/Backend/OS/HPUX/IPv4.pm (+0/-28) lib/Ocsinventory/Agent/Backend/OS/HPUX/Mem.pm (+0/-28) lib/Ocsinventory/Agent/Backend/OS/HPUX/Memory.pm (+77/-79) lib/Ocsinventory/Agent/Backend/OS/HPUX/Networks.pm (+122/-87) lib/Ocsinventory/Agent/Backend/OS/HPUX/README (+2/-3) lib/Ocsinventory/Agent/Backend/OS/HPUX/Slots.pm (+2/-2) lib/Ocsinventory/Agent/Backend/OS/HPUX/Software.pm (+2/-2) lib/Ocsinventory/Agent/Backend/OS/HPUX/Storages.pm (+1/-1) lib/Ocsinventory/Agent/Backend/OS/HPUX/Uptime.pm (+29/-0) lib/Ocsinventory/Agent/Backend/OS/Linux/Network/iLO.pm (+66/-0) lib/Ocsinventory/Agent/Backend/OS/Linux/Storages.pm (+2/-2) lib/Ocsinventory/Agent/XML/Inventory.pm (+2/-0) |
To merge this branch: | bzr merge lp:~pakdel-gmail/ocsinventory-unix-agent/hpux |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OCS Inventory Dev Team | Pending | ||
Review via email:
|
Commit message
Description of the change
Swapped "Type" and "File System" in HP-UX/Drives
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
mortheres (mortheres) wrote : | # |
Hi Amir,
Yes we are currently testing and specially the 'uname' command that does not works as expected.
Dwizz (ake François) has made some tests and he got unwanted outputs from the uname command on HPUX version
11.0, 11.11 and 11.23. This is the kind of outputs he got :
uname -v -> result is : U
uname -r -> result is : B.11.00
> Any testing yet?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
dwizz (dwizz-donowin) wrote : | # |
I have find the same information in the hp documentation
(in french)
for the version, they use the uname -r (extract of the documentation. I done the traduction after)
http://
Pour identifier la version du système d’exploitation installée sur votre système, entrez :
uname -r
Après avoir procédé à l’installation standard de HP-UX 11i v1.6, vous remarquerez que la commande uname identifie la version 11i sous le numéro B.11.22.
traduction:
For identification of the operating system installed on your system, press:
uname -r
After you have done standard installation of Hp-Ux 11i v1.6, you can see that the command uname indentify the version
11i under the number B.11.22
So i think the man is wrong and it's beter to put the uname -r for version in the HPUX.pm
- 967. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
iLO is Integrated Lights-Out which is Management Interface of HP ProLiant servers
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
mortheres (mortheres) wrote : | # |
Hi,
Is this problem solved now ? Can I merge Amir modifications into the trunk branch ?
Kind regards,
--
Guillaume
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Amir Pakdel (pakdel-gmail) wrote : | # |
Hi,
I have changed the code to use uname -r and committed.
Best regards,
Amir
On Thu, Jun 24, 2010 at 1:18 AM, mortheres
<email address hidden>wrote:
> Hi,
>
> Is this problem solved now ? Can I merge Amir modifications into the trunk
> branch ?
>
> Kind regards,
>
> --
> Guillaume
> --
>
> https:/
> You are the owner of lp:~pakdel-gmail/ocsinventory-unix-agent/hpux.
>
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Amir Pakdel (pakdel-gmail) wrote : | # |
LinkedIn
------------
I'd like to add you to my professional network on LinkedIn.
- Amir
Amir Pakdel
System Administrator at Karafarin Bank
Iran
Confirm that you know Amir Pakdel
https:/
------
(c) 2010, LinkedIn Corporation
Unmerged revisions
- 967. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
iLO is Integrated Lights-Out which is Management Interface of HP ProLiant servers
- 966. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
Swapped "Type" and "File System" (continued)
- 965. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
Swapped "Type" and "File System"
$type needed a chomp - 964. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
Merely minor changes
- 963. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
Checks to be able to run model
Gets UUID - 962. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
can_run now understands "no $binary in /usr/sbin...." which may be returned in HP-UX
- 961. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
lib/Ocsinventor
y/Agent/ Backend/ OS/HPUX/ Networks. pm
To get the network status (up/down) it checks both lanadmin and ifconfig. - 960. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
lib/Ocsinventor
y/Agent/ Backend/ OS/HPUX/ Uptime. pm
Performs exactly as in Linux version - 959. By Amir Pakdel <amir@WS1524O-PAK-Linux>
-
lib/Ocsinventor
y/Agent/ Backend/ OS/HPUX* related changes: IPV4.pm
Moved its functionality to Networks.pm so that I could get network related
information in one place (since all are TCP/IP related data)
************** ******* ******* ******* ******* ******* ******* ******* ******* ******* ***
Mem.pm
/var/adm/syslog/ syslog. log might be rotated
Total physical memory and swap are measured in Memory.pm
************** ******* ******* ******* ******* ******* ******* ******* ******* ******* ***
HPUX.pm
According to "man uname":
-r: Display the current release level of the operating system.
-v: Display the current version level of the operating system.
************** ******* ******* ******* ******* ******* ******* ******* ******* ******* ***
CPU.pm
According to Inventory.pm / setHardware()
The use of setHardware() to update USERID and PROCESSOR* informations is
deprecated, please, use addUser() and addCPU() instead.If the last line of macinfo related to CPU in HPUX versions other than B11.23 is like "Cache info:", Please uncomment the "last" for speedup
************** ******* ******* ******* ******* ******* ******* ******* ******* ******* ***
Memory.pm
#please rename addMemories to addMemory()echo 'sc product mem;il'| /usr/sbin/cstm
cstm>sc product mem;il
^-- Unknown list entry. --
The list entry (mem) is undefined.^ -- (InfoLog) is currently disabled. --
************** ******* ******* ******* ******* ******* ******* ******* ******* ******* ***
Networks.pm
Renamed to Networks-Perl.pm so I can add Netwoks-lanadmin.pm to be run in case it failed
It does not need "Net::IP qw(:PROC)" anymore:
none of my servers have that and the only subroutine used is ip_iptobinNetwork interface speed and gateway are implemented
************** ******* ******* ******* ******* ******* ******* ******* ******* ******* ***
End of lib/Ocsinventory/Agent/ Backend/ OS/HPUX* related changes
************** ******* ******* ******* ******* ******* ******* ******* ******* ******* *** Ocsinventory:
:Agent: :Backend: :OS::Linux: :Storages
Added floppy detection
************** ******* ******* ******* ******* ******* ******* ******* ******* ******* ***
package Ocsinventory::Agent: :XML::Inventory ;
Added SPEED to addNetwork
************** ******* ******* ******* ******* ******* ******* ******* ******* ******* ***
Preview Diff
1 | === modified file 'lib/Ocsinventory/Agent/Backend.pm' | |||
2 | --- lib/Ocsinventory/Agent/Backend.pm 2009-12-07 15:34:33 +0000 | |||
3 | +++ lib/Ocsinventory/Agent/Backend.pm 2010-05-27 07:07:27 +0000 | |||
4 | @@ -27,7 +27,7 @@ | |||
5 | 27 | 27 | ||
6 | 28 | my $calling_namespace = caller(0); | 28 | my $calling_namespace = caller(0); |
7 | 29 | chomp(my $binpath=`which $binary 2>/dev/null`); | 29 | chomp(my $binpath=`which $binary 2>/dev/null`); |
9 | 30 | return unless -x $binpath; | 30 | return unless $binpath !~ /no $binary in/ or -x $binpath; |
10 | 31 | $self->{logger}->debug(" - $binary found"); | 31 | $self->{logger}->debug(" - $binary found"); |
11 | 32 | 1 | 32 | 1 |
12 | 33 | }, | 33 | }, |
13 | 34 | 34 | ||
14 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/Generic/Processes.pm' | |||
15 | --- lib/Ocsinventory/Agent/Backend/OS/Generic/Processes.pm 2010-05-05 19:31:57 +0000 | |||
16 | +++ lib/Ocsinventory/Agent/Backend/OS/Generic/Processes.pm 2010-05-27 07:07:27 +0000 | |||
17 | @@ -30,9 +30,9 @@ | |||
18 | 30 | $os=`uname -s`; | 30 | $os=`uname -s`; |
19 | 31 | 31 | ||
20 | 32 | if ($os eq "SunOS") { | 32 | if ($os eq "SunOS") { |
22 | 33 | open(PS, "ps -A -o user,pid,pcpu,pmem,vsz,rss,tty,s,stime,time,comm|"); | 33 | open(PS, "ps -A -o user,pid,pcpu,pmem,vsz,rss,tty,s,stime,time,comm 2>/dev/null |"); |
23 | 34 | } else { | 34 | } else { |
25 | 35 | open(PS, "ps aux|"); | 35 | open(PS, "ps aux 2>/dev/null |"); |
26 | 36 | } | 36 | } |
27 | 37 | 37 | ||
28 | 38 | while ($line = <PS>) { | 38 | while ($line = <PS>) { |
29 | 39 | 39 | ||
30 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX.pm' | |||
31 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX.pm 2010-01-22 14:39:51 +0000 | |||
32 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX.pm 2010-05-27 07:07:27 +0000 | |||
33 | @@ -4,27 +4,46 @@ | |||
34 | 4 | use vars qw($runAfter); | 4 | use vars qw($runAfter); |
35 | 5 | $runAfter = ["Ocsinventory::Agent::Backend::OS::Generic"]; | 5 | $runAfter = ["Ocsinventory::Agent::Backend::OS::Generic"]; |
36 | 6 | 6 | ||
38 | 7 | sub check { $^O =~ /hpux/ } | 7 | sub check { $^O =~ /^hpux$/ } |
39 | 8 | 8 | ||
40 | 9 | sub run { | 9 | sub run { |
41 | 10 | my $params = shift; | 10 | my $params = shift; |
42 | 11 | my $inventory = $params->{inventory}; | 11 | my $inventory = $params->{inventory}; |
43 | 12 | my $OSName; | 12 | my $OSName; |
44 | 13 | my $OSVersion; | 13 | my $OSVersion; |
46 | 14 | my $OSComment; | 14 | my $OSRelease; |
47 | 15 | my $OSLicense; | ||
48 | 15 | #my $uname_path = &_get_path('uname'); | 16 | #my $uname_path = &_get_path('uname'); |
49 | 16 | 17 | ||
55 | 17 | # Operating systeminformations | 18 | # Operating system informations |
56 | 18 | 19 | chomp($OSName = `uname -s`); #It should allways be "HP-UX" | |
57 | 19 | chomp($OSName = `uname -s`); | 20 | chomp($OSVersion = `uname -v`); |
58 | 20 | chomp($OSVersion = `uname -r`); | 21 | chomp($OSRelease = `uname -r`); |
59 | 21 | chomp($OSComment = `uname -l`); | 22 | chomp($OSLicense = `uname -l`); |
60 | 23 | |||
61 | 24 | # Last login informations | ||
62 | 25 | my $LastLoggedUser; | ||
63 | 26 | my $LastLogDate; | ||
64 | 27 | my @query = runcmd("last"); | ||
65 | 28 | |||
66 | 29 | while ( my $tempLine = shift @query) { | ||
67 | 30 | #if ( /^reboot\s+system boot/ ) { continue } #It should never be seen above a user login entry (I hope) | ||
68 | 31 | if ( $tempLine =~ /^(\S+)\s+\S+\s+(.+\d{2}:\d{2})\s+/ ) { | ||
69 | 32 | $LastLoggedUser = $1; | ||
70 | 33 | $LastLogDate = $2; | ||
71 | 34 | last; | ||
72 | 35 | } | ||
73 | 36 | } | ||
74 | 37 | |||
75 | 38 | #TODO add grep `hostname` /etc/hosts | ||
76 | 22 | 39 | ||
77 | 23 | $inventory->setHardware({ | 40 | $inventory->setHardware({ |
82 | 24 | OSNAME => $OSName, | 41 | OSNAME => $OSName, |
83 | 25 | OSCOMMENTS => $OSComment, | 42 | OSVERSION => $OSVersion . ' ' . $OSLicense, |
84 | 26 | OSVERSION => $OSVersion, | 43 | OSCOMMENTS => $OSRelease, |
85 | 27 | }); | 44 | LASTLOGGEDUSER => $LastLoggedUser, |
86 | 45 | DATELASTLOGGEDUSER => $LastLogDate | ||
87 | 46 | }); | ||
88 | 28 | 47 | ||
89 | 29 | } | 48 | } |
90 | 30 | 49 | ||
91 | 31 | 50 | ||
92 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Bios.pm' | |||
93 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Bios.pm 2010-02-25 18:36:52 +0000 | |||
94 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Bios.pm 2010-05-27 07:07:27 +0000 | |||
95 | @@ -9,7 +9,7 @@ | |||
96 | 9 | # | 9 | # |
97 | 10 | ### | 10 | ### |
98 | 11 | 11 | ||
100 | 12 | sub check { $^O =~ /hpux/ } | 12 | sub check { can_run ("model") } |
101 | 13 | 13 | ||
102 | 14 | sub run { | 14 | sub run { |
103 | 15 | my $params = shift; | 15 | my $params = shift; |
104 | @@ -19,49 +19,40 @@ | |||
105 | 19 | my $BiosDate; | 19 | my $BiosDate; |
106 | 20 | my $SystemModel; | 20 | my $SystemModel; |
107 | 21 | my $SystemSerial; | 21 | my $SystemSerial; |
108 | 22 | my $SystemUUID; | ||
109 | 22 | 23 | ||
110 | 23 | 24 | ||
111 | 24 | $SystemModel=`model`; | 25 | $SystemModel=`model`; |
142 | 25 | if ( can_run ("machinfo") ) | 26 | if ( can_run ("/usr/contrib/bin/machinfo") ) { |
143 | 26 | { | 27 | foreach ( `/usr/contrib/bin/machinfo` ) { |
144 | 27 | foreach ( `machinfo` ) | 28 | if ( /Firmware\s+revision\s+[:=]\s+(\S+)/ ) { |
145 | 28 | { | 29 | $BiosVersion = $1; |
146 | 29 | if ( /Firmware\s+revision\s+[:=]\s+(\S+)/ ) | 30 | } elsif ( /achine\s+serial\s+number\s+[:=]\s+(\S+)/ ) { |
147 | 30 | { | 31 | $SystemSerial = $1; |
148 | 31 | $BiosVersion=$1; | 32 | } elsif (/achine\s+id\s+number\s+=\s+(\S+)/) { |
149 | 32 | } | 33 | $SystemUUID = uc $1; |
150 | 33 | elsif ( /achine\s+serial\s+number\s+[:=]\s+(\S+)/ ) | 34 | } |
151 | 34 | { | 35 | } |
152 | 35 | $SystemSerial=$1; | 36 | } else { #Could not run machinfo |
153 | 36 | } | 37 | for ( `echo 'sc product cpu;il' | /usr/sbin/cstm | grep "PDC Firmware"` ) { |
154 | 37 | } | 38 | if ( /Revision:\s+(\S+)/ ) { $BiosVersion = "PDC $1" } |
155 | 38 | } | 39 | } |
156 | 39 | else | 40 | for ( `echo 'sc product system;il' | /usr/sbin/cstm | grep "System Serial Number"` ) { |
157 | 40 | { | 41 | if ( /:\s+(\w+)/ ) { $SystemSerial = $1 } |
158 | 41 | for ( `echo 'sc product cpu;il' | /usr/sbin/cstm | grep "PDC Firmware"` ) | 42 | } |
129 | 42 | { | ||
130 | 43 | if ( /Revision:\s+(\S+)/ ) | ||
131 | 44 | { | ||
132 | 45 | $BiosVersion="PDC $1"; | ||
133 | 46 | } | ||
134 | 47 | } | ||
135 | 48 | for ( `echo 'sc product system;il' | /usr/sbin/cstm | grep "System Serial Number"` ) | ||
136 | 49 | { | ||
137 | 50 | if ( /:\s+(\w+)/ ) | ||
138 | 51 | { | ||
139 | 52 | $SystemSerial=$1; | ||
140 | 53 | } | ||
141 | 54 | } | ||
159 | 55 | } | 43 | } |
160 | 56 | 44 | ||
161 | 57 | $inventory->setBios ({ | 45 | $inventory->setBios ({ |
169 | 58 | BVERSION => $BiosVersion, | 46 | BVERSION => $BiosVersion, |
170 | 59 | BDATE => $BiosDate, | 47 | BDATE => $BiosDate, |
171 | 60 | BMANUFACTURER => "HP", | 48 | BMANUFACTURER => "HP", |
172 | 61 | SMANUFACTURER => "HP", | 49 | SMANUFACTURER => "HP", |
173 | 62 | SMODEL => $SystemModel, | 50 | SMODEL => $SystemModel, |
174 | 63 | SSN => $SystemSerial, | 51 | SSN => $SystemSerial, |
175 | 64 | }); | 52 | }); |
176 | 53 | $inventory->setHardware({ | ||
177 | 54 | UUID => $SystemUUID | ||
178 | 55 | }); | ||
179 | 65 | } | 56 | } |
180 | 66 | 57 | ||
181 | 67 | 1; | 58 | 1; |
182 | 68 | 59 | ||
183 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/CPU.pm' | |||
184 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/CPU.pm 2010-02-25 18:36:52 +0000 | |||
185 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/CPU.pm 2010-05-27 07:07:27 +0000 | |||
186 | @@ -11,18 +11,14 @@ | |||
187 | 11 | use strict; | 11 | use strict; |
188 | 12 | use LWP::UserAgent; | 12 | use LWP::UserAgent; |
189 | 13 | 13 | ||
191 | 14 | sub check { $^O =~ /hpux/ } | 14 | sub check { $^O =~ /^hpux$/ } |
192 | 15 | 15 | ||
193 | 16 | sub run { | 16 | sub run { |
194 | 17 | my $params = shift; | 17 | my $params = shift; |
195 | 18 | my $inventory = $params->{inventory}; | 18 | my $inventory = $params->{inventory}; |
196 | 19 | 19 | ||
203 | 20 | my $processort; | 20 | my $CPUinfo = { MANUFACTURER => 'unknow', TYPE => 'unknow', SERIAL => 'No Serial Number available!', SPEED => 0 }; |
204 | 21 | my $processorn; | 21 | my $CPUcount; |
199 | 22 | my $processors=""; | ||
200 | 23 | my $DeviceType; | ||
201 | 24 | my $cpuInfo; | ||
202 | 25 | my $serie; | ||
205 | 26 | 22 | ||
206 | 27 | # Using old system HpUX without machinfo | 23 | # Using old system HpUX without machinfo |
207 | 28 | # the Hpux whith machinfo will be done after | 24 | # the Hpux whith machinfo will be done after |
208 | @@ -58,79 +54,62 @@ | |||
209 | 58 | "N4000-44"=>"8500 440", | 54 | "N4000-44"=>"8500 440", |
210 | 59 | "ia64 hp server rx1620"=>"itanium 1600"); | 55 | "ia64 hp server rx1620"=>"itanium 1600"); |
211 | 60 | 56 | ||
263 | 61 | if ( can_run ("machinfo") ) | 57 | if ( can_run ("/usr/contrib/bin/machinfo") ) { |
264 | 62 | { | 58 | my @machinfo = `/usr/contrib/bin/machinfo`; |
265 | 63 | foreach ( `machinfo`) | 59 | s/\s+/ /g for (@machinfo); |
266 | 64 | { | 60 | foreach (@machinfo) { |
267 | 65 | if ( /Number of CPUs\s+=\s+(\d+)/ ) | 61 | if (/Number of CPUs = (\d+)/) { |
268 | 66 | { | 62 | $CPUcount = $1; |
269 | 67 | $processorn=$1; | 63 | } elsif (/processor model: \d+ (.+)$/) { |
270 | 68 | } | 64 | $CPUinfo->{TYPE} = $1; |
271 | 69 | if ( /Clock speed\s+=\s+(\d+)\s+MHz/ ) | 65 | } elsif (/Clock speed = (\d+) MHz/) { |
272 | 70 | { | 66 | $CPUinfo->{SPEED} = $1; |
273 | 71 | $processors=$1; | 67 | } elsif (/vendor information =\W+(\w+)/) { |
274 | 72 | } | 68 | $CPUinfo->{MANUFACTURER} = $1; |
275 | 73 | # Added for HPUX 11.31 | 69 | } elsif (/Cache info:/) { |
276 | 74 | if ( /Intel\(R\) Itanium 2 9000 series processor \((\d+\.\d+)/ ) | 70 | # last; #Not tested on versions other that B11.23 |
277 | 75 | { | 71 | } |
278 | 76 | $processors=$1*1000; | 72 | # Added for HPUX 11.31 |
279 | 77 | } | 73 | if ( /Intel\(R\) Itanium 2 9000 series processor \((\d+\.\d+)/ ) { |
280 | 78 | if ( /(\d+)\s+logical processors/ ) | 74 | $CPUinfo->{SPEED} = $1*1000; |
281 | 79 | { | 75 | } |
282 | 80 | $processorn=$1; | 76 | if ( /(\d+) logical processors/ ) { |
283 | 81 | } | 77 | $CPUcount = $1; |
284 | 82 | # end HPUX 11.31 | 78 | } |
285 | 83 | 79 | # end HPUX 11.31 | |
286 | 84 | } | 80 | } |
287 | 85 | } | 81 | } else { |
288 | 86 | else | 82 | chomp(my $DeviceType =`model |cut -f 3- -d/`); |
289 | 87 | { | 83 | my $tempCpuInfo = $cpuInfos{"$DeviceType"}; |
290 | 88 | chomp($DeviceType =`model |cut -f 3- -d/`); | 84 | if ( $tempCpuInfo =~ /^(\S+)\s(\S+)/ ) { |
291 | 89 | my $cpuInfo = $cpuInfos{"$DeviceType"}; | 85 | $CPUinfo->{TYPE} = $1; |
292 | 90 | if ( "$cpuInfo" =~ /^(\S+)\s(\S+)/ ) | 86 | $CPUinfo->{SPEED} = $2; |
293 | 91 | { | 87 | } else { |
294 | 92 | $processort=$1; | 88 | for ( `echo 'sc product cpu;il' | /usr/sbin/cstm | grep "CPU Module"` ) { |
295 | 93 | $processors=$2; | 89 | if ( /(\S+)\s+CPU\s+Module/ ) { |
296 | 94 | } | 90 | $CPUinfo->{TYPE} = $1; |
297 | 95 | else | 91 | } |
298 | 96 | { | 92 | } |
299 | 97 | for ( `echo 'sc product cpu;il' | /usr/sbin/cstm | grep "CPU Module"` ) | 93 | for ( `echo 'itick_per_usec/D' | adb -k /stand/vmunix /dev/kmem` ) { |
300 | 98 | { | 94 | if ( /tick_per_usec:\s+(\d+)/ ) { |
301 | 99 | if ( /(\S+)\s+CPU\s+Module/ ) | 95 | $CPUinfo->{SPEED} = $1; |
302 | 100 | { | 96 | } |
303 | 101 | $processort=$1; | 97 | } |
304 | 102 | } | 98 | } |
254 | 103 | }; | ||
255 | 104 | for ( `echo 'itick_per_usec/D' | adb -k /stand/vmunix /dev/kmem` ) | ||
256 | 105 | { | ||
257 | 106 | if ( /tick_per_usec:\s+(\d+)/ ) | ||
258 | 107 | { | ||
259 | 108 | $processors=$1; | ||
260 | 109 | } | ||
261 | 110 | } | ||
262 | 111 | }; | ||
305 | 112 | # NBR CPU | 99 | # NBR CPU |
308 | 113 | chomp($processorn=`ioscan -Fk -C processor | wc -l`); | 100 | chomp($CPUcount=`ioscan -Fk -C processor | wc -l`); |
307 | 114 | #print "HP $processort A $processorn A $processors "; | ||
309 | 115 | } | 101 | } |
310 | 116 | 102 | ||
311 | 103 | my $serie; | ||
312 | 117 | chomp($serie = `uname -m`); | 104 | chomp($serie = `uname -m`); |
329 | 118 | if ( $serie =~ /ia64/) | 105 | if ( $CPUinfo->{TYPE} eq 'unknow' and $serie =~ /ia64/) { |
330 | 119 | { | 106 | $CPUinfo->{TYPE} = "Itanium" |
331 | 120 | $processort="Itanium" | 107 | } |
332 | 121 | } | 108 | if ( $serie =~ /9000/) { |
333 | 122 | if ( $serie =~ /9000/) | 109 | $CPUinfo->{TYPE} = "PA" . $CPUinfo->{TYPE}; |
334 | 123 | { | 110 | } |
335 | 124 | $processort="PA$processort"; | 111 | |
336 | 125 | } | 112 | foreach ( 1..$CPUcount ) { $inventory->addCPU($CPUinfo) } |
321 | 126 | $inventory->setHardware({ | ||
322 | 127 | |||
323 | 128 | PROCESSORT => $processort, | ||
324 | 129 | PROCESSORN => $processorn, | ||
325 | 130 | PROCESSORS => $processors, | ||
326 | 131 | }); | ||
327 | 132 | |||
328 | 133 | |||
337 | 134 | } | 113 | } |
338 | 135 | 114 | ||
339 | 136 | 1; | 115 | 1; |
340 | 137 | 116 | ||
341 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Controller.pm' | |||
342 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Controller.pm 2010-01-22 14:39:51 +0000 | |||
343 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Controller.pm 2010-05-27 07:07:27 +0000 | |||
344 | @@ -1,7 +1,7 @@ | |||
345 | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Controller; | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Controller; |
346 | 2 | use strict; | 2 | use strict; |
347 | 3 | 3 | ||
349 | 4 | sub check { $^O =~ /hpux/ } | 4 | sub check { can_run('ioscan') } |
350 | 5 | 5 | ||
351 | 6 | sub run { | 6 | sub run { |
352 | 7 | my $params = shift; | 7 | my $params = shift; |
353 | 8 | 8 | ||
354 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Drives.pm' | |||
355 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Drives.pm 2010-01-22 14:39:51 +0000 | |||
356 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Drives.pm 2010-05-27 07:07:27 +0000 | |||
357 | @@ -1,55 +1,51 @@ | |||
358 | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Drives; | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Drives; |
359 | 2 | 2 | ||
361 | 3 | sub check { $^O =~ /hpux/ } | 3 | sub check { can_run('fstyp') and can_run('grep') and can_run('bdf') } |
362 | 4 | 4 | ||
363 | 5 | sub run { | 5 | sub run { |
411 | 6 | my $params = shift; | 6 | my $params = shift; |
412 | 7 | my $inventory = $params->{inventory}; | 7 | my $inventory = $params->{inventory}; |
413 | 8 | 8 | ||
414 | 9 | my $type; | 9 | my $type; |
415 | 10 | my $fs; | 10 | my $fs; |
416 | 11 | my $lv; | 11 | my $lv; |
417 | 12 | my $total; | 12 | my $total; |
418 | 13 | my $free; | 13 | my $free; |
419 | 14 | 14 | ||
420 | 15 | 15 | for ( `fstyp -l | grep -v nfs` ) { | |
421 | 16 | for ( `fstyp -l | grep -v nfs` ) { | 16 | chomp; |
422 | 17 | $type=$_; | 17 | $type=$_; |
423 | 18 | for ( `bdf -t $type `) { | 18 | for ( `bdf -t $type `) { |
424 | 19 | if ( /Filesystem/ ) { ; } ; | 19 | next if ( /Filesystem/ ); |
425 | 20 | if ( /^(\S+)\s(\d+)\s+(\d+)\s+(\d+)\s+(\d+%)\s+(\S+)/ ) { | 20 | if ( /^(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+%)\s+(\S+)/ ) { |
426 | 21 | $lv=$1; | 21 | $lv=$1; |
427 | 22 | $total=$2; | 22 | $total=$2; |
428 | 23 | $free=$3; | 23 | $free=$3; |
429 | 24 | $fs=$6; | 24 | $fs=$6; |
430 | 25 | $inventory->addDrives({ | 25 | $inventory->addDrive({ |
431 | 26 | FREE => $free, | 26 | FREE => $free, |
432 | 27 | FILESYSTEM => $fs, | 27 | FILESYSTEM => $type, |
433 | 28 | TOTAL => $total, | 28 | TOTAL => $total, |
434 | 29 | TYPE => $type, | 29 | TYPE => $fs, |
435 | 30 | VOLUMN => $lv, | 30 | VOLUMN => $lv, |
436 | 31 | }); | 31 | }) |
437 | 32 | 32 | } elsif ( /^(\S+)\s/) { | |
438 | 33 | }; | 33 | $lv=$1 |
439 | 34 | if ( /^(\S+)\s/) { | 34 | } elsif ( /(\d+)\s+(\d+)\s+(\d+)\s+(\d+%)\s+(\S+)/) { |
440 | 35 | $lv=$1; | 35 | $total=$1; |
441 | 36 | }; | 36 | $free=$3; |
442 | 37 | if ( /(\d+)\s+(\d+)\s+(\d+)\s+(\d+%)\s+(\S+)/) { | 37 | $fs=$5; |
443 | 38 | $total=$1; | 38 | # print "fs $fs lv $lv total $total free $free type $type\n"; |
444 | 39 | $free=$3; | 39 | $inventory->addDrive({ |
445 | 40 | $fs=$5; | 40 | FREE => $free, |
446 | 41 | # print "fs $fs lv $lv total $total free $free type $type\n"; | 41 | FILESYSTEM => $type, |
447 | 42 | $inventory->addDrives({ | 42 | TOTAL => $total, |
448 | 43 | FREE => $free, | 43 | TYPE => $fs, |
449 | 44 | FILESYSTEM => $fs, | 44 | VOLUMN => $lv, |
450 | 45 | TOTAL => $total, | 45 | }) |
451 | 46 | TYPE => $type, | 46 | } |
452 | 47 | VOLUMN => $lv, | 47 | } # for bdf -t $type |
453 | 48 | }); | 48 | } |
407 | 49 | }; | ||
408 | 50 | }; | ||
409 | 51 | |||
410 | 52 | }; | ||
454 | 53 | } | 49 | } |
455 | 54 | 50 | ||
456 | 55 | 1; | 51 | 1; |
457 | 56 | 52 | ||
458 | === removed file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/IPv4.pm' | |||
459 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/IPv4.pm 2010-02-25 18:36:52 +0000 | |||
460 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/IPv4.pm 1970-01-01 00:00:00 +0000 | |||
461 | @@ -1,28 +0,0 @@ | |||
462 | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::IPv4; | ||
463 | 2 | |||
464 | 3 | sub check {`which ifconfig 2>&1`; ($? >> 8)?0:1 | ||
465 | 4 | } | ||
466 | 5 | |||
467 | 6 | # Initialise the distro entry | ||
468 | 7 | sub run { | ||
469 | 8 | my $params = shift; | ||
470 | 9 | my $inventory = $params->{inventory}; | ||
471 | 10 | my $ip; | ||
472 | 11 | my $hostname; | ||
473 | 12 | |||
474 | 13 | if ( `hostname` =~ /(\S+)/ ) | ||
475 | 14 | { | ||
476 | 15 | $hostname=$1; | ||
477 | 16 | } | ||
478 | 17 | |||
479 | 18 | for ( `grep $hostname /etc/hosts ` ) | ||
480 | 19 | { | ||
481 | 20 | if ( /(^\d+\.\d+\.\d+\.\d+)\s+/ ) | ||
482 | 21 | { | ||
483 | 22 | $ip=$1; | ||
484 | 23 | $inventory->setHardware({IPADDR => $ip}); | ||
485 | 24 | } | ||
486 | 25 | } | ||
487 | 26 | } | ||
488 | 27 | |||
489 | 28 | 1; | ||
490 | 29 | 0 | ||
491 | === removed file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Mem.pm' | |||
492 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Mem.pm 2010-01-22 14:39:51 +0000 | |||
493 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Mem.pm 1970-01-01 00:00:00 +0000 | |||
494 | @@ -1,28 +0,0 @@ | |||
495 | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Mem; | ||
496 | 2 | use strict; | ||
497 | 3 | |||
498 | 4 | sub check { $^O =~ /hpux/ } | ||
499 | 5 | |||
500 | 6 | sub run { | ||
501 | 7 | my $params = shift; | ||
502 | 8 | my $inventory = $params->{inventory}; | ||
503 | 9 | |||
504 | 10 | my $mem; | ||
505 | 11 | my $swap; | ||
506 | 12 | |||
507 | 13 | $mem = `grep Physical /var/adm/syslog/syslog.log|tr -s " "|cut -f 7 -d " "` ; | ||
508 | 14 | if ( $mem eq "" ) { | ||
509 | 15 | $mem = `grep Physical /var/adm/syslog/OLDsyslog.log|tr -s " "|cut -f 7 -d " "` ; | ||
510 | 16 | }; | ||
511 | 17 | $mem = int ($mem/1024); | ||
512 | 18 | |||
513 | 19 | $swap = `swapinfo -mdfq`; | ||
514 | 20 | |||
515 | 21 | |||
516 | 22 | $inventory->setHardware({ | ||
517 | 23 | MEMORY => $mem, | ||
518 | 24 | SWAP => $swap, | ||
519 | 25 | }); | ||
520 | 26 | } | ||
521 | 27 | |||
522 | 28 | 1; | ||
523 | 29 | 0 | ||
524 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Memory.pm' | |||
525 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Memory.pm 2010-02-25 18:36:52 +0000 | |||
526 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Memory.pm 2010-05-27 07:07:27 +0000 | |||
527 | @@ -1,4 +1,5 @@ | |||
528 | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Memory; | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Memory; |
529 | 2 | |||
530 | 2 | use strict; | 3 | use strict; |
531 | 3 | 4 | ||
532 | 4 | sub check { $^O =~ /hpux/ } | 5 | sub check { $^O =~ /hpux/ } |
533 | @@ -7,45 +8,48 @@ | |||
534 | 7 | my $params = shift; | 8 | my $params = shift; |
535 | 8 | my $inventory = $params->{inventory}; | 9 | my $inventory = $params->{inventory}; |
536 | 9 | 10 | ||
571 | 10 | my $capacity=0; | 11 | if ( `uname -m` =~ /ia64/ ) { |
572 | 11 | my $caption; | 12 | for ( `echo 'sc product IPF_MEMORY;il' | /usr/sbin/cstm` ) { |
573 | 12 | my $description; | 13 | if ( /\w+IMM\s+Location/ ) { |
574 | 13 | my $numslot; | 14 | next |
575 | 14 | my $subnumslot; | 15 | } elsif (/Total Configured Memory:\s(\d+)\sMB/i) { |
576 | 15 | my $serialnumber; | 16 | my $TotalMemSize = $1; |
577 | 16 | my $type; | 17 | my $TotalSwapSize = `swapinfo -dt | tail -n1`; |
578 | 17 | my @list_mem=`echo 'sc product mem;il'| /usr/sbin/cstm`; | 18 | $TotalSwapSize =~ s/^total\s+(\d+)\s+\d+\s+\d+\s+\d+%\s+\-\s+\d+\s+\-/$1/i; |
579 | 18 | 19 | $inventory->setHardware({ MEMORY => $TotalMemSize, SWAP => sprintf("%i", $TotalSwapSize/1024), }); | |
580 | 19 | my $ok=0; | 20 | } elsif ( /(\w+IMM)\s+(\w+)\s+(\d+|\-+)\s+(\w+IMM)\s+(\w+)\s+(\d+|\-+)/ ) { |
581 | 20 | 21 | $inventory->addMemory({ | |
582 | 21 | if ( `uname -m` =~ /ia64/ ) | 22 | CAPACITY => $3, |
583 | 22 | { | 23 | DESCRIPTION => $1, |
584 | 23 | for ( `echo 'sc product IPF_MEMORY;il' | /usr/sbin/cstm` ) | 24 | CAPTION => $1 . ' ' . $2, |
585 | 24 | { | 25 | SPEED => 'No Speed data vailable!', |
586 | 25 | if ( /\w+IMM\s+Location/ ) | 26 | TYPE => $1, |
587 | 26 | { | 27 | NUMSLOTS => $2, |
588 | 27 | ; | 28 | SERIALNUMBER => 'No Serial Number available!', |
589 | 28 | } | 29 | }); |
590 | 29 | elsif ( /(\w+IMM)\s+(\w+)\s+(\S+)\s+(\w+IMM)\s+(\w+)\s+(\S+)/ ) | 30 | $inventory->addMemory({ |
591 | 30 | { | 31 | CAPACITY => $6, |
592 | 31 | $inventory->addMemories({ | 32 | DESCRIPTION => $4, |
593 | 32 | CAPACITY => $3, | 33 | CAPTION => $4 . ' ' . $5, |
594 | 33 | CAPTION => $2 , | 34 | SPEED => 'No Speed data vailable!', |
595 | 34 | NUMSLOTS => "1" , | 35 | TYPE => $4, |
596 | 35 | TYPE => $1, | 36 | NUMSLOTS => $5, |
597 | 36 | }); | 37 | SERIALNUMBER => 'No Serial Number available!', |
598 | 37 | $inventory->addMemories({ | 38 | }); |
565 | 38 | CAPACITY => $6, | ||
566 | 39 | CAPTION => $5 , | ||
567 | 40 | NUMSLOTS => "1" , | ||
568 | 41 | TYPE => $4, | ||
569 | 42 | }); | ||
570 | 43 | } | ||
599 | 44 | } | 39 | } |
604 | 45 | } | 40 | } |
605 | 46 | else | 41 | } else { |
606 | 47 | { | 42 | my $capacity = 0; |
607 | 48 | for ( `echo 'sc product system;il' | /usr/sbin/cstm ` ) { | 43 | my $caption; |
608 | 44 | my $description; | ||
609 | 45 | my $numslot = 1; | ||
610 | 46 | my $subnumslot; | ||
611 | 47 | my $serialnumber = 'No Serial Number available!'; | ||
612 | 48 | my $type; | ||
613 | 49 | my @list_mem=`echo 'sc product mem;il'| /usr/sbin/cstm`; | ||
614 | 50 | my $ok=0; | ||
615 | 51 | |||
616 | 52 | for ( `echo 'sc product system;il' | /usr/sbin/cstm` ) { | ||
617 | 49 | if ( /FRU\sSource\s+=\s+\S+\s+\(memory/ ) { | 53 | if ( /FRU\sSource\s+=\s+\S+\s+\(memory/ ) { |
618 | 50 | $ok=0; | 54 | $ok=0; |
619 | 51 | #print "FRU Source memory\n"; | 55 | #print "FRU Source memory\n"; |
620 | @@ -57,59 +61,53 @@ | |||
621 | 57 | if ( /Extender\s+Location\s+=\s+(\S+)/ ) { | 61 | if ( /Extender\s+Location\s+=\s+(\S+)/ ) { |
622 | 58 | $subnumslot=$1; | 62 | $subnumslot=$1; |
623 | 59 | #print "Extended sub $subnumslot\n"; | 63 | #print "Extended sub $subnumslot\n"; |
625 | 60 | }; | 64 | } |
626 | 61 | if ( /DIMMS\s+Rank\s+=\s+(\S+)/ ) { | 65 | if ( /DIMMS\s+Rank\s+=\s+(\S+)/ ) { |
627 | 62 | $numslot=sprintf("%02x",$1); | 66 | $numslot=sprintf("%02x",$1); |
628 | 63 | #print "Num slot $numslot\n"; | 67 | #print "Num slot $numslot\n"; |
629 | 64 | } | 68 | } |
630 | 65 | 69 | ||
631 | 66 | if ( /FRU\s+Name\.*:\s+(\S+)/ ) { | 70 | if ( /FRU\s+Name\.*:\s+(\S+)/ ) { |
644 | 67 | if ( /(\S+)_(\S+)/ ) { | 71 | if ( /(\S+)_(\S+)/ ) { |
645 | 68 | $type=$1; | 72 | $type=$1; |
646 | 69 | $capacity=$2; | 73 | $capacity=$2; |
647 | 70 | #print "Type $type capa $capacity\n"; | 74 | #print "Type $type capa $capacity\n"; |
648 | 71 | } | 75 | } elsif ( /(\wIMM)(\S+)/ ) { |
649 | 72 | elsif ( /(\wIMM)(\S+)/ ) | 76 | $ok=1; |
650 | 73 | { | 77 | $type=$1; |
651 | 74 | $ok=1; | 78 | $numslot=$2; |
652 | 75 | $type=$1; | 79 | #print "Type $type numslot $numslot\n"; |
653 | 76 | $numslot=$2; | 80 | } |
642 | 77 | #print "Type $type numslot $numslot\n"; | ||
643 | 78 | } | ||
654 | 79 | } | 81 | } |
655 | 80 | if ( /Part\s+Number\.*:\s*(\S+)\s+/ ) { | 82 | if ( /Part\s+Number\.*:\s*(\S+)\s+/ ) { |
656 | 81 | $description=$1; | 83 | $description=$1; |
657 | 82 | #print "ref $description\n"; | 84 | #print "ref $description\n"; |
659 | 83 | }; | 85 | } |
660 | 84 | if ( /Serial\s+Number\.*:\s*(\S+)\s+/ ) { | 86 | if ( /Serial\s+Number\.*:\s*(\S+)\s+/ ) { |
674 | 85 | $serialnumber=$1; | 87 | $serialnumber=$1; |
675 | 86 | if ( $ok eq 1 ) | 88 | if ( $ok eq 1 ) { |
676 | 87 | { | 89 | if ( $capacity eq 0 ) { |
677 | 88 | if ( $capacity eq 0 ) | 90 | foreach ( @list_mem ) { |
678 | 89 | { | 91 | if ( /\s+$numslot\s+(\d+)/ ) { |
679 | 90 | foreach ( @list_mem ) | 92 | $capacity=$1; |
680 | 91 | { | 93 | #print "Capacity $capacity\n"; |
681 | 92 | if ( /\s+$numslot\s+(\d+)/ ) | 94 | } |
669 | 93 | { | ||
670 | 94 | $capacity=$1; | ||
671 | 95 | #print "Capacity $capacity\n"; | ||
672 | 96 | } | ||
673 | 97 | } | ||
682 | 98 | } | 95 | } |
697 | 99 | $inventory->addMemories({ | 96 | } |
698 | 100 | CAPACITY => $capacity, | 97 | $inventory->addMemory({ |
699 | 101 | CAPTION => "Ext $subnumslot Slot $numslot" , | 98 | CAPACITY => $capacity, |
700 | 102 | DESCRIPTION => "Part Number $description", | 99 | DESCRIPTION => "Part Number $description", |
701 | 103 | NUMSLOTS => "1" , | 100 | CAPTION => "Ext $subnumslot Slot $numslot", |
702 | 104 | SERIALNUMBER => $serialnumber, | 101 | SPEED => 'No Speed data vailable!', |
703 | 105 | TYPE => $type, | 102 | TYPE => $type, |
704 | 106 | }); | 103 | NUMSLOTS => '1', |
705 | 107 | $ok=0; | 104 | SERIALNUMBER => $serialnumber, |
706 | 108 | $capacity=0; | 105 | }); |
707 | 109 | }; | 106 | $ok=0; |
708 | 110 | #print "Serial $serialnumber\n\n"; | 107 | $capacity=0; |
709 | 111 | }; | 108 | } # $ok eq 1 |
710 | 112 | }; | 109 | } # /Serial\s+Number\.*:\s*(\S+)\s+/ |
711 | 110 | } # echo 'sc product system;il' | /usr/sbin/cstm | ||
712 | 113 | } | 111 | } |
713 | 114 | 112 | ||
714 | 115 | } | 113 | } |
715 | 116 | 114 | ||
716 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Networks.pm' | |||
717 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Networks.pm 2010-02-25 18:36:52 +0000 | |||
718 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Networks.pm 2010-05-27 07:07:27 +0000 | |||
719 | @@ -1,93 +1,128 @@ | |||
720 | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Networks; | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Networks; |
721 | 2 | 2 | ||
723 | 3 | sub check { can_load("Net::IP qw(:PROC)"); } | 3 | #$runMeIfTheseChecksFailed = ["Ocsinventory::Agent::Backend::OS::HPUX::Networks-Perl"]; |
724 | 4 | |||
725 | 5 | #"Net::IP qw(:PROC)" is not needed anymore | ||
726 | 6 | #TODO Get driver pcislot virtualdev | ||
727 | 7 | |||
728 | 8 | sub check { can_run("lanadmin") and can_run("lanscan") and can_run("netstat") | ||
729 | 9 | and can_run("ifconfig") and can_run("hostname") and can_run("uname") } | ||
730 | 4 | 10 | ||
731 | 5 | sub run { | 11 | sub run { |
818 | 6 | my $params = shift; | 12 | my $params = shift; |
819 | 7 | my $inventory = $params->{inventory}; | 13 | my $inventory = $params->{inventory}; |
820 | 8 | 14 | ||
821 | 9 | my $name; | 15 | my $name; |
822 | 10 | my $lanid; | 16 | my $lanid; |
823 | 11 | 17 | my $ipmask; | |
824 | 12 | my $ipmask; | 18 | my $ipgateway; |
825 | 13 | my $ipgateway; | 19 | my $status; |
826 | 14 | my $status; | 20 | my $macaddr; |
827 | 15 | my $macaddr; | 21 | my $speed; |
828 | 16 | my $speed; | 22 | my $type; |
829 | 17 | my $type; | 23 | my $ipsubnet; |
830 | 18 | my $ipsubnet; | 24 | my $description; |
831 | 19 | my $description; | 25 | my $ipaddress; |
832 | 20 | my $ipaddress; | 26 | |
833 | 21 | 27 | my $hostname = 'Unknown'; | |
834 | 22 | my $binip; | 28 | if ( `hostname` =~ /(\S+)/ ) { |
835 | 23 | my $binmask; | 29 | $hostname=$1 |
836 | 24 | my $binsubnet; | 30 | } elsif ( `uname -n` =~ /(\S+)/ ) { # It should never reach here, as `hostname` should never fail! |
837 | 25 | 31 | $hostname=$1 | |
838 | 26 | for ( `lanscan -iap`) { | 32 | } |
839 | 27 | # Reinit variable | 33 | |
840 | 28 | $name=""; | 34 | for ( `grep $hostname /etc/hosts ` ) { |
841 | 29 | $lanid=""; | 35 | if ( /(^\d+\.\d+\.\d+\.\d+)\s+/ ) { |
842 | 30 | $ipmask=""; | 36 | $inventory->setHardware({IPADDR => $1}); |
843 | 31 | $ipgateway=""; | 37 | last; |
844 | 32 | $status=""; | 38 | } |
845 | 33 | $macaddr=""; | 39 | } |
846 | 34 | $speed=""; | 40 | |
847 | 35 | $type=""; | 41 | my %gateway; |
848 | 36 | $ipsubnet=""; | 42 | foreach (`netstat -nrv`) { |
849 | 37 | $description=""; | 43 | if (/^(\S+\/\d+\.\d+\.\d+\.\d+)\s+(\d+\.\d+\.\d+\.\d+)/) { |
850 | 38 | $ipaddress=""; | 44 | $gateway{$1} = $2 if not defined $gateway{$1}; #Just keep the first one |
851 | 39 | 45 | } | |
852 | 40 | if ( /^(\S+)\s(\S+)\s(\S+)\s+(\S+)/) { | 46 | } |
853 | 41 | $name=$2; | 47 | if (defined ($gateway{'default/0.0.0.0'})) { |
854 | 42 | $macaddr=$1; | 48 | $inventory->setHardware({ |
855 | 43 | $lanid=$4; | 49 | DEFAULTGATEWAY => $gateway{'default/0.0.0.0'} |
856 | 44 | 50 | }) | |
857 | 45 | #print "name $name macaddr $macaddr lanid $lanid\n"; | 51 | } |
858 | 46 | for ( `lanadmin -g $lanid` ) { | 52 | |
859 | 47 | if (/Type.+=\s(.+)/) { $type = $1; }; | 53 | for ( `lanscan -iap`) { |
860 | 48 | if (/Description\s+=\s(.+)/) { $description = $1; }; | 54 | # Reinit variables |
861 | 49 | if (/Speed.+=\s(\d+)/) { | 55 | $name=""; |
862 | 50 | $speed = $1; | 56 | $lanid=""; |
863 | 51 | 57 | $ipmask=""; | |
864 | 52 | unless ( $speed <= 1000000 ) { # in old version speed was given in Mbps | 58 | $ipgateway=""; |
865 | 53 | # we want speed in Mbps | 59 | $status=""; |
866 | 54 | $speed = $1/1000000; | 60 | $macaddr=""; |
867 | 55 | } | 61 | $speed=""; |
868 | 56 | }; | 62 | $type=""; |
869 | 57 | if (/Operation Status.+=\s(.+)/) { $status = $1; }; | 63 | $ipsubnet=""; |
870 | 58 | 64 | $description=""; | |
871 | 59 | }; # for lanadmin | 65 | $ipaddress=""; |
872 | 60 | #print "name $name macaddr $macaddr lanid $lanid speed $speed status $status \n"; | 66 | |
873 | 61 | for ( `ifconfig $name 2> /dev/null` ) { | 67 | if ( /^(\S+)\s(\S+)\s(\S+)\s+(\S+)/) { |
874 | 62 | if ( /inet\s(\S+)\snetmask\s(\S+)\s/ ) { | 68 | $macaddr=$1; |
875 | 63 | $ipaddress=$1; | 69 | $name=$2; |
876 | 64 | $ipmask=$2; | 70 | $lanid=$4; |
877 | 65 | if ($ipmask =~ /(..)(..)(..)(..)/) { | 71 | if ( $macaddr =~ /^0x(..)(..)(..)(..)(..)(..)$/ ) { $macaddr = "$1:$2:$3:$4:$5:$6" } |
878 | 66 | $ipmask=sprintf ("%i.%i.%i.%i",hex($1),hex($2),hex($3),hex($4)); | 72 | #print "name $name macaddr $macaddr lanid $lanid\n"; |
879 | 67 | } | 73 | for ( `lanadmin -g $lanid` ) { |
880 | 68 | 74 | if (/Type.+=\s(.+)/) { $type = $1; } | |
881 | 69 | }; | 75 | if (/Description\s+=\s(.+)/) { $description = $1; } |
882 | 70 | }; # For ifconfig | 76 | if (/Speed.+=\s(\d+)/) { |
883 | 71 | $binip = ip_iptobin ($ipaddress ,4); | 77 | $speed = ($1 > 1000000)? $1/1000000 : $1; # in old version speed was given in Mbps and we want speed in Mbps |
884 | 72 | $binmask = ip_iptobin ($ipmask ,4); | 78 | } |
885 | 73 | $binsubnet = $binip & $binmask; | 79 | if (/Operation Status.+=\sdown\W/i) { $status = "Down"; } #It is not the only criteria |
886 | 74 | $ipsubnet = ip_bintoip($binsubnet,4); | 80 | } # for lanadmin |
887 | 75 | 81 | #print "name $name macaddr $macaddr lanid $lanid speed $speed status $status \n"; | |
888 | 76 | $inventory->addNetworks({ | 82 | for ( `ifconfig $name 2> /dev/null` ) { |
889 | 77 | 83 | if ( not $status and /$name:\s+flags=.*\WUP\W/ ) { #Its status is not reported as down in lanadmin -g | |
890 | 78 | DESCRIPTION => $description, | 84 | $status = 'Up'; |
891 | 79 | IPADDRESS => $ipaddress, | 85 | } |
892 | 80 | IPGATEWAY => $ipgateway, | 86 | if ( /inet\s(\S+)\snetmask\s(\S+)\s/ ) { |
893 | 81 | IPMASK => $ipmask, | 87 | $ipaddress=$1; |
894 | 82 | IPSUBNET => $ipsubnet, | 88 | $ipmask=$2; |
895 | 83 | MACADDR => $macaddr, | 89 | if ($ipmask =~ /(..)(..)(..)(..)/) { |
896 | 84 | STATUS => $status, | 90 | $ipmask=sprintf ("%i.%i.%i.%i",hex($1),hex($2),hex($3),hex($4)); |
897 | 85 | SPEED => $speed, | 91 | } |
898 | 86 | TYPE => $type, | 92 | } |
899 | 87 | }); | 93 | } # For ifconfig |
900 | 88 | 94 | $ipsubnet = join '.', unpack('C4C4C4C4', pack('B32', | |
901 | 89 | }; # If | 95 | unpack('B32', pack('C4C4C4C4', split(/\./, $ipaddress))) |
902 | 90 | }; # For lanscan | 96 | & unpack('B32', pack('C4C4C4C4', split(/\./, $ipmask))) |
903 | 91 | } | 97 | )); |
904 | 98 | |||
905 | 99 | $ipgateway = $gateway{$ipsubnet.'/'.$ipmask}; | ||
906 | 100 | # replace the $ipaddress (ie IP Address of the interface itself) by the default gateway IP adress if it exists | ||
907 | 101 | if (defined($ipgateway) and $ipgateway eq $ipaddress and defined($gateway{'default/0.0.0.0'})) { | ||
908 | 102 | $ipgateway = $gateway{'default/0.0.0.0'} | ||
909 | 103 | } | ||
910 | 104 | |||
911 | 105 | #Some cleanups | ||
912 | 106 | if ( $ipaddress eq '0.0.0.0' ) { $ipaddress = "" } | ||
913 | 107 | if ( not $ipaddress and not $ipmask and $ipsubnet eq '0.0.0.0' ) { $ipsubnet = "" } | ||
914 | 108 | if ( not $status ) { $status = 'Down' } | ||
915 | 109 | |||
916 | 110 | $inventory->addNetwork({ | ||
917 | 111 | DESCRIPTION => $description, | ||
918 | 112 | IPADDRESS => $ipaddress, | ||
919 | 113 | IPMASK => $ipmask, | ||
920 | 114 | IPSUBNET => $ipsubnet, | ||
921 | 115 | MACADDR => $macaddr, | ||
922 | 116 | STATUS => $status, | ||
923 | 117 | TYPE => $type, | ||
924 | 118 | SPEED => $speed, | ||
925 | 119 | IPGATEWAY => $ipgateway, | ||
926 | 120 | # PCISLOT => $pcislot, | ||
927 | 121 | # DRIVER => $driver, | ||
928 | 122 | # VIRTUALDEV => $virtualdev, | ||
929 | 123 | }); | ||
930 | 124 | } # If | ||
931 | 125 | } # For lanscan | ||
932 | 126 | } | ||
933 | 92 | 127 | ||
934 | 93 | 1; | 128 | 1; |
935 | 94 | 129 | ||
936 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/README' | |||
937 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/README 2010-01-22 14:39:51 +0000 | |||
938 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/README 2010-05-27 07:07:27 +0000 | |||
939 | @@ -47,7 +47,7 @@ | |||
940 | 47 | 47 | ||
941 | 48 | It will be used automaticly | 48 | It will be used automaticly |
942 | 49 | 49 | ||
944 | 50 | I have test the script on only n4000 system for th moment on HP-Ux 11.0 | 50 | I have test the script on only n4000 system for the moment on HP-Ux 11.0 |
945 | 51 | I try it on rp3440 but some informations are not in the same format | 51 | I try it on rp3440 but some informations are not in the same format |
946 | 52 | 52 | ||
947 | 53 | If you wish to help me, you are welwome. | 53 | If you wish to help me, you are welwome. |
948 | @@ -61,11 +61,10 @@ | |||
949 | 61 | Controller.pm | 61 | Controller.pm |
950 | 62 | Domains.pm | 62 | Domains.pm |
951 | 63 | Drives.pm | 63 | Drives.pm |
952 | 64 | IPv4.pm | ||
953 | 65 | Mem.pm | ||
954 | 66 | Memory.pm | 64 | Memory.pm |
955 | 67 | Networks.pm | 65 | Networks.pm |
956 | 68 | Slots.pm | 66 | Slots.pm |
957 | 69 | Software.pm | 67 | Software.pm |
958 | 70 | Storages.pm | 68 | Storages.pm |
959 | 69 | Uptime.pm | ||
960 | 71 | 70 | ||
961 | 72 | 71 | ||
962 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Slots.pm' | |||
963 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Slots.pm 2010-01-22 14:39:51 +0000 | |||
964 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Slots.pm 2010-05-27 07:07:27 +0000 | |||
965 | @@ -1,7 +1,7 @@ | |||
966 | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Slots; | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Slots; |
967 | 2 | use strict; | 2 | use strict; |
968 | 3 | 3 | ||
970 | 4 | sub check { $^O =~ /hpux/ } | 4 | sub check { can_run('ioscan') } |
971 | 5 | 5 | ||
972 | 6 | sub run { | 6 | sub run { |
973 | 7 | my $params = shift; | 7 | my $params = shift; |
974 | @@ -22,7 +22,7 @@ | |||
975 | 22 | $interface=$3; | 22 | $interface=$3; |
976 | 23 | $info=$4; | 23 | $info=$4; |
977 | 24 | $type=$1; | 24 | $type=$1; |
979 | 25 | $inventory->addSlots({ | 25 | $inventory->addSlot({ |
980 | 26 | DESCRIPTION => "$name", | 26 | DESCRIPTION => "$name", |
981 | 27 | DESIGNATION => "$interface $info", | 27 | DESIGNATION => "$interface $info", |
982 | 28 | NAME => "$type", | 28 | NAME => "$type", |
983 | 29 | 29 | ||
984 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Software.pm' | |||
985 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Software.pm 2010-01-22 14:39:51 +0000 | |||
986 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Software.pm 2010-05-27 07:07:27 +0000 | |||
987 | @@ -6,7 +6,7 @@ | |||
988 | 6 | # Do not run an package inventory if there is the --nosoft parameter | 6 | # Do not run an package inventory if there is the --nosoft parameter |
989 | 7 | return if ($params->{params}->{nosoft}); | 7 | return if ($params->{params}->{nosoft}); |
990 | 8 | 8 | ||
992 | 9 | $^O =~ /hpux/ | 9 | can_run('swlist') and can_run('grep') |
993 | 10 | } | 10 | } |
994 | 11 | 11 | ||
995 | 12 | sub run { | 12 | sub run { |
996 | @@ -22,7 +22,7 @@ | |||
997 | 22 | foreach $software (@softList) { | 22 | foreach $software (@softList) { |
998 | 23 | chomp( $software ); | 23 | chomp( $software ); |
999 | 24 | if ( $software =~ /^ (\S+)\s(\S+)\s(.+)/ ) { | 24 | if ( $software =~ /^ (\S+)\s(\S+)\s(.+)/ ) { |
1001 | 25 | $inventory->addSoftwares({ | 25 | $inventory->addSoftware({ |
1002 | 26 | 'NAME' => $1 , | 26 | 'NAME' => $1 , |
1003 | 27 | 'VERSION' => $2 , | 27 | 'VERSION' => $2 , |
1004 | 28 | 'COMMENTS' => $3 , | 28 | 'COMMENTS' => $3 , |
1005 | 29 | 29 | ||
1006 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Storages.pm' | |||
1007 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Storages.pm 2010-02-25 18:36:52 +0000 | |||
1008 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Storages.pm 2010-05-27 07:07:27 +0000 | |||
1009 | @@ -1,6 +1,6 @@ | |||
1010 | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Storages; | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Storages; |
1011 | 2 | 2 | ||
1013 | 3 | sub check { $^O =~ /hpux/ } | 3 | sub check { can_run('ioscan') and can_run('cut') and can_run('pvdisplay') and can_run('diskinfo') } |
1014 | 4 | 4 | ||
1015 | 5 | sub run { | 5 | sub run { |
1016 | 6 | my $params = shift; | 6 | my $params = shift; |
1017 | 7 | 7 | ||
1018 | === added file 'lib/Ocsinventory/Agent/Backend/OS/HPUX/Uptime.pm' | |||
1019 | --- lib/Ocsinventory/Agent/Backend/OS/HPUX/Uptime.pm 1970-01-01 00:00:00 +0000 | |||
1020 | +++ lib/Ocsinventory/Agent/Backend/OS/HPUX/Uptime.pm 2010-05-27 07:07:27 +0000 | |||
1021 | @@ -0,0 +1,29 @@ | |||
1022 | 1 | package Ocsinventory::Agent::Backend::OS::HPUX::Uptime; | ||
1023 | 2 | use strict; | ||
1024 | 3 | |||
1025 | 4 | sub check { can_run("uptime") and can_run ("uname") } | ||
1026 | 5 | |||
1027 | 6 | sub run { | ||
1028 | 7 | my $params = shift; | ||
1029 | 8 | my $inventory = $params->{inventory}; | ||
1030 | 9 | |||
1031 | 10 | # Uptime | ||
1032 | 11 | my $uptime = `uptime`; | ||
1033 | 12 | my $seconds = 0; | ||
1034 | 13 | if ( $uptime =~ /.*\sup\s((\d+)\sdays\D+)?(\d{1,2}):(\d{1,2}).*/ ) { | ||
1035 | 14 | $seconds += $2 * 24 * 3600; | ||
1036 | 15 | $seconds += $3 * 3600; | ||
1037 | 16 | $seconds += $4 * 60; | ||
1038 | 17 | } | ||
1039 | 18 | |||
1040 | 19 | # Uptime conversion | ||
1041 | 20 | my ($UYEAR, $UMONTH , $UDAY, $UHOUR, $UMIN, $USEC) = (gmtime ($seconds))[5,4,3,2,1,0]; | ||
1042 | 21 | |||
1043 | 22 | # Write in ISO format | ||
1044 | 23 | $uptime=sprintf "%02d-%02d-%02d %02d:%02d:%02d", ($UYEAR-70), $UMONTH, ($UDAY-1), $UHOUR, $UMIN, $USEC; | ||
1045 | 24 | |||
1046 | 25 | chomp(my $DeviceType =`uname -m`); | ||
1047 | 26 | $inventory->setHardware({ DESCRIPTION => "$DeviceType/$uptime" }); | ||
1048 | 27 | } | ||
1049 | 28 | |||
1050 | 29 | 1 | ||
1051 | 0 | 30 | ||
1052 | === added file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/iLO.pm' | |||
1053 | --- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/iLO.pm 1970-01-01 00:00:00 +0000 | |||
1054 | +++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/iLO.pm 2010-05-27 07:07:27 +0000 | |||
1055 | @@ -0,0 +1,66 @@ | |||
1056 | 1 | package Ocsinventory::Agent::Backend::OS::Linux::Network::iLO; | ||
1057 | 2 | |||
1058 | 3 | use strict; | ||
1059 | 4 | use warnings; | ||
1060 | 5 | |||
1061 | 6 | sub check { | ||
1062 | 7 | return unless can_run("hponcfg") && can_load("Net::IP qw(:PROC)"); | ||
1063 | 8 | 1; | ||
1064 | 9 | } | ||
1065 | 10 | |||
1066 | 11 | sub run { | ||
1067 | 12 | my $params = shift; | ||
1068 | 13 | my $inventory = $params->{inventory}; | ||
1069 | 14 | my $logger = $params->{logger}; | ||
1070 | 15 | |||
1071 | 16 | my $name; | ||
1072 | 17 | my $ipmask; | ||
1073 | 18 | my $ipgateway; | ||
1074 | 19 | my $speed; | ||
1075 | 20 | my $ipsubnet; | ||
1076 | 21 | my $ipaddress; | ||
1077 | 22 | my $status; | ||
1078 | 23 | # my $macaddr; | ||
1079 | 24 | |||
1080 | 25 | foreach (`hponcfg -aw -`) { | ||
1081 | 26 | if ( /<IP_ADDRESS VALUE="([0-9.]+)"\/>/ ) { | ||
1082 | 27 | $ipaddress = $1; | ||
1083 | 28 | } elsif ( /<SUBNET_MASK VALUE="([0-9.]+)"\/>/ ) { | ||
1084 | 29 | $ipmask = $1; | ||
1085 | 30 | } elsif ( /<GATEWAY_IP_ADDRESS VALUE="([0-9.]+)"\/>/ ) { | ||
1086 | 31 | $ipgateway = $1; | ||
1087 | 32 | } elsif ( /<NIC_SPEED VALUE="([0-9]+)"\/>/ ) { | ||
1088 | 33 | $speed = $1; | ||
1089 | 34 | } elsif ( /<DNS_NAME VALUE="([^"]+)"\/>/ ) { | ||
1090 | 35 | $name = $1; | ||
1091 | 36 | } elsif ( /<ENABLE_NIC VALUE="(.)"\/>/ ) { | ||
1092 | 37 | $status = 'Up' if $1 =~ /Y/i; | ||
1093 | 38 | } | ||
1094 | 39 | } | ||
1095 | 40 | if ( defined($ipaddress) && defined($ipmask) ) { | ||
1096 | 41 | $ipsubnet = ip_bintoip(ip_iptobin ($ipaddress ,4) & ip_iptobin ($ipmask ,4), 4); | ||
1097 | 42 | } | ||
1098 | 43 | |||
1099 | 44 | #Some cleanups | ||
1100 | 45 | if ( $ipaddress eq '0.0.0.0' ) { $ipaddress = "" } | ||
1101 | 46 | if ( not $ipaddress and not $ipmask and $ipsubnet eq '0.0.0.0' ) { $ipsubnet = "" } | ||
1102 | 47 | if ( not $status ) { $status = 'Down' } | ||
1103 | 48 | |||
1104 | 49 | $inventory->addNetwork({ | ||
1105 | 50 | DESCRIPTION => 'Management Interface - HP iLO', | ||
1106 | 51 | IPADDRESS => $ipaddress, | ||
1107 | 52 | IPMASK => $ipmask, | ||
1108 | 53 | IPSUBNET => $ipsubnet, | ||
1109 | 54 | STATUS => $status, | ||
1110 | 55 | TYPE => 'Ethernet', | ||
1111 | 56 | SPEED => $speed, | ||
1112 | 57 | IPGATEWAY => $ipgateway, | ||
1113 | 58 | MANAGEMENT => 'iLO', | ||
1114 | 59 | # MACADDR => $macaddr, | ||
1115 | 60 | # PCISLOT => $pcislot, | ||
1116 | 61 | # DRIVER => $driver, | ||
1117 | 62 | # VIRTUALDEV => $virtualdev, | ||
1118 | 63 | }); | ||
1119 | 64 | } | ||
1120 | 65 | 1; | ||
1121 | 66 | |||
1122 | 0 | 67 | ||
1123 | === modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Storages.pm' | |||
1124 | --- lib/Ocsinventory/Agent/Backend/OS/Linux/Storages.pm 2009-08-04 11:46:48 +0000 | |||
1125 | +++ lib/Ocsinventory/Agent/Backend/OS/Linux/Storages.pm 2010-05-27 07:07:27 +0000 | |||
1126 | @@ -129,7 +129,7 @@ | |||
1127 | 129 | my $value; | 129 | my $value; |
1128 | 130 | foreach my $line (`lshal`) { | 130 | foreach my $line (`lshal`) { |
1129 | 131 | chomp $line; | 131 | chomp $line; |
1131 | 132 | if ( $line =~ s{^udi = '/org/freedesktop/Hal/devices/storage.*}{}) { | 132 | if ( $line =~ s{^udi = '/org/freedesktop/Hal/devices/(storage|legacy_floppy|block).*}{}) { |
1132 | 133 | $in = 1; | 133 | $in = 1; |
1133 | 134 | %temp = (); | 134 | %temp = (); |
1134 | 135 | } elsif ($in == 1 and $line =~ s{^\s+(\S+) = (.*) \s*\((int|string|bool|string list|uint64)\)}{} ) { | 135 | } elsif ($in == 1 and $line =~ s{^\s+(\S+) = (.*) \s*\((int|string|bool|string list|uint64)\)}{} ) { |
1135 | @@ -216,7 +216,7 @@ | |||
1136 | 216 | my ($manufacturer, $model, $media, $firmware, $serialnumber, $capacity, $partitions, $description); | 216 | my ($manufacturer, $model, $media, $firmware, $serialnumber, $capacity, $partitions, $description); |
1137 | 217 | foreach (glob ("/sys/block/*")) {# /sys fs style | 217 | foreach (glob ("/sys/block/*")) {# /sys fs style |
1138 | 218 | $partitions->{$1} = undef | 218 | $partitions->{$1} = undef |
1140 | 219 | if (/^\/sys\/block\/([sh]d[a-z])$/) | 219 | if (/^\/sys\/block\/([sh]d[a-z]|fd\d)$/) |
1141 | 220 | } | 220 | } |
1142 | 221 | foreach (`fdisk -l`) {# call fdisk to list partitions | 221 | foreach (`fdisk -l`) {# call fdisk to list partitions |
1143 | 222 | chomp; | 222 | chomp; |
1144 | 223 | 223 | ||
1145 | === modified file 'lib/Ocsinventory/Agent/XML/Inventory.pm' | |||
1146 | --- lib/Ocsinventory/Agent/XML/Inventory.pm 2010-03-24 20:28:01 +0000 | |||
1147 | +++ lib/Ocsinventory/Agent/XML/Inventory.pm 2010-05-27 07:07:27 +0000 | |||
1148 | @@ -497,6 +497,7 @@ | |||
1149 | 497 | my $status = $args->{STATUS}; | 497 | my $status = $args->{STATUS}; |
1150 | 498 | my $type = $args->{TYPE}; | 498 | my $type = $args->{TYPE}; |
1151 | 499 | my $virtualdev = $args->{VIRTUALDEV}; | 499 | my $virtualdev = $args->{VIRTUALDEV}; |
1152 | 500 | my $speed = $args->{SPEED}; | ||
1153 | 500 | 501 | ||
1154 | 501 | # return unless $ipaddress; | 502 | # return unless $ipaddress; |
1155 | 502 | 503 | ||
1156 | @@ -515,6 +516,7 @@ | |||
1157 | 515 | STATUS => [$status?$status:''], | 516 | STATUS => [$status?$status:''], |
1158 | 516 | TYPE => [$type?$type:''], | 517 | TYPE => [$type?$type:''], |
1159 | 517 | VIRTUALDEV => [$virtualdev?$virtualdev:''], | 518 | VIRTUALDEV => [$virtualdev?$virtualdev:''], |
1160 | 519 | SPEED => [$speed?$speed:''], | ||
1161 | 518 | 520 | ||
1162 | 519 | }; | 521 | }; |
1163 | 520 | } | 522 | } |
Any testing yet?