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]
# 1
Greetings Emmanuel,I'm having exactly the same problem that you have reported with es-cli in SUNMC 3.6. I have tried all manner of permissions and ownerships on the batch files involved without success. Did you find a solution to the problem ?Many thanksTony
carteran at 2007-7-7 1:00:57 > top of Java-index,Administration Tools,Sun Management Center...
# 2

I had problems too but solved it.

when using a login file the permissions have to be -r-- for the user mentioned in the login file.

the batchfile itself seem not to care for permission settings.

the correct syntax for es-cli is:

/opt/SUNWsymon/sbin/es-cli i=INPUTFILE b=BATCHFILE

Hope this helps!

Quiksilver at 2007-7-7 1:00:57 > top of Java-index,Administration Tools,Sun Management Center...
# 3

Thanks fo rhte reply.

I tried permissions changes as recommended with no luck. Here's some more details:

cli_start.txt

serverHost=oranc1

a=phoenix:1161

user=sunmcadm

password=sun;123

o=/usr/local/rbin/SunmcScripts/out/cli_out.txt

permissions on files

-rwxrwxr--1 sunmcadm esadm 98 Jan 16 14:30 cli_batch.txt

-r--1 sunmcadm esadm112 Jan 16 14:40 cli_start.txt

drwxrwxr--2 rootesadm512 Jan 16 14:28 out

Command output

/usr/local/rbin/SunmcScripts

root@oranc1# /opt/SUNWsymon/sbin/es-cli i=/usr/local/rbin/SunmcScripts/cli_start.txt b=/usr/local/rbin/SunmcScripts/cli_batch.txt

The file /usr/local/rbin/SunmcScripts/cli_start.txt is not owned by the user, or, not read-only. Aborting...

Exiting...

Any help much appreciated.

Tony

carteran at 2007-7-7 1:00:57 > top of Java-index,Administration Tools,Sun Management Center...
# 4
is sunmcadm doing the es-cli command or root?if it's root, it should be sunmcadm...
Quiksilver at 2007-7-7 1:00:57 > top of Java-index,Administration Tools,Sun Management Center...
# 5

I was having the same problem with my input file. Thanks to the information in the thread I got the permissions correct and I no longer get the error the original poster complains of but I now I get the error below.

"You do not have permission to use the login information from the input file"

wks9326 at 2007-7-7 1:00:57 > top of Java-index,Administration Tools,Sun Management Center...
# 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

balkar at 2007-7-7 1:00:57 > top of Java-index,Administration Tools,Sun Management Center...