wok annotate ocsinventory-agent/stuff/Drives.pm.u @ rev 12419

Up: pidgin to 2.10.3.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Apr 21 09:18:59 2012 +0000 (2012-04-21)
parents
children
rev   line source
erjo@3679 1 --- Ocsinventory-Agent-1.0.1.ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm Fri Mar 6 19:02:57 2009
erjo@3679 2 +++ Ocsinventory-Agent-1.0.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm Sun Jul 12 22:29:32 2009
erjo@3679 3 @@ -1,9 +1,11 @@
erjo@3679 4 package Ocsinventory::Agent::Backend::OS::Linux::Drives;
erjo@3679 5 +# Modified bye Erjo <erjo@slitaz.org>
erjo@3679 6 +# Busybox df applet as no -T -P options.
erjo@3679 7
erjo@3679 8 use strict;
erjo@3679 9 sub check {
erjo@3679 10 return unless can_run ("df");
erjo@3679 11 - my $df = `df -TP`;
erjo@3679 12 + my $df = `df -k`;
erjo@3679 13 return 1 if $df =~ /\w+/;
erjo@3679 14 0
erjo@3679 15 }
erjo@3679 16 @@ -19,14 +21,14 @@
erjo@3679 17 my $volumn;
erjo@3679 18
erjo@3679 19
erjo@3679 20 - foreach(`df -TP`) { # TODO retrive error
erjo@3679 21 - if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){
erjo@3679 22 + foreach(`df -k`) { # TODO retrive error
erjo@3679 23 + if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){
erjo@3679 24 $free = sprintf("%i",($4/1024));
erjo@3679 25 - $filesystem = $2;
erjo@3679 26 - $total = sprintf("%i",($3/1024));
erjo@3679 27 - $type = $1;
erjo@3679 28 - $volumn = $5;
erjo@3679 29 -
erjo@3679 30 + $filesystem = $1;
erjo@3679 31 + $total = sprintf("%i",($2/1024));
erjo@3679 32 + $type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;;
erjo@3679 33 + $volumn = $6;
erjo@3679 34 +
erjo@3679 35 # no virtual FS
erjo@3679 36 next if ($type =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/);
erjo@3679 37 next if ($filesystem =~ /^(tmpfs)$/);
erjo@3679 38 @@ -36,8 +38,7 @@
erjo@3679 39 FILESYSTEM => $filesystem,
erjo@3679 40 TOTAL => $total,
erjo@3679 41 TYPE => $type,
erjo@3679 42 - VOLUMN =>
erjo@3679 43 - $volumn
erjo@3679 44 + VOLUMN => $volumn
erjo@3679 45 })
erjo@3679 46 }
erjo@3679 47 }