This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

OM command to assign and deploy policy on managed node

Hi,

Kindly let me know the command for deploying policies for managed nodes via command line.

 

I believe ovdeploy and opr-agt should be the commands for policy deployment, but need to know the exact syntax.

Also the credentials used in the syntax, whether it should be added as a user in OMi or in Managed node?

HP OMi - 10.10

 

Thanks,

Arunkumar.K

  • 0

    dont be such lazy!

    --help an -ex provides all information

    [root@omi-lin1 TYB_Omitools]# opr-agt -ex
    List all Windows OM agents in the RTSM:
    $ opr-agt -username user -password passwd -list_agent_nodenames -query_name All_CIs_with_OM_Agents_Windows

    Get status of all OM agents:
    $ opr-agt -username user -password passwd -status -all

    Get status of all OM agents which are covered through RTSM view myView:
    $ opr-agt -username user -password passwd -status -view_name myView

    Stop agent on nodes n1.mycom.com and n2.mycom.com:
    $ opr-agt -username user -password passwd -stop -node_list "n1.mycom.com n2.mycom.com"

    Restart logfile encapsulator (process name opcle) on node n1.mycom.com:
    $ opr-agt -username user -password passwd -restart -comp opcle -node_list n1.mycom.com

    Set mgr.mycom.com as primary manager for all agents (up to 200 in parallel):
    $ opr-agt -username user -password passwd -primer mgr.mycom.com -num_parallel 200 -all

    List policies on system n1.mycom.com:
    $ opr-agt -username user -password passwd -list_policies -node_list n1.mycom.com

    Show agent versions of all OM nodes returned by view myOracleView:
    $ opr-agt -username user -password passwd -agent_version -view_name myOracleView

    Get installation date of all OM agents:
    $ opr-agt -username user -password passwd -get_config_var eaagt:OPC_INSTALLATION_TIME -all

    Set config variable exampleNs:exampleVar to value 50 on system n1.mycom.com:
    $ opr-agt -username user -password passwd -set_config_var exampleNs:exampleVar=50 -node_list n1.mycom.com

    Deploy configuration to system n1.mycom.com which was not yet delivered:
    $ opr-agt -username user -password passwd -deploy -node_list n1.mycom.com

    Redeploy full configuration to system n1.mycom.com:
    $ opr-agt -username user -password passwd -deploy -force -node_list n1.mycom.com

    Execute command opcagt -type -verbose on all agents from nodegroup mySAP:
    $ opr-agt -username user -password passwd -cmd 'opcagt -type -verbose' -node_group mySAP

    Switch agent to current OMI server whereas the agent is not yet in the OMI database, however BBC communication works already:
    $ opr-agt -user user -pw passwd -switch_manager -node_list n2.mycom.com -dont_check_database

  • 0

    As i am a nice guy i share a little script with you that do the job for one server or a file with a list of servers.

    be awre to create a rc_file first so there is no need for username password:

     

    [root@omi-lin1 TYB_Omitools]# cat omi_deploy_force_clean.sh
    set -x

    TMPFILE1=/tmp/$0.1.tmp

    if [ -z "$1" ] ; then
    echo Wrong Usage! $0 requires Parameter NODE or file with list of Nodes
    exit 1
    fi

    if [ ! -f $1 ] ; then
    echo $1 >$TMPFILE1
    else
    cat $1 | grep -v \# | grep . >$TMPFILE1
    fi

    while read NODE ; do
    {
    opr-agt -rc_file ./rc_file -deploy -clean -force -nl $NODE
    }
    done < $TMPFILE1

    echo "-------------- finished $0 $1"

  • 0 in reply to 

    Hi Andre,

     

    Thanks for the response.

    Me too got those opr-agt syntax from the help menu. But facing some issues in executing it.

    Like for some commands they have mentioned to use opr-asssign, opr-cli  which is not present in the path OMI home\opr\bin.

    Also the credentials used in the syntax, whether the user should be added in OMi or the user should have access to Managed nodes?

  • 0 in reply to 

    The user needs permission in OMi to execute the deploy action. so ususally my customers create a rc_file with admin user credentials. they run a lot of scripts with cron using this stuff.

  • 0 in reply to 

    Hi Andre,

    The opr-agt and ovdeploy are utility scripts used to execute specific commands. I am looking exactly for that command which will  assign and deploy policies  to Managed node via command line.

    OMi version - 10.10

    OS - Windows

     

    Thanks,

    Arunkumar.K

  • 0   in reply to 

    Have a look at https://docs.microfocus.com/itom/Operations_Bridge_Manager:2019.05/CliMaWorkflow
    The command of choice should be opr-assign

    It might be, that this command is not available in OMi 10.10 as this version is stone-age old. You should think about upgrading.

    Else you need to use the UI to assign and deploy Policies.

  • 0 in reply to   

    Hi Marc,

    I understand opr-assign is not available in 10.10 version. But can opr-assign be used for policy deployments or only for aspect deployments?

    Also can't we use the commands like ovpolicy or ovdeploy in 10.10 version for deploying policies?

     

    Thanks,

    Arunkumar.K