Hi
write first of all there is an error with the $output statement above , its got
1 extra sed, it should look like the following
Code:
$output =`\/usr/local/zenoss/common/bin/winexe -U '$username'%'$password'
//$hostname 'cmd /c dir /L /-C "$counter"' | grep -i "$datapoint" | sed
's/'"$datapoint"'/ /g' | sed 's/^.\{17\}//g' | sed 's/^[ \t]*//;s/[ \t]*$//'`;
Now i dont hink the problem is passing the variables into the perl script. The
problem seems to be with the piping to the second sed command so basically if i
pipe the following to a file the output is as expected
Code:
$output =`\/usr/local/zenoss/common/bin/winexe -U '$username'%'$password'
//$hostname 'cmd /c dir /L /-C "$counter"' | grep -i "$datapoint" | sed
's/'"$datapoint"'/ /g' > 1 `;
# | sed 's/^.\{17\}//g' | sed 's/^[ \t]*//;s/[ \t]*$//'`;
outputs
10/10/2008 00:20 3431088128
where the full statement outputs nothing
now it I run the output statement from the cli
Code:
[EMAIL PROTECTED] zenoss]$ winexe -U 'username'%'password' //server 'cmd /c dir
/L /-C drive:\path\filename' | grep -i "filename" | sed 's/'"filename"'/ /g' |
sed 's/^.\{17\}//g' | sed 's/^[ \t]*//;s/[ \t]*$//'
The following is output
3431088128
Which is what Im looking for.
Thanks for you help so far
-------------------- m2f --------------------
Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=26183#26183
-------------------- m2f --------------------
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users