Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#495 closed task (invalid)

Smartmontools + Intel RAIDcontroller + Powershell

Reported by: MGctl Owned by:
Priority: major Milestone:
Component: all Version: 6.3
Keywords: windows Cc:

Description

Hello,

When I execute smartctl.exe -A /dev/csmi0,1 in Windows CMD i get the right information about my disk behind an Intel RAID Controller.

When I execute smartctl -A /dev/csmi0,1 in Windows Powershell it says, you have provided 2 device names: /dev/csmi0 and 1. How is this possible?

Kind Regards,

Marco

Change History (5)

comment:1 by MGctl, 9 years ago

When I use a space instead of a comma it also says You have provided 2 device names.

When I use an extra space so I get /dev/csmi 0 1 it even says You have provided 3 device names...

comment:2 by Alex Samorukov, 9 years ago

Try to put this in quote. It seems that powershell sends this as 2 parameters.

comment:3 by Christian Franke, 9 years ago

Keywords: windows added; Windows RAID Intel CSMI Powrshell removed
Resolution: invalid
Status: newclosed

This is not a smartctl issue. On Powershell, the command requires quoting because arguments are split at the ','. Prepend Write-Host to a command see the effect:

PS C:\> Write-Host smartctl -A /dev/csmi0,1
smartctl -A /dev/csmi0 1
PS C:\> Write-Host smartctl -A "/dev/csmi0,1"
smartctl -A /dev/csmi0,1

comment:4 by MGctl, 9 years ago

Thanks this worked! I only have one issue left. When i want to execute a powershell script for a HDD without RAID controller, I have this:

#Define the parameters for Zabbix to call
param($arg1,$arg2)

#/dev/sda in Linux = hda in Windows

if ($arg1-eq "/dev/sda") {$arg1 = "hda"}
if ($arg1-eq "/dev/sdb") {$arg1 = "hdb"}

# Execute smartctl and assign the output to a variable

$smartctl = "C:\Zabbix\smartmontools\bin\smartctl.exe -A " + $arg1

This works, but when I change the parameters to an Intel RAID controller:

#Define the parameters for Zabbix to call
param($arg1,$arg2)

#/dev/sda in Linux = hda in Windows

if ($arg1-eq "'/dev/csmi0,1'") {$arg1 = "'/dev/csmi0,1'"}

$smartctl = "C:\Zabbix\smartmontools\bin\smartctl.exe -A " + $arg1

It says ERROR: smartctl requires a devicename as the final command-line argument. /dev/csmi0,1 is the right device so how can he give an error here?

Last edited 9 years ago by MGctl (previous) (diff)

comment:5 by Christian Franke, 9 years ago

Run smartctl --scan to get a list of connected devices.

This ticket system is not a support forum. Please ask support questions on the smartmontools-support mailing list.

Note: See TracTickets for help on using tickets.