Leser: 1
|< 1 2 3 >| | 25 Einträge, 3 Seiten |
Quotexadmp02> df
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 576.00 542.78 6% 3881 4% /
/dev/hd2 2368.00 480.38 80% 39109 26% /usr
/dev/hd9var 768.00 339.07 56% 1478 2% /var
/dev/hd3 1024.00 1022.37 1% 101 1% /tmp
/dev/hd1 256.00 47.15 82% 6539 36% /home
/proc - - - - - /proc
/dev/hd10opt 640.00 139.88 79% 13216 29% /opt
/dev/lvlocal01 896.00 269.61 70% 33708 35% /usr/local
/dev/lvaudit01 64.00 62.14 3% 14 1% /audit
/dev/lvtftpboot 448.00 381.43 15% 19 1% /tftpboot
/dev/lvsysback 126656.00 24803.56 81% 601 1% /sysback
/dev/lvnim 50560.00 19208.38 63% 54958 2% /export/nim
/dev/lvswdcustomize 15744.00 4461.27 72% 5389 1% /swd_customize
/dev/lvorasw 12160.00 7034.91 43% 9153 1% /ora/soft
QuoteFilesystem Used%
/dev/hd4 4%
/dev/hd2 26%
/dev/hd9var 2%
/dev/hd3 1%
/dev/hd1 36%
/dev/hd10opt 29%
dev/lvlocal01 35%
/dev/lvaudit01 1%
/dev/lvtftpboot 1%
/dev/lvsysback 1%
/dev/lvnim 2%
/dev/lvswdcustomize 1%
/dev/lvorasw 1%
1
2
3
4
5
6
7
@result = `df`;
for my $line ( @result ) {
# Array Index gemaess df-Ausgaben bestimmen
my ( $what, $percent ) = ( split(/\s+/, $line ) )[0,3];
print "$what $percent", $/;
}
1
2
3
4
5
6
7
8
use strict;
use warnings;
use Sys::Statistics::Linux;
my $lxs = Sys::Statistics::Linux->new(DiskUsage => 1);
my $stat = $lxs->get->{DiskUsage};
print sprintf('%-40s ', $_), $stat->{$_}->{usageper}, "%\n"
foreach sort keys %$stat;
Quoteaber die regex oder split passt nicht mehr, wenn der diskname so lang ist, dass die diskgroessen in die nächste zeile geschrieben werden etc.
Quotekürzer ist nicht immer gleich besser
1
2
3
4
for my $line ( qx|df| ) {
my ( $disk, $usage ) = (split /\s+/, $line)[0,4];
print "$disk $usage\n";
}
1
2
3
4
5
6
7
#> df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/bloonix-root
10321208 2977312 6819608 31% /
/dev/mapper/bloonix-home
41284928 30074272 9113504 77% /home
/dev/sda2 241113 16707 211956 8% /boot
1
2
3
4
5
6
7
#> df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/bloonix-root
10321208 2977312 6819608 31% /
/dev/mapper/bloonix-home
41284928 30074272 9113504 77% /home
/dev/sda2 241113 16707 211956 8% /boot
|< 1 2 3 >| | 25 Einträge, 3 Seiten |