Subversion Repositories camp_sysinfo_client_3

Rev

Rev 69 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69 Rev 153
Line 28... Line 28...
28
                  'dmesg' => '',
28
                  'dmesg' => '',
29
                  'uname' => '',
29
                  'uname' => '',
30
                  'sysctl' => ''
30
                  'sysctl' => ''
31
 
31
 
32
               );
32
               );
33
               
-
 
34
 
-
 
35
 
33
 
36
# check the commands for validity
34
# check the commands for validity
37
foreach my $command ( keys %commands ) {
35
foreach my $command ( keys %commands ) {
38
   $commands{$command} = &validCommandOnSystem( $command );
36
   $commands{$command} = &validCommandOnSystem( $command );
39
}
37
}
Line 45... Line 43...
45
# see sysinfo for a list of valid categories
43
# see sysinfo for a list of valid categories
46
my $CATEGORY = 'system';
44
my $CATEGORY = 'system';
47
 
45
 
48
my $temp;
46
my $temp;
49
 
47
 
-
 
48
# following removed as they are now gotten through dmidecode module
50
$temp = getSysctlParameter( $commands{ 'sysctl' }, 'hw.ncpu' );
49
#$temp = getSysctlParameter( $commands{ 'sysctl' }, 'hw.ncpu' );
51
print "$CATEGORY\tnum_cpu\t$temp\n" if $temp;
50
#print "$CATEGORY\tnum_cpu\t$temp\n" if $temp;
52
 
51
 
53
$temp = getSysctlParameter( $commands{ 'sysctl' }, 'hw.clockrate' );
52
#$temp = getSysctlParameter( $commands{ 'sysctl' }, 'hw.clockrate' );
54
print "$CATEGORY\tcpu_speed\t$temp\n" if $temp;;
53
#print "$CATEGORY\tcpu_speed\t$temp\n" if $temp;;
55
 
54
 
56
$temp = getSysctlParameter( $commands{ 'sysctl' }, 'hw.model' );
55
#$temp = getSysctlParameter( $commands{ 'sysctl' }, 'hw.model' );
57
print "$CATEGORY\tcpu\t$temp\n" if $temp;
56
#print "$CATEGORY\tcpu\t$temp\n" if $temp;
58
 
57
 
59
# all this needs is uname
58
# all this needs is uname
60
print "$CATEGORY\tcpu_sub\t" . &cleanUp('', qx(uname -m)) . "\n" if $commands{'uname'};
59
#print "$CATEGORY\tcpu_sub\t" . &cleanUp('', qx(uname -m)) . "\n" if $commands{'uname'};
61
print "$CATEGORY\tcpu_type\tUNK\n";
60
#print "$CATEGORY\tcpu_type\tUNK\n";
62
 
61
 
63
$temp = getSysctlParameter( $commands{ 'sysctl' }, 'hw.realmem' );
62
#$temp = getSysctlParameter( $commands{ 'sysctl' }, 'hw.realmem' );
64
$temp /= 1024;
63
#$temp /= 1024;
65
print "$CATEGORY\tmemory\t$temp\n";
64
#print "$CATEGORY\tmemory\t$temp\n";
66
 
65
 
67
$temp = getSysctlParameter( $commands{ 'sysctl' }, 'kern.boottime' );
66
$temp = getSysctlParameter( $commands{ 'sysctl' }, 'kern.boottime' );
68
$temp =~ m/sec = (\d+),/;
67
$temp =~ m/sec = (\d+),/;
69
$temp = $1;
68
$temp = $1;
70
print "$CATEGORY\tlast_boot\t$temp\n";
69
print "$CATEGORY\tlast_boot\t$temp\n";