Re: Calling a custom attribute as a script agrument (command option) (918 Views)
Reply
Occasional Contributor
Kevin S. Young
Posts: 7
Registered: ‎04-09-2009
Message 1 of 7 (922 Views)

Calling a custom attribute as a script agrument (command option)

[ Edited ]

I have a software policy that has a shell script as a policy item.

In the software policy I have a custom attribute defined called patchdate with a value of 20081129

I want to use that custom attribute in the command options of the script, but doesn’t seem to be working.

Is this a bug or am I doing something wrong?
I am passing @patchdate@ in the argument

 

 

P.S. This thread has been moveed from Data Center Automation Support and News to Server Automation Support and News Forum - HP Forums Moderato

Occasional Visitor
Tony Furlani
Posts: 1
Registered: ‎05-18-2009
Message 2 of 7 (918 Views)

Re: Calling a custom attribute as a script agrument (command option)

Hello,
I was wondering have you come up with a solution to this problem? I am having the same issues using the custom attribute.

Thanks,
Tony
Occasional Advisor
Steven D'aurora
Posts: 7
Registered: ‎08-24-2009
Message 3 of 7 (918 Views)

Re: Calling a custom attribute as a script agrument (command option)

Hi,

I think custom attribute macro substitution is prefixed with "@." closed with "@"

If that's the case you're really close.

--Steve D.
Regular Advisor
Dan Robinson_4
Posts: 143
Registered: ‎09-05-2003
Message 4 of 7 (918 Views)

Re: Calling a custom attribute as a script agrument (command option)

Anyone have any documentation on this feature? I wanted to use something similar but our in-house SA team didn't think it was possible.

If its documented in the online web based help, include the url and just mask your webserver name so I can recreate it here.
Occasional Visitor
ChrisReiter
Posts: 1
Registered: ‎03-15-2010
Message 5 of 7 (918 Views)

Re: Calling a custom attribute as a script agrument (command option)

Have you looked into using the Opsware Agent Tools scripts? If you apply the "Opsware Python API Access" software policy to the server you will have an agent_tools directory in the agent install path. You could call the get_cust_attr script inside of your script to retrieve the patchdate custom attribute. This is documented in the Platform Developers Guide.
Occasional Contributor
Kevin S. Young
Posts: 7
Registered: ‎04-09-2009
Message 6 of 7 (918 Views)

Re: Calling a custom attribute as a script agrument (command option)

That is how i am currently accomplishing it, however i would like to add this as a command line option when executing a script from the HPSA GUI.
Occasional Advisor
Joe Ruffolo1
Posts: 9
Registered: ‎08-30-2010
Message 7 of 7 (918 Views)

Re: Calling a custom attribute as a script agrument (command option)

I thought that custom attributes cannot be searched/queried based on value - you have to use Custom Fields to do that - in fact the date is supported as a data format for Custom Fields - the limitation is, custom fields apply only to servers and device groups.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.