Operating System - HP-UX
1753300 Members
7501 Online
108792 Solutions
New Discussion юеВ

how to set the alert for CPU usage crosses 80% and above.

 
SOLVED
Go to solution
rajesh73
Super Advisor

how to set the alert for CPU usage crosses 80% and above.

how to set the alert for CPU usage crosses 80% and above.

if you have any script pls help me
4 REPLIES 4
Mel Burslan
Honored Contributor
Solution

Re: how to set the alert for CPU usage crosses 80% and above.

Normally, if you have glance plus product installed on your system, it can do such a thing. It is not free but worth its weight in gold in my opinion.

If you want to go with a free option, search for statmon using google and read all about it and install it. It is not only for CPU but useful for many other things. You might want to install it in a central server use it on data collected from other systems.

It is a very lengthy process to explain how to install it here. You need to read the documentation on the web
________________________________
UNIX because I majored in cryptology...
Alzhy
Honored Contributor

Re: how to set the alert for CPU usage crosses 80% and above.

If you have glance:


cd /var/opt/perf
vi alarmdef (make customisations - it's easy!)
opva restart alarm


Hakuna Matata.
Alzhy
Honored Contributor

Re: how to set the alert for CPU usage crosses 80% and above.

For example - my simple customisation is as follows in my alarmdef file:

alarm CPU_Bottleneck > 50 for 5 minutes
type = "CPU"
start
if CPU_Bottleneck > 90 then
{
red alert "CPU Bottleneck probability= ", CPU_Bottleneck, "%"
exec "/usr/local/SM/perf/mwa_email.ksh `hostname` CPU start"
}
else
yellow alert "CPU Bottleneck probability= ", CPU_Bottleneck, "%"
repeat every 10 minutes
if CPU_Bottleneck > 90 then
{
red alert "CPU Bottleneck probability= ", CPU_Bottleneck, "%"
}
else
yellow alert "CPU Bottleneck probability= ", CPU_Bottleneck, "%"
end
{
reset alert "End of CPU Bottleneck Alert"
exec "/usr/local/SM/perf/mwa_email.ksh `hostname` CPU end"
}

Hakuna Matata.
muruganantham raju
Valued Contributor

Re: how to set the alert for CPU usage crosses 80% and above.

Rajesh,
Check if Glance/Performance Agent is available in your system. It is the best tool that fits your need.
swlist | egrep -i "glance | Performance Agent"

You can define alerts for many system metrics. Alternatively, I think HP Sitescope also fits your need. But these are licensed products.

Another way to do: write your own script that get "sar" command output and check for cpu util values, send snmp trap or mail periodically