Login with Facebook

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

Wednesday, February 23, 2011

Tuesday, February 15, 2011

Egypt: The camp that toppled a president

This is how Egyptians protests

All rights to http://www.bbc.co.uk/news/world-12434787

Egypt: The camp that toppled a president

Cairo's central Tahrir Square was the focal point for anti-Mubarak protesters during 18 days of demonstrations. As the protest neared its peak, the BBC's Yolande Knell took a tour of the area. Explore the protesters' camp by clicking on the links.

CLICKABLE Find out more..

Tanks

Throughout the demonstration, protesters have sat and slept around tanks parked near the Egyptian Museum, to prevent the army from advancing into the square.

Street clinic

This "street hospital", staffed by volunteer doctors, is one of several clinics where injured protesters have their wounds treated. Since Egyptians do not typically have access to free medical care, some say the clinics in the square are an improvement on what they are used to.

Flag sellers

A whole economy has grown up in the square since the protests began. Street vendors sell flags and hats in the colours of the Egyptian flag. A large flag costs five Egyptian pounds (about 50p).

Food stalls

This bean seller is one of many food vendors who have set up stalls inside the barricades. Protesters have also taken over the Hardees fast food restaurant, where they give out free bread and cheese.

Rubbish bins

Egypt has no formal system of recycling so the demonstrators have set up their own, as part of efforts to keep the square clean.

Artwork

This artwork, "Egypt's Heart", is one of many created by the demonstrators. The heart faces down one of the streets through which pro-Mubarak supporters came to clash with the anti-government protesters. Many visitors have had their photographs taken next to the heart.

'KFC clinic'

This Kentucky Fried Chicken fast food restaurant has been taken over by protesters and turned into a clinic for the injured and the sick.

Newspaper wall

Every morning Egypt's main newspapers are pasted up on the shutters of this shop, allowing protesters who cannot afford to buy a paper can still follow the latest reports, says our correspondent.

Pharmacy

This pharmacy near the main stage is helping campers and visitors keep clean and healthy. Some of the supplies are being given out for free.

Campsite

Though the majority of demonstrators go home each evening, a hard core have set up campsites on the roundabout, pavements and grass verges. Some sleep in tents, while others shelter under plastic sheets and rugs draped across pathways.

Wall of martyrs

Memorials of protesters who died during the uprising have been erected at the "wall of martyrs". Friends of the victims put up pictures and accounts of how they died. Some are very graphic and accuse the police of brutality.

Toilets

The camp toilets are here in a shed formerly used by construction workers near the Egyptian Museum. After 18 days, the smell is quite incredible.

Kindergarten

Schools in Cairo have been closed during the protests. But there are so many mothers who want to attend the demonstration that many bring their children here - to a kindergarten organised by the demonstrators.

Bloggers

Egypt's internet activists have played a key role in the pro-democracy protests and many are camped together on the roundabout in the centre of the square.

Water point

Drinking water is not easy to come by, so protesters have been filling their bottles at this water point beside a construction site.

Main stage

This platform has become a kind of "Speakers' Corner" for protesters to call comrades to action and pay tribute to those who have died during the demonstrations. The white screen is used to project televised speeches by the government and the army.

-

Tuesday, February 1, 2011

List all policies deployed on your OMW Managed Nodes

Lots of questions has been raised during last few weeks in ITRC about OMW  Nodes - Policies relationship
One of the questions was about how to list all Policies assigned for certain node or all nodes
the answer was typically there is a default report built-in HP Reporter
This report is called OVO/Windows 7.5 ConfInstalledPol "OVO/Windows 7.5 Installed Policies per Node"
You can also rerun the report as Excel.
367640
But the issue is sometimes you need a report for  a certain node or all nodes and HP Reporter requires certain configuration (very easy) but I have given also another solution
To list all policies deployed on nodes based on latest Policy Synchronization

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

Wednesday, January 19, 2011

Get Network Utilization Using VBs script

Last week I have faced challenge in responding to HP support (ITRC) thread regarding collecting Network utilization for Operation Manger to evaluate it against threshold.

Infrastructure SPI contain some policies for Monitoring network utilization but it is quite complicated (but efficient) as it has various  mathematical calculations.

Any way the script I have provided was just for calculating the utilization based on two factors total bytes transferred per second and the bandwidth.

We can get this data using WMI through "Win32_PerfFormattedData_TCPIP_NetworkInterface" class located on namespace "root\CIMV2"
We can use the attributes below to match factors stated above:

BytesTotalPersec
CurrentBandwidth

Network utilization calculation:
BytesTotalPerSec / CurrentBandwidth * 100


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\Root\CIMV2")
Set colItems = objWMIService.ExecQuery _
("select * from Win32_PerfFormattedData_TCPIP_NetworkInterface ")
For Each objItem in colItems
bytesTotal = objitem.BytesTotalPersec * 8
bandwidth = objItem.CurrentBandwidth
result = FormatNumber(( bytesTotal / bandwidth) * 100)
output = objitem.Name & " Network Bandwidth: " & result & " % Utilized"
WScript.Echo output
Next


Screenshot of the output.



networkutilization



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