/usr/share/logwatch/scripts/services/tivoli-smc is in logwatch 7.4.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | #!/usr/bin/perl
# Copyright 2013 by Stefan Jakobs <projects@localside.net>
###########################################################################
# $Id$
###########################################################################
########################################################
## Copyright (c) 2013 Stefan Jakobs
## Covered under the included MIT/X-Consortium License:
## http://www.opensource.org/licenses/mit-license.php
## All modifications and contributions by other persons to
## this script are assumed to have been donated to the
## Logwatch project and thus assume the above copyright
## and licensing terms. If you want to make contributions
## under your own copyright or a different license this
## must be explicitly stated in the contribution an the
## Logwatch project reserves the right to not accept such
## contributions. If you have made significant
## contributions to this script and want to claim
## copyright please contact logwatch-devel@lists.sourceforge.net.
#########################################################
use strict;
my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
my $Version = "20130212";
my ($ThisLine, %OtherList);
my (%IncBackup, %IncBackupFailure);
my (%Object, %ObjectSend, %ObjectName);
my (%Error, %NoConnection, %File);
my $Interrupted;
### functions ###
sub print_2xhash($$) {
my %hash = %{$_[0]};
my $desc = $_[1];
print "$desc\n";
foreach my $item (keys %hash) {
printf(" %-44s\n", $item);
foreach my $item2 (keys %{$hash{$item}}) {
printf(" %-42s %5d time(s)\n", $item2, $hash{$item}{$item2});
}
}
print "\n";
}
### main ###
while(defined ($ThisLine = <STDIN>)) {
chomp $ThisLine;
# remove when filter script is done
#$ThisLine =~ s/^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d //;
if ( ($ThisLine =~ /^\w+ Could not establish a session with a TSM server or client agent/ ) ||
($ThisLine =~ /^\w+ Communication with the TSM server is lost/ )
) {
# ignore
}
elsif ($ThisLine =~ /(\w+) Incremental backup of '([^']+)' finished with (\d+) failure/) {
$IncBackup{"$2"}++;
$IncBackupFailure{"$2"}+=$3;
} elsif ($ThisLine =~ /(\w+) Sending of object '([^']+)' (.+)/) {
$ObjectSend{"$3"}{"$2"}++;
} elsif ($ThisLine =~ /(\w+) Object name '([^']+)' (.+)/) {
$ObjectName{"$3"}{"$2"}++;
} elsif ($ThisLine =~ /(\w+) Object '([^']+)' (.+)/) {
$Object{"$3"}{"$2"}++;
} elsif ($ThisLine =~ /cuGetBackQryResp: (.*):0,(.*)$/) {
$Object{$1}{$2}++;
} elsif ($ThisLine =~ /(\w+) An interrupt has occurred/) {
$Interrupted++;
} elsif ($ThisLine =~ /(\w+) (.+)\.\s+The TSM return code is ([-0-9]+)/) {
$Error{$3}{"$2"}++;
} elsif ($ThisLine =~ /(\w+) (Session rejected): (.+)/) {
$Error{"$2"}{$3}++;
} elsif ($ThisLine =~ /(\w+) (Error processing) '([^']+)': (.+)/) {
$Error{"$2"}{$4}++;
} elsif ($ThisLine =~ /(\w+) Could not establish a TCP\/IP connection with address '([^']+)'\. The TCP\/IP error is '([^']+)'/) {
$NoConnection{"$2"}{$3}++;
} elsif ($ThisLine =~ /(\w+) (An invalid TCP\/IP address was specified)/) {
$Error{"$2"}{$1}++;
} elsif ($ThisLine =~ /File '(?:[^']+)' (.*)/) {
$File{"$1"}++;
}
else {
chomp($ThisLine);
$OtherList{$ThisLine}++;
}
} # end of while
### generate output ###
if (keys %Error) {
print_2xhash(\%Error, "Errors:");
}
if ($Interrupted) {
printf("%-46s %5d time(s)\n\n", "Interrupted", $Interrupted);
}
if (keys %File) {
print "File:\n";
foreach my $msg (keys %File) {
printf(" %-44s %5d time(s)\n", $msg, $File{$msg});
}
print "\n";
}
if (keys %IncBackup) {
print "Incremental Backups finished:\n";
foreach my $dir (sort {$IncBackup{$b} <=> $IncBackup{$a}} keys %IncBackup) {
printf(" %-44s %5d time(s) with %3d failure(s)\n", $dir, $IncBackup{$dir}, $IncBackupFailure{$dir});
}
print "\n";
}
if (keys %ObjectSend) {
print_2xhash(\%ObjectSend, "Sending of objects:");
}
if (keys %ObjectName) {
print_2xhash(\%ObjectName, "Object Names:");
}
if (keys %Object) {
print_2xhash(\%Object, "Object:");
}
if (keys %NoConnection) {
print_2xhash(\%NoConnection, "NoConnections:");
}
if (keys %OtherList) {
print "\n**** Unmatched entries ****\n";
foreach my $Error (keys %OtherList) {
print " $Error : $OtherList{$Error} Time(s)\n";
}
}
### return without a failure ###
exit(0);
# vi: shiftwidth=3 tabstop=3 syntax=perl et
|