Login with Facebook
Showing posts with label HP Operations Manager Unix. Show all posts
Showing posts with label HP Operations Manager Unix. Show all posts

Friday, March 4, 2011

Monitor Unix processes in HP OM

Monitor the processes by several ways.

1-Log File Monitor
Configure the policy with pre-processing enabled to execute your script that direct the output to a text file and based on pattern matching rules, fetch the number of the processes.

2-Threshold Monitoring Policy
Where you have to create Measurement Threshold monitoring to launch a script and send the number of process instances along with opcmona.

3-Use the OSSPI built-in monitoring script to reach your goal as stated in your original question.

1- Monitor process using log file policy

Create Log file monitor policy
Leave log file location as empty
Enabled pre-processing option and for the field of command to be executed put your script
ps -ef | grep processname | grep -v grep | wc -l > /tmp/processname
Type the /temp/processname on the file to be read field
Note: replace the "processname" with the process you are looking for.
Create rule to look for value 0 to send you alert and for <!0> to send you the process is working

2- Monitor process using Measurement Threshold policy


Create a Measurement Threshold policy and name it with the process name
Select program as source and type
"processmonitor.sh policyname processname"
Note: replace the policyname and process name to match the exact policy name and process name.

Create minimum rule if processes are less than 1 then alert to be generated to as process is down

 

Create the following script and distribute it to the nodes (best option to distribute it as instrumentation)

---------processmonitor.sh--------
opcmon=$OVINSTALLDIR/bin/opcmon
policy=$1
process=$2
count=$(ps -ef | grep $process | grep -v grep | wc -l)
$opcmon $policy=$count
----------------------------------

3- Monitor Process using OSSPI.

Ref: Unix OS SPI Admin Guide http://support.openview.hp.com/selfsolve/document/KM14827/binary/UNIXOS-SPI_a35_AdminRef_pdf Page 86

The answer to your original question:
In OSSPI process monitor there is two files used for this:
1st one is created automatically called procmon.cfg and is created by "OSSPI-AutoDiscovery" policy and it is called discovery application
You can modify this file to add more processes but I am not sure if it will be overwritten by the re-discovery
2nd file is called procmon_local.cfg this can be manually created and it will not be overwritten by re-discovery, that's why you see everybody using it.

The file syntax is typical to procmon.cfg; also check the admin guide for more details.
[Process]
/path/to/process *

Also you can add processes by tools available in the OSSPI Process Monitoring application group to edit the process monitor configuration file.


After you add your processes
You can create a copy of any OSSPI process monitor template like "OSSPI-cronproc" and give it a new name and ensure that the program name in this policy to replace policy name and process name to match your own "osspi_perl.sh osspi_procmon.pl OSSPI-cronproc cron" with "osspi_perl.sh osspi_procmon.pl PolicyName Processname"

Thursday, March 3, 2011

Check OM Oracle DB Status

 

To check the database:
#su - oracle
Verify that ORACLE_HOME and ORACLE_SID are set correctly.

Check status by command tnsping:
$
tnsping ov_net

Check status by SQL query:

$ORACLE_HOME/bin/sqlplus /nolog
SQL> connect / as sysdba
SQL>

   1: set lines110
   2: col strtd hea 'STARTED'
   3: col instance_name for a8 hea 'INSTANCE'
   4: col host_name for a15 hea 'HOSTNAME'
   5: col version for a10
   6: select instance_name, version, host_name, status
   7: , database_status, to_char(startup_time,'DD-MON-YYYY HH:MI:SS') strtd
   8: from v$instance;

SQL> exit

Start the database:


$ORACLE_HOME/bin/sqlplus /nolog
SQL> connect / as sysdba
SQL> STARTUP MOUNT
SQL> exit

Usually default database setting is as below:
ORACLE_SID is [openview]
Password of Oracle user 'system' is [manager]
Oracle Service name is [ov_net]


Screenshot-1

OMU - Linux-2011-03-03-03-02-37

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1471367

Sunday, January 30, 2011

List all nodes from OMU server using opcnodes

By default OMU-L have a utility to control node management called opcnode it is similar to ovonodeutil.bat in OMW

You can use this tool to list all nodes like

/opt/OV/bin/OpC/utils/opcnode -list_nodes

image

But, in one of ITRC questions the Question Author request to get only the node name which falls under certain OS type

I made some trials and I would like to share them with you:

1st using shell script and opcmon command itself.

 

1: if [ $# -eq 0 ] ; then 
2:  echo "Use $0 <windows or unix>"  
3:  echo "To list windows nodes: $0 windows" 
4:  echo "To list Unix nodes: $0 unix" 
5:  exit
6: fi
7: 
<-- more -->
8: windows=( "MACH_BBC_WIN2K3_X64" "MACH_BBC_WINXP_IPF64" "MACH_BBC_WINNT_X86" )
9: unix=( "MACH_BBC_SOL_SPARC" "MACH_BBC_HPUX_IPF32" "MACH_BBC_HPUX_PA_RISC" "MACH_BBC_LX26RPM_X64" "MACH_BBC_LX26RPM_X86" "MACH_BBC_LX26RPM_IPF64" "MACH_BBC_SOL10_X86" "MACH_BBC_AIX_PPC" "MACH_BBC_AIX_K64_PPC")
10: 
11: if [ $1 = "windows" ]; then
12:  for i in ${windows[@]}
13:  do
14:   /opt/OV/bin/OpC/utils/opcnode -list_nodes mach_type=$i |grep "Name"
15:  done
16: 
17: elif [ $1 == "unix" ];  then
18:  for i in ${unix[@]}
19:  do
20:   /opt/OV/bin/OpC/utils/opcnode -list_nodes mach_type=$i |grep "Name"
21:  done
22: fi
23: 


usage  of the command listnodes.sh < unix or windows>



---sample usage---



[root@oml ~]# listnodes.sh
Use ./listnodes.sh <windows or unix>
To list windows nodes: ./listnodes.sh windows
To list Unix nodes: ./listnodes.sh unix




[root@oml ~]# listnodes.sh windows
Name         = mahmoud-pc.mahmoudthoughts.com




[root@oml ~]# listnodes.sh unix
Name         = oml.mahmoudthoughts.com




[root@oml ~]# listnodes.sh windows |awk '{print $3}'
mahmoud-pc.mahmoudthoughts.com




[root@oml ~]# listnodes.sh unix |awk '{print $3}'
oml.mahmoudthoughts.com
[root@oml ~]#
--------------------



For more information read full thread :http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1463140

Saturday, July 18, 2009

Installing HP OM Agent on non-default drive

One day you may face a need to install agent on another drive “filespace in Unix based systems” to free up some of the space used by the Agent but keep in mind that the agent itself is not consuming much space but hp products (SPIs and Performance Agent) when being installed it is looking for the HP Software date directory and other certain variables and does not allow you to choose where to install their files.

So  I will show in the next few lines how to install the agent on another drive.

to give you an overview of the agent installation.

Agent installation files for Windows and Unix environment contain multiple components (for Windows-based there are multiple .msi files  and for Unix-based there are multiple .gz files for these components.) that need to be installed in certain  order to ensure the agent will work this process is done through an installation script called opc_inst (in Windows-based the file is named opc_inst.vbs)

  • We supposed that we want to install the agent on drive e on windows environment so we may execute the below commands in the installation source files:

cscript.exe opc_inst.vbs -srv YOUROVOSERVER -cert_srv YOUROVOSERVER-inst_dir "E:\program files\HP\HP BTO software" -dd "E:\program files\HP\HP BTO software\data"

  • In unix evironment you have to download the agent files and almost you have to change opc_inst file to be executable by using the command below

chmod +x ./opc_inst

then you can execute the command below

opc_inst -srv YOUROVOSERVER -cert_srv YOUROVOSERVER-inst_dir "/var/opt/OV" -dd "/var/opt/OV/data"

 

Ahmed Douban writes this comment.

Thanks mahmoud
-srv Managment Server Hostname or ip
-Cert_srv Certificate server ip "most cases same as Management Server"
-inst_dir is for Agent installation files binaries
-dd for the data directory... Read More
thanks for the nice subject :)

Wednesday, December 31, 2008

How to successfully Install OVO-Unix Agent on Windows Machines

To push automatically OMAgent to Windows machine, you have to complete two steps

1st to install OMAgent on a Windows Machine manually

2nd Add the Windows node and push the agent

1st to install OMAgent on a Windows Machine manually this will be considered as Windows Installation Server

After completing the Agent installation complete the following:

Install FTP service

Enable read and write permissions on FTP service default ftp

I also ensured that SNMP service is installed and configured, I am not sure this is needed or not.

Now you have prepared your Windows Installation Server.

2nd step is to add your Windows nodes configure Node properties

Actions > Node > Add node

image

Type the server Name and hostname

Choose the Node Type

Net Type: IP Network
Machine Type: Intel x86 (HTTPS)
OS Name: MS Windows

In the below screen I supposed that your windows Node is named Server2

image

Click on Communication Options

Type your Windows Installation Server Name in Via Server

In the screen below I supposed that your Windows installation Server is named Server1

image

Close the window and Install the Agent as below

Select the New node and from Actions menu select Agents-> Install/Update SW & Config

image

Select Agent Software, ensure your new node(s) are displayed under Target Nodes and click Ok

image

Tuesday, December 16, 2008

Install HP OM Agent on Windows

to install HPOM Agent formerly known as OVO agent on a Windows machine

you have to copy the source files to your Windows temp location “you can use ftp but be careful against the binary and ASCII files transfer modes for different files”

the files located in the HP OMU server in the following path.

/var/opt/OV/share/databases/OpC/mgd_node/vendor/ms/x86/winnt/A.08.xx.yyy/RPC_BBC/

xx.yyy is the version of the client depend on how your Management server is patched.

insure that there is FTP service is installed and SNMP service configured to answer the management server request about the machine type while you adding the new node

then launch the installation using cscript opc_inst.vbs

On the Management Server

At the same time you can go for adding new node by using the Manage Node Bank then Action --- Node --- Add

 

image

After the installation if you did not configure configuration file for the server information, you can use opcactivate.vbs to do the following.

image

C:\ms\x86\winnt\A.08.10.160\RPC_BBC>cscript "C:\Program Files\HP OpenView\\bin\OpC\install\opcactivate.vbs" -srv ia64-13 -cert_srv ia64-13
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

opcactivate Info: OVO activation script starting ...
opcactivate Info: Setting MANAGER to user supplied value ia64-13
opcactivate Info: Getting core ID of OVO system ia64-13 ...
opcactivate Info: Pinging OVO system ia64-13 using BBC ...
opcactivate Info: Successfully pinged OVO system ia64-13. Parsing results file out.out ...
opcactivate Info: Core ID of OVO system ia64-13 is 1bbd1b10-eb84-7535-1e49-a630571e5970
opcactivate Info: Setting CERTIFICATE_SERVER to user supplied value ia64-13
opcactivate Warning: Not registering opcauth.dll. Passwordless switch-user operations for OVO actions will not be possible.
opcactivate Info: Not disabling remote trace access.
opcactivate Info: Killing OV services ...
opcactivate Info: Killed OV services.
opcactivate Info: Starting OVO agent ...
opcactivate Info: Successfully started OVO agent.
opcactivate Info: Successfully activated OVO agent.

C:\ms\x86\winnt\A.08.10.160\RPC_BBC>

 

On the OVO server

to insure communcation for your new client you have to make the server trust the client certificate

so Select Action – Nodes --- OVO Node Certificate Requests

image

 

Select the node from the Managed Nodes Bank then click on Map to Selected Node

image

After successful mapping select Grant

note: you will get this error message if your are not configuring DNS or HOSTs file correctly