Subversion Repositories camp_sysinfo_client_3

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 rodolico 1
#! /usr/bin/perl -w
2
 
3
# gets information on linux systems with lsb on them
4
 
5
BEGIN {
6
   push @INC, shift;
7
}
8
 
9
use library;
10
 
11
my $CATEGORY = 'operatingsystem';
12
 
13
my $command = 'lsb_release';
14
 
15
if ( $command = &validCommandOnSystem('lsb_release') ) {
16
   print "$CATEGORY\tdistribution\t" . &cleanUp(':', qx($command -i)) . "\n";
17
   print "$CATEGORY\tdescription\t" . &cleanUp(':', qx($command -d)) . "\n";
18
   print "$CATEGORY\trelease\t" . &cleanUp(':', qx($command -r)) . "\n";
19
   print "$CATEGORY\tcodename\t" . &cleanUp(':', qx($command -c)) . "\n";
20
}
21
 
22
if ( $command = &validCommandOnSystem('uname') ) {
23
   print "$CATEGORY\tos_name\t" . &cleanUp('', qx($command -s)) . "\n";
24
   print "$CATEGORY\tkernel\t" . &cleanUp('', qx($command -r)) . "\n";
25
}
26
 
27
print "$CATEGORY\tos_version\t" . &cleanUp('', qx(cat /proc/version)) . "\n" if -e '/proc/version';