LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Generate alert with "CPU load average" "CPU utilization" (https://www.linuxquestions.org/questions/linux-hardware-18/generate-alert-with-cpu-load-average-cpu-utilization-571564/)

viky 07-23-2007 05:18 AM

Generate alert with "CPU load average" "CPU utilization"
 
Hi,

I must write a trigger to generate an alert with these three variables:

1)CPU load average
2)CPU utilization user
3)CPU utilization system

But I don't know what's relationship between these three variables

Could someone help me?

MS3FGX 07-23-2007 06:27 AM

Do you mean what each one represents?

1. CPU load average is the average utilization over time. Unix usually displays this with three time periods to increase accuracy. This combines both user and system CPU loads.

2. User CPU utilization is how much of the CPU's power is being taken up by tasks running by the actual users.

3. System utilization is made up of the tasks being run by the operating system. These are the "behind the scenes" type processes, which the user generally is not in direct control of.

viky 07-23-2007 07:34 AM

Sorry, I was not clear.

I search an algorithm or Function that send an alert when it receives those variables... some like a script...

viky 07-25-2007 04:24 AM

Pseudo-code
 
If (Cpu load=High) {[INDENT]Switch (Cpu user) {[INDENT]
case High: Alarm
case Medium: Warning
case Low: {
Switch (Cpu sys) {
case High: Allarm
case Medium: Warning
case Low: Allarm
}
}
}
}
Else {
if (Cpu sys=Medum or Cpu sys=High) {
Warning
} Else {
if (Cpu user=High) {
Warning
} Else {
OK
}
}
}


All times are GMT -5. The time now is 01:21 PM.