Subversion Repositories camp_sysinfo_client_3

Rev

Rev 69 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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

# Description: Get packages installed via rpm (RedHat)

our $VERSION = '1.2';

# Redhat software module for sysinfo client
# Author: R. W. Rodolico
# Date:   2016-04-08
# gets information on software on systems with rpm on them (Redhat)

BEGIN {
   push @INC, shift;
}

use library;

my $rpm = &validCommandOnSystem( 'rpm' );

exit 1 unless $rpm;

my $CATEGORY = 'software';

my @packageList = split( "\n", qx( $rpm -qa --qf "%{NAME}\\t%{VERSION}\\t%{DISTRIBUTION}\\n" ) );
chomp @packageList;
for ( my $i = 0; $i < @packageList; $i++ ) {
   my ($package, $version, $distribution)  = split( "\t", $packageList[$i]);
   print "$CATEGORY\t$package\tversion\t$version\n";
#   print "$CATEGORY\t$package\tdescription\t" . join(" ", @description) . "\n";
}