[Bug 404648] New: [Novell:NTS/hostinfo] Add current free disk space
https://bugzilla.novell.com/show_bug.cgi?id=404648 Summary: [Novell:NTS/hostinfo] Add current free disk space Product: openSUSE.org Version: unspecified Platform: Other OS/Version: Other Status: NEW Severity: Enhancement Priority: P5 - None Component: 3rd party software AssignedTo: jrecord@novell.com ReportedBy: jrecord@novell.com QAContact: opensuse-communityscreening@forge.provo.novell.com Found By: Development The disk size is displayed, add the free disk space. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=404648 Jason Record <jrecord@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=404648 User jrecord@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=404648#c1 --- Comment #1 from Jason Record <jrecord@novell.com> 2008-07-09 12:54:48 MDT --- hostinfo uses df to determine the amount of free space on a disk, and is displayed like this: Hard Disk: /dev/sda 120/106 GB Hard Disk: /dev/sdb 160 GB If filesystems are not mounted, the free space cannot be determined using df. hostinfo simply counts of the free space reported by df on the known block devices. The block devices reported by /proc/partitions must be present in the df output for the free space to be accurate. It is limited to raw devices, and volume managers and udev are not supported. The free space is not necessarily accurate, but gives a general impression. It may error on the side of reporting less free space than actually exists. You can use the -f to exclude free space information. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=404648 User jrecord@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=404648#c2 Jason Record <jrecord@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #2 from Jason Record <jrecord@novell.com> 2008-07-09 12:56:08 MDT --- Fix checked in. Index: scripts/hostinfo =================================================================== --- scripts/hostinfo (revision 29) +++ scripts/hostinfo (revision 30) @@ -1,5 +1,5 @@ #!/bin/bash -SVER=0.51-2 +SVER=0.51-4 ############################################################################## # hostinfo - Displays brief system information # @@ -23,6 +23,7 @@ # ############################################################################## +OPT_DISPLAY_DISK_FREE=1 PAD=20 DEFAULT_DELAY=30 DELAY=0 @@ -96,12 +97,26 @@ } printdisks() { - DISK_SIZES=$(egrep '[s,h,xv,c][0-9]?d[a-z,0-9]$' /proc/partitions | awk '{printf "%s %.1f %s\n", "/dev/"$4, $3*1024/1000^3, "GB"}') + DISK_SIZES=$(egrep '[s,h,xv,c][0-9]?d[a-z,0-9]$' /proc/partitions | awk '{printf "%s %u %s\n", "/dev/"$4, $3*1024/1000^3, "GB"}') if [ -z "$DISK_SIZES" ]; then DISK_SIZES=Unknown fi - echo "$DISK_SIZES" | while read THIS_DISK + echo "$DISK_SIZES" | while read DISK_INFO do + DEV_CHECK=$(echo $DISK_INFO | awk '{print $1}') + DISK_FREE=0 + if (( OPT_DISPLAY_DISK_FREE )); then + for DISK_ADD in $(df | grep ^${DEV_CHECK} | awk '{print $4}') + do + DISK_FREE=$(( DISK_FREE + DISK_ADD )) + done + fi + if (( DISK_FREE )); then + DISK_INFO="$DISK_INFO $DISK_FREE" + THIS_DISK=$(echo $DISK_INFO | awk '{printf "%s %u/%u %s\n", $1, $2, $4*1024/1000^3, $3}') + else + THIS_DISK=$DISK_INFO + fi printf "$ROW_OUT" "Hard Disk:" "$THIS_DISK" done } @@ -132,7 +147,7 @@ get_vt_vars ALL_ARGS="$@" -while getopts :wtT: TMPOPT +while getopts :wtT:f TMPOPT do case $TMPOPT in \:) case $OPTARG in @@ -150,6 +165,7 @@ w) get_html_vars ;; T) DELAY=$OPTARG ;; t) DELAY=$DEFAULT_DELAY ;; + f) OPT_DISPLAY_DISK_FREE=0 ;; esac done -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=404648 User jrecord@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=404648#c3 --- Comment #3 from Jason Record <jrecord@novell.com> 2008-07-09 14:39:07 MDT --- -f now displays free disk space, not excludes it. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=404648 User jrecord@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=404648#c4 Jason Record <jrecord@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #4 from Jason Record <jrecord@novell.com> 2008-08-01 10:14:41 MDT --- Closed. Released to OBS https://build.opensuse.org/package/show?package=hostinfo&project=Novell%3ANTS -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com