Subversion Repositories camp_sysinfo_client_3

Rev

Rev 49 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 rodolico 1
#!/usr/bin/env perl
2
use warnings;
26 rodolico 3
use strict;  
2 rodolico 4
 
37 rodolico 5
# Description: Get Kernel, distro, etc... on Unix systems
20 rodolico 6
 
37 rodolico 7
our $VERSION = '1.1';
8
 
20 rodolico 9
# Linux module for sysinfo client
10
# Author: R. W. Rodolico
11
# Date:   2016-04-08
12
 
2 rodolico 13
# gets information on linux systems with lsb on them
14
 
15
BEGIN {
16
   push @INC, shift;
17
}
18
 
19
use library;
20
 
21
my $CATEGORY = 'operatingsystem';
22
 
23
my $command = 'lsb_release';
24
 
25
if ( $command = &validCommandOnSystem('lsb_release') ) {
26
   print "$CATEGORY\tdistribution\t" . &cleanUp(':', qx($command -i)) . "\n";
27
   print "$CATEGORY\tdescription\t" . &cleanUp(':', qx($command -d)) . "\n";
28
   print "$CATEGORY\trelease\t" . &cleanUp(':', qx($command -r)) . "\n";
29
   print "$CATEGORY\tcodename\t" . &cleanUp(':', qx($command -c)) . "\n";
30
}
31
 
32
if ( $command = &validCommandOnSystem('uname') ) {
33
   print "$CATEGORY\tos_name\t" . &cleanUp('', qx($command -s)) . "\n";
34
   print "$CATEGORY\tkernel\t" . &cleanUp('', qx($command -r)) . "\n";
35
}
36
 
37
print "$CATEGORY\tos_version\t" . &cleanUp('', qx(cat /proc/version)) . "\n" if -e '/proc/version';