# Copyright (c) 2006 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: Disk.bunit,v 1.2 2006/05/11 16:45:27 nagler Exp $ config({ 'Bivio::Util::Disk' => { check_use_capacity => [ [qr{/a} => 80], [qr{.} => 90], ], check_use_iuse => [ [qr{/b} => 95], [qr{.} => 90], ], }, }); [ class() => [ check_use => [ [{ 'df -k' => <<'EOF', /dev/1 x x x 81% /a /dev/2 x x x 79% /aa /dev/3 x x x 91% /c EOF 'df -i' => <<'EOF', /dev/4 x x x 96% /bb /dev/5 x x x 79% /cc EOF }] => <<'EOF', PARTITION FULL: /a (/dev/1) capacity at 81% (max 80%) PARTITION FULL: /c (/dev/3) capacity at 91% (max 90%) PARTITION FULL: /bb (/dev/4) iuse at 96% (max 95%) EOF ], check_raid => [ [{ '/proc/mdstat' => <<'EOF', Personalities : [raid1] read_ahead 1024 sectors md1 : active raid1 sdb1[1] sda1[0] 104320 blocks [2/2] [UU] md0 : active raid1 sdb2[1] sda2[0] 2096384 blocks [1/2] [U_] md2 : active raid1 sdb3[1] sda3[0] 33358848 blocks [2/2] [UU] unused devices: EOF '/proc/rd/c0/current_status' => <<'EOF', ***** DAC960 RAID Driver Version 2.4.11 of 11 October 2001 ***** Copyright 1998-2001 by Leonard N. Zubkoff Configuring Mylex DAC1164P PCI RAID Controller Firmware Version: 5.08-0-87, Channels: 2, Memory Size: 32MB PCI Bus: 3, Device: 8, Function: 0, I/O Address: Unassigned PCI Address: 0xF9FFFC00 mapped at 0xE08EDC00, IRQ Channel: 5 Controller Queue Depth: 128, Maximum Blocks per Command: 128 Driver Queue Depth: 127, Scatter/Gather Limit: 33 of 33 Segments Stripe Size: 64KB, Segment Size: 8KB, BIOS Geometry: 128/32 SAF-TE Enclosure Management Enabled Physical Devices: 0:0 Vendor: SEAGATE Model: ST318203LC Revision: 0001 Serial Number: LRE278100000103716RV Disk Status: Online, 35565568 blocks 0:1 Vendor: SEAGATE Model: ST318203LC Revision: 0001 Serial Number: LRE21233000010371EAB Disk Status: Online, 35565568 blocks 0:2 Vendor: SEAGATE Model: ST318203LC Revision: 0001 Serial Number: LRE25585000010371HUE Disk Status: Online, 35565568 blocks 0:3 Vendor: SEAGATE Model: ST318203LC Revision: 0001 Serial Number: LRE17138000010371ECD Disk Status: Online, 35565568 blocks 0:4 Vendor: IBM Model: DMVS18D Revision: 0100 Serial Number: F80241587A Disk Status: Standby, 35843670 blocks 0:7 Vendor: MYLEX Model: DAC1164P Revision: 0508 Serial Number: 0:15 Vendor: Dell Model: 12 BAY U2W CU Revision: 0205 1:7 Vendor: MYLEX Model: DAC1164P Revision: 0508 Serial Number: 1:8 Vendor: FUJITSU Model: MAS3184NC Revision: 5B08 Serial Number: A2M7P48003JE Disk Status: Online, 35565568 blocks 1:9 Vendor: FUJITSU Model: MAS3184NC Revision: 5B08 Serial Number: A2M7P48003HV Disk Status: Online, 35565568 blocks 1:10 Vendor: IBM Model: DMVS18D Revision: 0100 Serial Number: F80245F87A Disk Status: Online, 35842048 blocks 1:11 Vendor: IBM Model: DMVS18D Revision: 0100 Serial Number: F8025D0F7A Disk Status: Online, 35565568 blocks 1:15 Vendor: Dell Model: 12 BAY U2W CU Revision: 0205 Logical Drives: /dev/rd/c0d0: RAID-5, Online, 248958976 blocks, Write Thru /dev/rd/c0d1: RAID-5, Critical, 248958976 blocks, Write Thru No Rebuild or Consistency Check in Progress EOF '/usr/sbin/afacli' => <<'EOF', [?1048h[?1047h[?7h[?1h=-------------------------------------------------------------------------------- DELL PowerEdge Expandable RAID Controller 2 Command Line Interface Copyright 1998-2001 Adaptec, Inc. All rights reserved -------------------------------------------------------------------------------- FASTCMD> open afa0 Executing: open "afa0" AFA0> disk list Executing: disk list B:ID:L Device Type Blocks Bytes/Block UsageShared Rate ------ -------------- --------- ----------- ---------------- ------ ---- 0:00:0 Disk 71132959 512 Initialized NO 160 0:01:0 Disk 71132959 512 Unconfigured NO 160 AFA0> task list Executing: task list Controller Tasks TaskId Function Done% Container State Specific1 Specific2 ------ -------- ------- --------- ----- --------- --------- 100 Rebuild 20.9% 0 RUN 00000000 00000000 78 78 AFA0> exit78 78 Executing: exit [?1047l[?1048l [?1l>AFA0> exit [?1047l[?1048l [?1l> EOF }] => <<'EOF', DRIVE FAILURE: md0 : active raid1 sdb2[1] sda2[0] 2096384 blocks [1/2] [U_] DRIVE FAILURE: /dev/rd/c0d1: RAID-5, Critical, 248958976 blocks, Write Thru DRIVE FAILURE: 0:01:0 Disk 71132959 512 Unconfigured NO 160 DRIVE FAILURE: 100 Rebuild 20.9% 0 RUN 00000000 00000000 EOF ], ], ];