Re: Add annotation in message (785 Views)
Reply
Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 1 of 33 (817 Views)

Add annotation in message

Dear Folks,

 

I have a requirement to capture the top 10 CPU consuming process when alert for CPU breach reported.

 

I just added the command

UNIX95=1 ps -e -o pcpu,pid,ppid,user,args | sort -rn | head -20

 

to the template and add the annotation flag for true while leave the node field blank.

 

It should add the top processes as text but nothing happens.

 

OMU8.35

 

 

Regards,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
KAKA_2
Posts: 1,440
Registered: ‎05-26-2007
Message 2 of 33 (787 Views)

Re: Add annotation in message

Hello Piku,

Why dont you use SI SPI policy for CPU bottelneck, which shows the top 10 process when there is breach of threshold.

-KAKA-
Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 3 of 33 (785 Views)

Re: Add annotation in message

Hi KAKA,

It is our predefined SPI for CPU and have same across all the node. We can not change the templates.
But only can modify so need to add command so that can get process with alert.

regards,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
Jeroen Peereboom
Posts: 2,713
Registered: ‎06-26-2003
Message 4 of 33 (783 Views)

Re: Add annotation in message

Did you check the obvious: is the new template indeed active on the managed node?
I am using OM9 nowadays, but in OM8 the message properties should also show that an AutoAction is defined (and one annotation should show it has started and another one should show the result).

JP
Honored Contributor
Jeroen Peereboom
Posts: 2,713
Registered: ‎06-26-2003
Message 5 of 33 (778 Views)

Re: Add annotation in message

You could also put the command (temporarily) in Operator Action, for testing.

JP
Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 6 of 33 (749 Views)

Re: Add annotation in message

I did not created new template, i just modified it and redistributed on node.
How can I check whether it has been activated or not.

Regards
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
HP Expert
tobias_m
Posts: 250
Registered: ‎05-06-2010
Message 7 of 33 (736 Views)

Re: Add annotation in message

Hello,

 

To check if the action is presnt in the policy on the managed node, you could just grep for it in the policy data files:

# grep UNIX95 /var/opt/OV/datafiles/policies/*/*_data

 

You might need to explicitely call a shell because of the environment variable in the beginning, e.g.:

/bin/sh -c 'UNIX95=1 ps -e -o pcpu,pid,ppid,user,args | sort -rn | head -20'

 

Best regards,

Tobias

 

Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 8 of 33 (718 Views)

Re: Add annotation in message

Hi Tobias,

No output of above command reported.

regards,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
HP Expert
tobias_m
Posts: 250
Registered: ‎05-06-2010
Message 9 of 33 (699 Views)

Re: Add annotation in message

Hello,

 

Hmm, if the grep doesn't show anything, then the modified template has not been distributed to the managed node. You could try to distribute with force update.

 

If that doesn't help, I would de-assign and re-assign the template and distribute again.

 

Best regards,

Tobias

Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 10 of 33 (681 Views)

Re: Add annotation in message

Hi,

yes there is error in while distributing it,
Reason: (xpl-84) Could not create temporary file in '/var/opt/OV/shared/server/installation/temp'

regards,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 11 of 33 (676 Views)

Re: Add annotation in message

HI,

Now templates have been distributed, still no luck and no annotation added.

regards,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
HP Expert
tobias_m
Posts: 250
Registered: ‎05-06-2010
Message 12 of 33 (671 Views)

Re: Add annotation in message

Hello,

 

Did you select Yes for Anno in the condition window?

 

E.g.:

Actions.JPG

 

Can you please share the part of the policy that defines this condition and action?

 

Best regards,

Tobias

Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 13 of 33 (645 Views)

Re: Add annotation in message

 

Hi ,

 

Please check, all is correct.

annon.JPG

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
HP Expert
tobias_m
Posts: 250
Registered: ‎05-06-2010
Message 14 of 33 (640 Views)

Re: Add annotation in message

Hello,

 

Can you please check if the message was matched by the correct condition (In the Source field of the message in the Java GUI). Maybe the message was matched by a more generic condition.

 

And could you please again check that the policy was distributed correctly:

# grep UNIX95 /var/opt/OV/datafiles/policies/*/*_data

 

Best regards,

Tobias

 

Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 15 of 33 (634 Views)

Re: Add annotation in message

It is same and verfied it.

no output of command on mgmt server or node.

thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
Goran Koruga
Posts: 1,294
Registered: ‎12-05-2002
Message 16 of 33 (626 Views)

Re: Add annotation in message

Hello.

 

You were asked to verify two things - so what exactly did you verify?

 

Regards,

    Goran

Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 17 of 33 (622 Views)

Re: Add annotation in message

HI,

Can you please check if the message was matched by the correct condition (In the Source field of the message in the Java GUI). Maybe the message was matched by a more generic condition. -- It is same policy name as I am changing in GUI.



And could you please again check that the policy was distributed correctly:

# grep UNIX95 /var/opt/OV/datafiles/policies/*/*_data
-- No output of this command.


Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
Goran Koruga
Posts: 1,294
Registered: ‎12-05-2002
Message 18 of 33 (621 Views)

Re: Add annotation in message

Hello.

 

Then it's not being distributed to your node.

 

Regards,

    Goran

Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 19 of 33 (618 Views)

Re: Add annotation in message

Hi ,

But there are lots of updated files (ending with _data) inside below directory on node,

/var/opt/OV/datafiles/policies/monitor
/var/opt/OV/datafiles/policies/msgi
/var/opt/OV/datafiles/policies/configsettings


Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
Goran Koruga
Posts: 1,294
Registered: ‎12-05-2002
Message 20 of 33 (615 Views)

Re: Add annotation in message

Hello.

 

Could be, but this particular policy is not being distributed.  Verify policy assignments for the node in question again, for example:

 

opcnode -list_ass_templs node_name=your_node_here net_type=NETWORK_IP

 

Does it show up if you check in this directory:

 

cd /etc/opt/OV/share/conf/OpC/mgmt_sv/templates/utf8/ux_compress

grep UNIX95 *

 

Regards,

    Goran

Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 21 of 33 (612 Views)

Re: Add annotation in message

Hi,

Yes policy is assigned, since I have changed existing template hence it is there but can not say it has been update on node or not.

on node this folder is empty.
but at mgmt server there are lots of file in taht folder, and output of 'grep UNIX95 *' is null.


hth,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
Goran Koruga
Posts: 1,294
Registered: ‎12-05-2002
Message 22 of 33 (611 Views)

Re: Add annotation in message

The path is only relevant on the management server.

 

Then delete all the files in that directory (but not the directory itself) and redistribute policies again:

 

opcragt -distrib -force -templates your_node

 

Does grep now show a different output?  Do you only have compressed files there (ending in ".Z")?  If you do then check in a different way:

 

for a in *.Z; do uncompress -c "$a" | grep UNIX && echo $a; done

 

    Goran

Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 23 of 33 (609 Views)

Re: Add annotation in message

Hi,

I already did the same but no luck.
and '.z' files are there but old one and I did not compressed them.


Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
Goran Koruga
Posts: 1,294
Registered: ‎12-05-2002
Message 24 of 33 (608 Views)

Re: Add annotation in message

I haven't mentioned compressing them - instead you should check if files re-created by opcragt show your new command.  Do they?

 

Also grep for it in the "*_data" files.  Does any file show it?

 

    Goran

Honored Contributor
Piku
Posts: 3,966
Registered: ‎06-17-2010
Message 25 of 33 (606 Views)

Re: Add annotation in message

Hi ,

Lots of files like *data* and *header.xml* have created in that directory on mgmt server.


hth,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
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.