PDA

View Full Version : SUSE Manager Reporting



nzle
09-Dec-2014, 21:59
Does anyone have any suggestions regarding generating printed reports, or csv exports from SuseManager? I see from some screens you can save a csv file, seems to me mostly from the Systems list.

What I need to be able to do is generate a list of Patches or Package updates needed for a system group. My customer requires that they review the list of updates to be performed prior to the operation.

Cutting and pasting the table from the screen is clumsy. There should be a better way. Perhaps even adding information like the description of the package, or info from the CVE report for patches.

malcolmlewis
09-Dec-2014, 22:23
On Tue 09 Dec 2014 09:04:01 PM CST, nzle wrote:


Does anyone have any suggestions regarding generating printed reports,
or csv exports from SuseManager? I see from some screens you can save a
csv file, seems to me mostly from the Systems list.

What I need to be able to do is generate a list of Patches or Package
updates needed for a system group. My customer requires that they
review the list of updates to be performed prior to the operation.

Cutting and pasting the table from the screen is clumsy. There should
be a better way. Perhaps even adding information like the description
of the package, or info from the CVE report for patches.




Hi
Mine get emailed to me after a sync run for every patch for example;



Subject: SUSE Manager Patch Alert: firefox31-201411-9935 - Security
update for MozillaFirefox Date: Fri, 5 Dec 2014 09:00:09 -0600 (CST)


SUSE Manager has determined that the following advisory is applicable to
one or more of the systems you have registered:

Complete information about this patch can be found at the following
location:
https://mysuseserver/rhn/errata/details/Details.do?eid=1531

Security Advisory - firefox31-201411-9935


This is done under Users->user name->Preferences.

--
Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.28-4-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below... Thanks!

kwk
10-Dec-2014, 09:22
Install the 'spacewalk-reports' package on your SUSE Manager Server and use the 'spacewalk-report' package to generate reports.

nzle
17-Dec-2014, 21:13
I ended up using the API to roll my own. Its not perfect or even pretty, but it seems to do what I wanted.

The only bit Im confused about is that the 'system.listLatestUpgradablePackages' returned several of the same packages for the kernel packages confusing one of my counters. I had to wrap it some logic to ensure it was counted only once. Im not sure why I got several of the same packages from the api though.




#!/usr/bin/perl -w
use Frontier::Client;
use Term::ReadKey;
use List::MoreUtils 'first_index';

my $user = 'USERNAME';
my $pass = 'PASSWORD';

# (1) quit unless we have the correct number of command-line args
$num_args = $#ARGV + 1;
if ($num_args != 1) {
print "\nUsage: $0 system_group\n";
exit;
}
my $grp=$ARGV[0];

my $HOST = 'SUSEMANAGER-HOST';
my $client = new Frontier::Client(url => "http://$HOST/rpc/api");
my $session = $client->call('auth.login',$user, $pass);
my $systems = $client->call('systemgroup.listSystemsMinimal', $session, $grp);

my $syscount = scalar(@$systems) ;

print "\nUpgradeable packages for group: $grp\n";
print "\n$syscount Systems in group\n";

#foreach my $syst (@$systems) {
# print $syst->{'name'}."\n";
#}

foreach my $system (@$systems) {
my $upgpkgs = $client->call('system.listLatestUpgradablePackages', $session, $system->{'id'});
my $last_pkgname = '';
foreach my $upgpkg (@$upgpkgs) {
my $pkgname = $upgpkg->{'name'}.".".$upgpkg->{'to_version'}."-".$upgpkg->{'to_release'}.' '.$upgpkg->{'arch'};
if ($pkgname ne $last_pkgname ) {
$pkglist{"$pkgname"} ++;
}
$last_pkgname = $pkgname;
}
}

$pkgcount = scalar(keys(%pkglist));

print "\n$pkgcount Upgradable Packages\n";
print "Systems\tName.Version-Release Arch \n";
print "=======\t=======================================\n";
foreach (sort keys %pkglist) {
print "$pkglist{$_}\t$_\n";
}


$client->call('auth.logout', $session);
[/FONT]

nzle
17-Dec-2014, 22:32
I thought I responded to your suggestion that I look at the spacewalk-reports package but I dont see it here. Thank you, that was helpful, it didn't get me exactly what I needed but There are several canned reports that will be quite useful. While trying to figure out if you could add reports to it, I learned more about the API and was able to put what I needed together with that as detailed in another post in this thread.