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