Subversion Repositories camp_sysinfo_client_3

Rev

Rev 69 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#!/usr/bin/env perl
use warnings;
use strict;  

# Description: Get Kernel, distro, etc... on Unix systems

our $VERSION = '1.1';

# Linux module for sysinfo client
# Author: R. W. Rodolico
# Date:   2016-04-08

# gets information on linux systems with lsb on them

BEGIN {
   push @INC, shift;
}

use library;

my $CATEGORY = 'operatingsystem';

my $command = 'lsb_release';

if ( $command = &validCommandOnSystem('lsb_release') ) {
   print "$CATEGORY\tdistribution\t" . &cleanUp(':', qx($command -i)) . "\n";
   print "$CATEGORY\tdescription\t" . &cleanUp(':', qx($command -d)) . "\n";
   print "$CATEGORY\trelease\t" . &cleanUp(':', qx($command -r)) . "\n";
   print "$CATEGORY\tcodename\t" . &cleanUp(':', qx($command -c)) . "\n";
}

if ( $command = &validCommandOnSystem('uname') ) {
   print "$CATEGORY\tos_name\t" . &cleanUp('', qx($command -s)) . "\n";
   print "$CATEGORY\tkernel\t" . &cleanUp('', qx($command -r)) . "\n";
}

print "$CATEGORY\tos_version\t" . &cleanUp('', qx(cat /proc/version)) . "\n" if -e '/proc/version';