Thursday, 13 November 2014

NNMi 9.23: import seed from file


 nnmloadseeds.ovpl -f newSeedfile

NNMi seed file example : 

10.2.32.201 # comment
10.2.32.202 # comment
lnt03.example.net # comment
lnt02.example.net
10.2.32.205

HP OMU OML: ovcert remote remove certificate


1.# create new core id
ovcoreid -create –force

2.# remove certificate
ovcert -remove `ovcoreid`

3. # adapt xpl conf variable OPC_NODENAME
ovconfchg -ns eaagt -set OPC_NODENAME `hostname`

4.# restart OM Agent
ovc –kill
ovc -start

5.# create new certificate request
ovcert –certreq

Ideally, you can create a clone template, which runs the script below
automatically after cloning. May be integrate this into the startup of the agent.

#!/bin/sh
PATH=$PATH:/opt/OV/bin/OpC:/opt/OV/bin
OPC_NODENAME=`ovconfget eaagt OPC_NODENAME`
HOSTNAME=`hostname`
if [ "$OPC_NODENAME" == "$HOSTNAME" ]
then
echo hostname $HOSTNAME not changed
exit 0
fi

echo y > /tmp/yes
echo >> /tmp/yes

# remove certificate
ovcert -remove `ovcoreid` < /tmp/yes

# create new core id
ovcoreid -create –force

# adapt xpl conf variable OPC_NODENAME
ovconfchg -ns eaagt -set OPC_NODENAME `hostname`

# restart OM Agent
ovc -kill
ovc –start
ovagtrep -clearall

# create new certificate request
ovcert -certreq

http://www.vivit-germany.org/pdf/H210/Vivit2010_OMTipsTricks_Schmollinger_final.pdf

 

Tuesday, 11 November 2014

HP OMU: update agent bash script

Massupdate agent oa:

http://sysadminz.ru/index.php?topic=329.0

#!/usr/bin/sh
#-- environment
FILE="/tmp/check_version.out"
FILE_GOOD="/tmp/check_version_good.out"
FILE_BAD="/tmp/check_version_bad.out"
TMP_FILE=${FILE}_${RANDOM}
MAIL_LIST="admin@domain.net"
OPC_DIR="/opt/OV/bin/OpC"
CURR_VER="08.60.501" # Версия, до которой обновляемся
C_BAD=0
C_GOOD=0
#-- main
>$FILE_GOOD
>$FILE_BAD
echo '<table border=1 width="100%">' > $FILE
for NODE in `/usr/bin/opcnode -list_nodes | awk '/Name/ {print ($3)}' | grep -v "^[0-9]\{1,3\}\." | grep -v "<\*>" | sort`
do
        SNODE=`echo $NODE | cut -f1 -d"."`
        echo "$SNODE \c" > $TMP_FILE
        $OPC_DIR/opcragt -agent_version $NODE|grep "HPOvEaAgt"|\
        sed 's/.*\([0-9][0-9]\.[0-9][0-9]\.[0-9][0-9][0-9]\)  pkg[ ]\(.*\)/\1 \2/ '     1>>$TMP_FILE 2>&1
        cat $TMP_FILE|grep -q "$CURR_VER"
        RESULT=$?
        if [ "$RESULT" = "1"  ]
        then
            cat $TMP_FILE | awk '{print "<tr><td>"$1"</td><td>"$3"</td><td>"$2"</td></tr>"}' >> $FILE_BAD
            C_BAD=`expr $C_BAD + 1`
        else
            cat $TMP_FILE | awk '{print "<tr bgcolor=green><td>"$1"</td><td>"$3"</td><td>"$2"</td></tr>"}' >> $FILE_GOOD
            C_GOOD=`expr $C_GOOD + 1`
        fi
done
echo '<tr bgcolor="#C0C0C0"><td>Summary</td><td>Wrong</td><td>Correct</td></tr>' >> $FILE
echo "<tr bgcolor=\"#C0C0C0\"><td>"`expr $C_BAD + $C_GOOD`"</td><td>$C_BAD</td><td>$C_GOOD</td></tr>" >> $FILE
echo '<tr bgcolor="#C0C0C0"><td> </td><td> </td><td> </td></tr>' >> $FILE
cat $FILE_BAD >> $FILE
cat $FILE_GOOD >> $FILE
echo "</table>" >> $FILE
echo "[include $FILE text/html base64]"|elm -s "Check_version report" $MAIL_LIST 1>/dev/null 2>&1
rm $TMP_FILE



HP OMW help

HP operations manager for windows help:

HP OMU OML 9.20: opcragt

opcragt - remotely administer agent processes on HP Operations Manager
managed nodes
opcragt [ -help ]
        [ -update ]
        [ -running_as_user ]
        [ ( -start | -stop | -status | -primmgr | -cleanstart ) [-id <subagent_id>] ]
        [ -init_install <inst_server> <architecture> <version>
                        <account_password> <inst_drive> ]
        [ -distrib [ -policies ] [ -templates ] [ -instrum ] [ -actions ]
                   [ -monitors ] [ -commands ] [-subagts ]
                   [ -force | -purge ] [ -highprio ]
                   [ -simulate ] ]
        [ -subagent ( -install | -uninstall | -reinstall |
                      -active ) <subagent policy name> ]
        [ -agent_version ]
        [ -version ]
        [ -get_config_var [<namespace>:]<config_var> ]
        [ -get_config_var <namespace>: ]
        [ -set_config_var [<namespace>:]<config_var>=[<value>] ]
        [ -timeout <timeout> ]
        [ -all | [ -nodegrp <group>... ] <node>... ]
The command opcragt remotely administers the agent processes running on the managed nodes of HP Operations Manager (HPOM) from the HPOM management server.
If called without any option, opcragt returns the current status of all agent processes on the specified system(s).