I need to write a bash script who's first job is to export a package from an arcsight ESM. afterwards it needs to move the exported archives to a connector server but i haven't gotten to that part yet. my issue is this: as per the arcsight ESM manual, the command for exporting the package is the following:
arcsight package –action export –package “/All Packages/Personal/Mypackage” –f packagebundle.arb –u username –p password –m managername
the command needs to be run from the arcsight
home directory on the ESM server only, else bash doesn't recognize arcsight
as a command. i did that, the command seems to run fine as it does manage to log in to ESM, return says it's exporting the package but then i get
The Flag '' is not recognized
and it stops. it doesn't finish exporting the package as there is no "packagebundle.arb" file in the destination folder after the running the command. so i'd like to ask if anyone has some idea about what this error is and how to fix it. couldn't find much about it until now. ArcSight version is 6.9 and linux version is RHEL 5.5.
I think the problem is that you are quoting with a curly quote, like this: “, instead of a straight quote, like this: ".
Some text editors change straight quotes to curly because they looks better. This does however break shell executables, because it does not recognize curly quotes.
Here is what your command should look like with straight quotes arcsight package –action export –package "/All Packages/Personal/Mypackage" –f packagebundle.arb –u username –p password –m managername
Example: echoing with straight vs curly quotes
Straight quotes:
echo "test"
> test
Qurly quotes:
echo “test“
> “test“
As you can see bash does not interpret “ as a quote.