Hi, attached is a patch for the following logwatch version to add the current uptime to the logwatch report.
To have he current uptime in the daily report is very handy if there are policies that require you to reboot a server after n days uptime. Cheers, Michael Distribution: Ubuntu Karmic Package: logwatch State: installed Automatically installed: no Version: 7.3.6.cvs20090906-1ubuntu1
--- logwatch.pl-orig2 2009-11-14 00:01:53.000000000 +0100
+++ logwatch.pl 2009-11-14 00:29:53.000000000 +0100
@@ -1202,9 +1202,14 @@
if ($Config{'range'} ne 'all');
&output( $index_par, " Period is " .
&GetPeriod() . ".\n", "line")
if ($Config{'range'} ne 'all');
- &output( $index_par, " Detail Level of Output: $Config{'detail'}\n",
"line");
- &output( $index_par, " Type of Output/Format: $Config{'output'} /
$Config{'format'}\n", "line");
- &output( $index_par, " Logfiles for Host: $Config{'hostname'}\n",
"line");
+ &output( $index_par, " Detail Level of Output: $Config{'detail'}\n",
"line");
+ &output( $index_par, " Type of Output/Format: $Config{'output'} /
$Config{'format'}\n", "line");
+ &output( $index_par, " Logfiles for Host: $Config{'hostname'}\n",
"line");
+ my @uptime_string_splitted = split( /,/ , `uptime` );
+ my $uptime_string = $uptime_string_splitted[0] . "," .
$uptime_string_splitted[1];
+ @uptime_string_splitted = split( /p/ , $uptime_string );
+ $uptime_string = $uptime_string_splitted[1];
+ &output( $index_par, " Current Uptime: $uptime_string\n",
"line");
if ( $Config{'format'} eq "html" ) {
&output( $index_par, "\n", "stop");
signature.asc
Description: OpenPGP digital signature
-- Ubuntu-devel-discuss mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss
