Ad Widget

Collapse

findstr megacli

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FrankGNL
    Junior Member
    • Jul 2012
    • 2

    #1

    findstr megacli

    Hi All

    I want to monitor the temperature of the disks via zabbix with megacli.
    I'm using windows hyperv server 2008 R2

    But i got an problem with findstr
    is the the command
    MegaCli -PDList -aALL | find "Drive Temperature"

    and this is the output
    Drive Temperature :36C (96.80 F)

    But what i want as output is
    36

    Is this possible with findstr, or does anybody has another idea to achieve this


    Thanks a lot
  • Kryol
    Member
    • Feb 2011
    • 70

    #2
    You can use PowerShell.
    With PowerShell you need something like following
    Code:
    MegaCli -PDList -aALL | find "Drive Temperature" | %{$_.split(':')[1]} | %{$_.split('C')[0]} | %{$_ -replace " ",""}

    Comment

    Working...