Subversion Repositories camp_sysinfo_client_3

Rev

Rev 57 | Go to most recent revision | 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 packages installed via rpm (RedHat)
20 rodolico 6
 
37 rodolico 7
our $VERSION = '1.2';
8
 
20 rodolico 9
# Redhat software module for sysinfo client
10
# Author: R. W. Rodolico
11
# Date:   2016-04-08
2 rodolico 12
# gets information on software on systems with rpm on them (Redhat)
13
 
14
BEGIN {
15
   push @INC, shift;
16
}
17
 
18
use library;
19
 
20
my $rpm = &validCommandOnSystem( 'rpm' );
21
 
22
exit 1 unless $rpm;
23
 
24
my $CATEGORY = 'software';
25
 
26
my @packageList = split( "\n", qx( $rpm -qa --qf "%{NAME}\\t%{VERSION}\\t%{DISTRIBUTION}\\n" ) );
27
chomp @packageList;
28 rodolico 28
for ( my $i = 0; $i < @packageList; $i++ ) {
2 rodolico 29
   my ($package, $version, $distribution)  = split( "\t", $packageList[$i]);
30
   print "$CATEGORY\t$package\tversion\t$version\n";
7 rodolico 31
#   print "$CATEGORY\t$package\tdescription\t" . join(" ", @description) . "\n";
2 rodolico 32
}