Absent Member.. Absent Member..
Absent Member..
1208 views

Agent tools and localized python scripts on managed server

Jump to solution

Hi,

I was wondering if there is a way to attach and remediate a client system (managed system) from the client command line using either the Agent Tools or by running a local python command/script.  On the client, I see there are a number of pyc files (along with shell and bat files) under /opt/opsware/agent/pylibs on my managed linux server.  In that directory is a pyc called "attach_software_policy.pyc", which is what I inquiring about. 

The use case is fully automating a server deployment from a VMware template.  After the template is deployed, we automated the agent install (with a 'firstboot' script), and would now like to perform initial remediation for a software policy.

 Thanks in advance for any guidance.

Bryan
0 Likes
1 Solution

Accepted Solutions
Absent Member.. Absent Member..
Absent Member..
# ./opsware-agent-60.0.59410.0-linux-6SERVER --help |more
Copyright (c) 2002-2013 Hewlett-Packard
HP Server Automation Agent Installer

Usage: installer [short options] [long options]

short options:

    -r  Reset agent configuration file to default settings.
    -f  Force agent installation and ignore environment check failures.
    -h  This help.
    -t  Set system time from HP Server Automation core.

long options:

    --resetconf         (same as -r)

    --loglevel <level>  Log level mask. (level: trace, info, warning, error)

    --logfile <path>    Path to installer logfile.

    --remediate         Perform a remediate of Software Policies after install.

    --software_policy <id>  Attach device to a software policy.

    --rpmbin <path>     Path to rpm binary.

    --settime           (same as -t)

    --workdir <path>    Path to installer temporary working directory.

    --opsw_gw_addr      Opsware Gateway host1:port1 address. If this is NOT specified, you MUST specify --no_opsw_gw.

    --no_opsw_gw        Indicate that no Opsware gateway is necessary.

    --del_opsw_gw_addr_list
        Delete Opsware Gateway address list.

    --spin_host         Spin hostname or IP (you must include --no_opsw_gw with this option).

    --force_full_hw_reg Force full hardware registration (default is minimal).

    --force_virt_reg    Force full virtualization registration (default is no registration).


    --force_sw_reg      Force software registration (default is no sw registration).

    --force_new_device  Force creation of new device record.

    --no_check_reachability
        Suppress reachability check (default is to perform check
        during fresh installs, and not to perform check during
        upgrades).

    --no_anonymous_ssl  Disable anonymous SSL. Applies to dormant agent only.
        If specified, the dormant agent will require clients that
        connect to its web-interface have a valid certificate

    --reboot            Reboot at completion of successful install if warranted.

    --coreinstall       Install init scripts in proper location for core server.

    --auth_path         Complete path to the file which contains the trusted authorities in PEM format.

    --fingerprint       Fingerprint of the peer's certificate.

    --no_start_agent    Do NOT start the agent after installation.

    --customer_id <id>  Assign device to a customer (requires --username option).

    --username <username>  HP SA username (used only with --customer_id option).

    --password <password>  HP SA password (used only with --customer_id and --username options).

    --opsw_src_addr <IP_address>   The preferred local IP address that will be used as source when connecting to the gateway.

In your run_once to install the HPSA agent after the VM template is started, try adding these options:

    --remediate         Perform a remediate of Software Policies after install.

    --software_policy <id>  Attach device to a software policy.

 

--Lars

 

View solution in original post

7 Replies
Vice Admiral Vice Admiral
Vice Admiral

Hi, If you want to register software and hardware while installing the agent, you can use --force_full_hw_reg and for software use --force_sw_reg.

You can refer server automation user guide for more installer options.

 

0 Likes
Absent Member.. Absent Member..
Absent Member..

Thanks for the reply - I've got the registration piece covered.  What I was wondering is if there was a way to attach and remediate a software policy from the managed server.

Bryan
0 Likes
Vice Admiral Vice Admiral
Vice Admiral
Hi

As for as I know --force-sw-reg is running from managed server only. Once you start the installation of SA agent on managed server, it extracts all the scripts files in managed server and it starts to register to SA CORE. I am not sure you know this and if you know please ignore.
0 Likes
Absent Member.. Absent Member..
Absent Member..
# ./opsware-agent-60.0.59410.0-linux-6SERVER --help |more
Copyright (c) 2002-2013 Hewlett-Packard
HP Server Automation Agent Installer

Usage: installer [short options] [long options]

short options:

    -r  Reset agent configuration file to default settings.
    -f  Force agent installation and ignore environment check failures.
    -h  This help.
    -t  Set system time from HP Server Automation core.

long options:

    --resetconf         (same as -r)

    --loglevel <level>  Log level mask. (level: trace, info, warning, error)

    --logfile <path>    Path to installer logfile.

    --remediate         Perform a remediate of Software Policies after install.

    --software_policy <id>  Attach device to a software policy.

    --rpmbin <path>     Path to rpm binary.

    --settime           (same as -t)

    --workdir <path>    Path to installer temporary working directory.

    --opsw_gw_addr      Opsware Gateway host1:port1 address. If this is NOT specified, you MUST specify --no_opsw_gw.

    --no_opsw_gw        Indicate that no Opsware gateway is necessary.

    --del_opsw_gw_addr_list
        Delete Opsware Gateway address list.

    --spin_host         Spin hostname or IP (you must include --no_opsw_gw with this option).

    --force_full_hw_reg Force full hardware registration (default is minimal).

    --force_virt_reg    Force full virtualization registration (default is no registration).


    --force_sw_reg      Force software registration (default is no sw registration).

    --force_new_device  Force creation of new device record.

    --no_check_reachability
        Suppress reachability check (default is to perform check
        during fresh installs, and not to perform check during
        upgrades).

    --no_anonymous_ssl  Disable anonymous SSL. Applies to dormant agent only.
        If specified, the dormant agent will require clients that
        connect to its web-interface have a valid certificate

    --reboot            Reboot at completion of successful install if warranted.

    --coreinstall       Install init scripts in proper location for core server.

    --auth_path         Complete path to the file which contains the trusted authorities in PEM format.

    --fingerprint       Fingerprint of the peer's certificate.

    --no_start_agent    Do NOT start the agent after installation.

    --customer_id <id>  Assign device to a customer (requires --username option).

    --username <username>  HP SA username (used only with --customer_id option).

    --password <password>  HP SA password (used only with --customer_id and --username options).

    --opsw_src_addr <IP_address>   The preferred local IP address that will be used as source when connecting to the gateway.

In your run_once to install the HPSA agent after the VM template is started, try adding these options:

    --remediate         Perform a remediate of Software Policies after install.

    --software_policy <id>  Attach device to a software policy.

 

--Lars

 

View solution in original post

Absent Member.
Absent Member.

Hi,

If you are running an SA version post 10.2x, Software policies are handled via running an APX at agent install time(check post-installation scripts from the Agent install UI), this method allows you to add multiple software policies.

0 Likes
Absent Member.. Absent Member..
Absent Member..

Thanks Lars - that was what I was looking for and it is testing out as expected.  Looks like I can only specify one software policy ID - is that correct?  Also - can the same be done with a Windows Patch Policy (that is, are patch policies treated the same as software policies)?

Bryan
0 Likes
Absent Member.. Absent Member..
Absent Member..

Bryan, 

I have never tried multiple software policies, instead having a 'parent' policy that contained all the software policies needed.     You could potentially use multiple

--software_policy <id>

in your command line. 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.