Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 261041 Details for
Bug 380331
logwatch "disk space" can't access all mounted filesystems
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
testing script
zz-disk_space (text/plain), 4.96 KB, created by
Ivana Varekova
on 2007-11-16 11:49:33 UTC
(
hide
)
Description:
testing script
Filename:
MIME Type:
Creator:
Ivana Varekova
Created:
2007-11-16 11:49:33 UTC
Size:
4.96 KB
patch
obsolete
>########################################################################## ># $Id: zz-disk_space,v 1.19 2007/03/13 22:07:27 mike Exp $ >########################################################################## >$| = 1; > >use POSIX qw(uname); > >my (%Config); > >$ENV{PRINTING} = "y"; > >my $Ouput = $ENV{'LOGWATCH_OUTPUT_TYPE'} || 0; >my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0; >my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0; >my $logwatch_hostname = $ENV{'LOGWATCH_ONLY_HOSTNAME'}; > >my $show_home_dir_sizes = $ENV{'show_home_dir_sizes'} || 0; >my $home_dir = $ENV{'home_dir'} || 0; >my $show_mail_dir_sizes = $ENV{'show_mail_dir_sizes'} || 0; >my $mail_dir = $ENV{'mail_dir'} || 0; >my $show_disk_usage = $ENV{'show_disk_usage'} || 0; >my $diskfull_threshhold = $ENV{'diskfull_threshold'} || 90; > >my $df_options; >my $disk_cmd; > >my ($OSname, $hostname, $release, $version, $machine) = POSIX::uname(); >$hostname =~ s/\..*//; >exit (0) if ($ENV{'LOGWATCH_ONLY_HOSTNAME'} and ($logwatch_hostname ne $hostname)); > >if ( $Debug >= 5 ) { > print STDERR "\n\nDEBUG: Inside zz-disk-space Filter \n\n"; > $DebugCounter = 1; >} > >sub DirUsage { > my $Dir = $_[0]; > if ($OSname eq "Linux") { > system("du -s --block-size=1048576 -h $Dir | sort -n -r -k 1"); > } elsif ($OSname eq "Darwin") { > system("du -s --block-size=1048576 -h $Dir | sort -n -r -k 1"); > } elsif ($OSname eq "SunOS") { > if ( ($release eq "5.10") || ($release eq "5.9") || ($release eq "5.11") ) { > system("/usr/xpg4/bin/du -s -h $Dir | sort -n -r -k 1"); > } else { > system("du -s $Dir | sort -n -r -k 1"); > } > } elsif ($OSname eq "HP-UX") { > system("du -s -k $Dir | sort -n -r -k 1"); > } elsif ($OSname eq "AIX") { > system("du -s -k $Dir | sort -n -r -k 1"); > } else { > system("du -s -h $Dir | sort -n -r -k 1"); > } > >} > > >sub DirectorySizes >{ > my $Dir = $_[0]; > DirUsage($Dir.'/*'); >} > >sub HomeDirectorySizes >{ > my $HomeDir = $_[0]; > print "\n\n------------- Home Directory Sizes ---------------\n\n"; > print "Size Location\n"; > print "(MB)\n"; > DirectorySizes($HomeDir); > print "\n\n------------- Home Directory Sizes ---------------\n\n"; >} > > >sub MailDirectorySizes >{ > my $MailDir = $_[0]; > print "\n\n------------- Mail Directory Sizes ---------------\n\n"; > print "Size Location\n"; > print "(MB)\n"; > DirectorySizes($MailDir); > print "\n\n------------- Mail Directory Sizes ---------------\n\n"; >} > > >sub DiskUsage () >{ > my $Dir = $_[0]; > print "\n\n------------- Directory Sizes ---------------\n\n"; > print "Size Location\n"; > print "(GB)\n"; > > if ($OSname eq "Linux") { > DirUsage("/var/log"); > DirUsage("/usr"); > } elsif ($OSname eq "Darwin") { > DirUsage("/var/log"); > DirUsage("/usr"); > } elsif ($OSname eq "SunOS") { > DirUsage("/var/log"); > DirUsage("/usr"); > DirUsage("/opt"); > } elsif ($OSname eq "HP-UX") { > DirUsage("/var/adm"); > DirUsage("/usr"); > DirUsage("/opt"); > } else { > DirUsage("/var/log"); > DirUsage("/usr"); > DirUsage("/opt"); > } > > print "\n\n------------- Directory Sizes ---------------\n\n"; > >} > >sub DiskSpace () >{ > if ($OSname eq "Linux") { > $df_options = "-h -l -x tmpfs"; > } elsif ($OSname eq "Darwin") { > $df_options = "-h -l"; > } elsif ($OSname eq "SunOS") { > if ( ($release eq "5.10") || ($release eq "5.9") || ($release eq "5.11") ) { > $df_options = "-h -l"; > } else { > $df_options = "-l"; > } > } elsif ($OSname eq "HP-UX") { > $df_options = "-l"; > } elsif ($OSname eq "AIX") { > $df_options = "-P"; > } else { > $df_options = "-l"; > } > > if ( $ENV{'df_options'} ) { > $df_options = $ENV{'df_options'}; > }; > > if ($OSname eq "Linux") { > $disk_cmd = "df $df_options"; > } elsif ($OSname eq "Darwin") { > $disk_cmd = "df $df_options"; > } elsif ($OSname eq "SunOS") { > $disk_cmd = "/usr/xpg4/bin/df $df_options"; > } elsif ($OSname eq "HP-UX") { > $disk_cmd = "bdf $df_options"; > } else { > $disk_cmd = "df $df_options"; > } > > if ( $ENV{'disk_cmd'} ) { > $disk_cmd = $ENV{'disk_cmd'}; > }; > > print "the used command is: " , $disk_cmd , "\n \n" ; > > system($disk_cmd); > > print "\n finished \n"; >} > >sub DiskFull >{ > my $o = `$disk_cmd`; > my @rows = split('\n', $o); > foreach my $row (@rows) > { > my @fields = split(' ', $row); > my $use = $fields[4]; > $use =~ s/%//; > if (($use > $diskfull_threshhold) && ($fields[0] !~ /\/dev\/scd/ )) > { > print "$fields[0] => $fields[4] Used. Warning. Disk Filling up.\n"; > } > } >} > >##################### >#Main > >#Only show disk space "df" by default -mgt >DiskSpace(); > >if ( $show_disk_usage == 1 ) { DiskUsage(); }; #Turn on in zz-disk_space.conf > >if (($Detail > 10) || ($show_home_dir_sizes == 1)) { #set in zz-disk_space.conf -mgt > HomeDirectorySizes($home_dir); >} > >if (($Detail > 10) || ($show_mail_dir_sizes == 1)) { #set in zz-disk_space.conf -mgt > MailDirectorySizes($mail_dir); >} > >if ($diskfull_threshhold > 0) >{ > DiskFull(); >} > ># vi: shiftwidth=3 tabstop=3 syntax=perl et
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 380331
: 261041 |
265181