Subversion Repositories camp_sysinfo_client_3

Rev

Go to most recent revision | Details | 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
 
26 rodolico 5
our $VERSION = '1.0';
20 rodolico 6
 
7
# Linux module for sysinfo client
8
# Author: R. W. Rodolico
9
# Date:   2016-04-08
10
 
2 rodolico 11
# gets information on linux systems with lsb on them
12
 
13
BEGIN {
14
   push @INC, shift;
15
}
16
 
17
use library;
18
 
19
my $CATEGORY = 'operatingsystem';
20
 
21
my $command = 'lsb_release';
22
 
23
if ( $command = &validCommandOnSystem('lsb_release') ) {
24
   print "$CATEGORY\tdistribution\t" . &cleanUp(':', qx($command -i)) . "\n";
25
   print "$CATEGORY\tdescription\t" . &cleanUp(':', qx($command -d)) . "\n";
26
   print "$CATEGORY\trelease\t" . &cleanUp(':', qx($command -r)) . "\n";
27
   print "$CATEGORY\tcodename\t" . &cleanUp(':', qx($command -c)) . "\n";
28
}
29
 
30
if ( $command = &validCommandOnSystem('uname') ) {
31
   print "$CATEGORY\tos_name\t" . &cleanUp('', qx($command -s)) . "\n";
32
   print "$CATEGORY\tkernel\t" . &cleanUp('', qx($command -r)) . "\n";
33
}
34
 
35
print "$CATEGORY\tos_version\t" . &cleanUp('', qx(cat /proc/version)) . "\n" if -e '/proc/version';