es-cli complains about my parameter file
Hello,
With SunMC 3.5, I wrote a couple of batches for es-cli, using a parameter file. For example:
es-cli -b export.cli i=parameters.cli
Worked fine.
I got a new server, installed SunMC 3.6.1, configured it exactly like my 3.5 system, and tried my batches. es-cli now complains about the parameter file:
The file parameters.cli is not owned by the user, or, not read-only. Aborting...
Exiting...
I tried to chmod/chown the file in many ways (chown to current user, to user in the parameter file), no luck.
Any idea?
Thanks a lot.
Emmanuel.
[607 byte] By [
EMRP] at [2007-11-26 9:50:17]

# 6
I can see what the confusion is all about, in fact after trying out a few examples, I am also now confused:
When using batch files, the following syntax seems to work when running as root:
/opt/SUNWsymon/sbin/es-cli -b batchFile.txt -i propertiesFile.txt
However, this requires you to use the root user for login which most companies do not want to obvious do. So, to run as other users you must:
01. create a Sun MC user,
02. enter the user into the esusers file, plus Sun MC groups - /etc/group
03. Run the es-cli as the new user, using the "=" sign syntax, i.e.
/opt/SUNWsymon/sbin/es-cli b=batchFile.txt i=propertiesFile.txt
04. Make sure permissions on batchFile are 400 and the file is owned by the new user.
Helpful Debuging commands:
# sh -x es-cli
Turn on "Info" channel in the properties file.
i.e.
#log_level=ERROR
log_level=INFO
Also, set fg=on before running any other cli commands:
set fg=on
Some examples of error messages using different syntax:
root@halogen cli_scripts # /opt/SUNWsymon/sbin/es-cli b=/tmp/cli.commands i=/tmp/cli.properties
The file /tmp/cli.properties is not owned by the user, or, not read-only. Aborting...
Exiting...
root@halogen cli_scripts # chown root /tmp/cli*
root@halogen cli_scripts # /opt/SUNWsymon/sbin/es-cli -b /tmp/cli.commands -i /tmp/cli.properties
Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
HERE IT JUST HANGS as my properties file has a different user and I am running as root.
So, I change the user to root in the properties file:
root@halogen cli_scripts # /opt/SUNWsymon/sbin/es-cli -b /tmp/cli.commands -i /tmp/cli.properties
Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
setCurrentDomain: == setCurrentDomain: Results 1/1 ===============================================
State=Success
Message=Current domain is set.
=============================================================================== =
It works, so now I try the other syntax, with = sign:
root@halogen cli_scripts # /opt/SUNWsymon/sbin/es-cli b=/tmp/cli.commands i=/tmp/cli.properties
Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Login is successful.
setCurrentDomain: == setCurrentDomain: Results 1/1 ===============================================
State=Success
Message=Current domain is set.
===============================================
It also works.
Now change from root to another Sun MC user and run the script by becoming that user, change ownership on batch and properties files too.
bash-3.00$ id
uid=10115(eventact) gid=1(other)
bash-3.00$ /opt/SUNWsymon/sbin/es-cli b=/tmp/cli.commands i=/tmp/cli.properties
Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Login is successful.
setCurrentDomain: == setCurrentDomain: Results 1/1 ===============================================
State=Success
Message=Current domain is set.
=============================================================================== =
It works.
Now change syntax without the "=" sign:
bash-3.00$ /opt/SUNWsymon/sbin/es-cli -b /tmp/cli.commands -i /tmp/cli.properties
Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
NOW IT JUST HANGS... actually it will eventually timeout and say:
Error in the backend Process, please try again: Not owner
The lesson I learned is to be sure to use the "=" sign syntax. *** Note: The CLI documentation does not mention this syntax, it is undocumented.
Common Error messages if any of the above are incorrect:
The file /tmp/propertiesFile is not owned by the user, or, not read-only. Aborting...
Exiting...
I figured I would document this for the public, instead of our internal Sun MC DB, hope its useful :)
Bobby
Halcyon Monitoring Solutions, Inc.
http://www.HalcyonInc.com