On 11/8/22 15:04, ToddAndMargo via perl6-users wrote:
On 11/7/22 17:50, ToddAndMargo via perl6-users wrote:
Hi All,

I am scratching my head trying to figure out how to
gather information fro a RAID controller from
Raku for Windows.

I need to issue the following commands to the controller's
configuration utility:

     hptraidconf
     query array
     exit

I typically will creating a temporary batch/cmd file
and then executing it.

In Linux bash programming, there is a way, but I
know of no way to do it with Windows.

Many thanks,
-T

Hi All,

JJ over on the batch newgroup help me out.
Basically, you create a batch file that echos
the commands you want and then run the batch
file.

I wrote this up in my Batch keepers:

Thank you JJ!

I wrote this up as a Keeper:


How to run interactive programs from batch

echo inside (), then pipe to your command
Note: this presumes that your command will take a pipe



Example

<DiskPart.ListVol.bat>

@echo off
(
   echo List volume
   echo exit
) | C:\Windows\System32\diskpart.exe

</DiskPart.ListVol.bat>


K:\Windows\NtUtil>DiskPart.ListVol.bat

Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: KVM-W7

DISKPART>
  Volume ###  Ltr  Label        Fs     Type        Size     Status Info   ----------  ---  -----------  -----  ----------  -------  --------- --------
   Volume 0     D                       CD-ROM          0 B  No Media
   Volume 1     E   virtio-win-  CDFS   CD-ROM       301 MB  Healthy
   Volume 2         System Rese  NTFS   Partition    100 MB  Healthy System
  Volume 3     C   DRIVE_C      NTFS   Partition     39 GB  Healthy Boot
   Volume 4     H   BACKUP       NTFS   Partition     38 MB  Healthy
   Volume 5     M   KVM-W7-Back  NTFS   Partition   2014 MB  Healthy

DISKPART>
Leaving DiskPart...

Unfortunately my command won't take pipes too well, but
they have a way off accepting the command on the command
line.  So I am still in business.

When I get the RAID 1 array configure and running,
I am going to check it every hour and pop up
an obnoxious windows that tells them to call
I.T. is the raid array is compromised.  (I
have had users go through two drives and a hot
spare whilst IGNORING the Intel RST status icon
in the status bar.  My warnings/pleas go in
one ear and our the other.)




Any command in cli can be implemented by prefixing it with
     "hptraidconf -u RAID -p hpt"

For example: hptraidconf -u RAID -p hpt query devices



C:\NtUtil>"C:\Program Files (x86)\HighPoint Technologies, Inc\HighPoint RAID Management\Service\hptraidconf.exe" -u RAID -p hpt query devices

ID      Capacity    MaxFree     Flag    Status    ModelNumber
------------------------------------------------------------------------------
1/E1/1  1000.20     0           SINGLE  LEGACY    Samsung SSD 980 1TB
1/E1/2  1000.20     0           SINGLE  LEGACY    Samsung SSD 980 1TB
------------------------------------------------------------------------------



Disk Status is 1 of 4 possible states:

• NORMAL: The disk's status is normal.

• DISABLED: The disk cannot be used. (May be related to disk failure or removal)

• RAID: The disk is a member of a RAID array.

• SPARE: The disk has been set as a spare disk



I am looking for "Flag = RAID" and "Status = NORMAL"

Reply via email to