From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Apr 30 01:05:25 2005 Return-Path: Delivered-To: freebsd-ports-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2DAF16A4CE for ; Sat, 30 Apr 2005 01:05:25 +0000 (GMT) Received: from hotmail.com (bay103-dav15.bay103.hotmail.com [65.54.174.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7CBD43D58 for ; Sat, 30 Apr 2005 01:05:25 +0000 (GMT) (envelope-from tssajo@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 29 Apr 2005 18:05:25 -0700 Message-ID: Received: from 65.54.174.210 by BAY103-DAV15.phx.gbl with DAV; Sat, 30 Apr 2005 01:05:25 +0000 X-Originating-IP: [65.54.174.210] X-Originating-Email: [tssajo@hotmail.com] X-Sender: tssajo@hotmail.com From: "Zoltan Frombach" To: Date: Fri, 29 Apr 2005 18:05:24 -0700 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0021_01C54CE6.045DC390" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-OriginalArrivalTime: 30 Apr 2005 01:05:25.0768 (UTC) FILETIME=[B13B6880:01C54D20] X-Mailman-Approved-At: Sat, 30 Apr 2005 13:25:30 +0000 cc: vinc@freebsd-fr.org Subject: please add these patches to cacti port X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2005 01:05:26 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0021_01C54CE6.045DC390 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Hello, I attached two patches for the FreeBSD cacti port. This is something that annoyed me for a long time, and I've decided to do something about it... In Cacti, if you use the provided "diskfree.pl" and/or "diskfree.sh" scripts then all hard drive sizes are reported DOUBLE (x2) in Cacti (under FreeBSD only). This is a documented problem, see http://forums.cacti.net/viewtopic.php?t=2420&highlight=disk+space+wrong The scripts supplied in Cacti that use the df system command must be changed. Cacti was originally developed for Linux (I guess), and under Linux the following df command is producing the expected output: df --block-size=1024 However, this DOES NOT work under FreeBSD. You must change it to: df -k This is exactly what the attached patches do. Therefore solving the disk space reporting problem outlined on the above mentioned URL. Please include these patches in the FreeBSD port of Cacti. Thanks, Zoltan Frombach ------=_NextPart_000_0021_01C54CE6.045DC390 Content-Type: application/octet-stream; name="patch-scripts-diskfree.pl" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patch-scripts-diskfree.pl" --- scripts/diskfree.pl.orig Fri Apr 29 17:32:01 2005 +++ scripts/diskfree.pl Wed Mar 23 02:19:37 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl =20 -$ret =3D `df --block-size=3D1024 -P $ARGV[0] | grep -v Filesystem`; +$ret =3D `df -k $ARGV[0] | grep -v Filesystem`; $ret =3D~ s/($ARGV[0])(.* )(.*[0-9])(.* )(.*[0-9])(.* )(.*[0-9])(.* = )(.*[0-9])%(.* )//; =20 print "megabytes:$7 percent:$9"; ------=_NextPart_000_0021_01C54CE6.045DC390 Content-Type: application/octet-stream; name="patch-scripts-diskfree.sh" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patch-scripts-diskfree.sh" --- scripts/diskfree.sh.orig Fri Apr 29 17:32:01 2005 +++ scripts/diskfree.sh Wed Mar 23 02:19:47 2005 @@ -1,2 +1,2 @@ #!/bin/sh -df --block-size=3D1024 -P $1 | perl -ape '$F[4]=3D~tr/%//d;}{print = "megabytes:$F[3] percent:$F[4]"'; +df -k $1 | perl -ape '$F[4]=3D~tr/%//d;}{print "megabytes:$F[3] = percent:$F[4]"'; ------=_NextPart_000_0021_01C54CE6.045DC390--