source: ocsinventory-agent/trunk/fuentes/tools/parseVmware.pl

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

Copyt trusty code

File size: 383 bytes
Line 
1#!/usr/bin/perl -w
2
3use strict;
4use warnings;
5
6use Data::Dumper;
7
8my $data = {
9        cpu => {},
10        mem => {},
11};
12
13open VMWARECPU,"</proc/vmware/cpuinfo" or die;
14foreach (<VMWARECPU>) {
15        if (/^\s*(\w+)\s+(\w.*)\s*/) {
16        my $key = $1;
17        my @data = split(/\s+/,$2);
18
19        print Dumper(\@data);
20        $data->{cpu}->{$key} = \@data;
21        #print $1." -> '".$2."'\n";
22        }
23}
24
25print Dumper($data);
26close VMWARECPU;
Note: See TracBrowser for help on using the repository browser.