Ad Widget

Collapse

system.run, please assist with string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anth0ny
    Member
    • Nov 2009
    • 85

    #1

    system.run, please assist with string

    i try to get capacity of windows mount point S:\ContentVideo\work\VIDEO\Out\MPEG

    original working string:

    Code:
    powershell -NoProfile -NoLogo -Command gwmi win32_volume^|where-object {$_.name -match “S:\\ContentVideo\\work\\VIDEO\\Out\\MPEG”}^| % { '{0,10}' -f $_.Capacity}
    this return Capacity of Mount point.

    my zabbix agent string:

    Code:
    system.run["powershell.exe -NoProfile -NoLogo -Command gwmi win32_volume^|where-object {$_.name -match \"S:\\ContentVideo\\work\\VIDEO\\Out\\MPEG\"}^| % {'{0,10}' -f $_.Capacity}"]
    zabbix mark my item as Unsupported =(

    can anybody help with characters escaping, please?
    Last edited by Anth0ny; 28-10-2011, 16:52.
Working...