LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   program to check cpu load (https://www.linuxquestions.org/questions/linux-server-73/program-to-check-cpu-load-894263/)

centos123 07-28-2011 06:18 AM

program to check cpu load
 
my server get hanged when ever their is loading problem.
i wanna a program to get cpu load and also when load get high from a specified load value it should restart service.
is their is any programm or how to write that programm..

mesiol 07-28-2011 07:27 AM

you can use
Code:

uptime
to retrieve load information of your system.

Take a look at Advanced Bash Scripting Guide how to get this handled in a script to restart your service in case of high load.

centos123 07-29-2011 02:25 AM

thnx for reply
i dont want command i know this command i need coding to get cpu load.also code to restrict cpu load from exceeding to limit...and if possible to we can also write to kill the current process and restart it.this i want in code....
in short i need script to get cpu load and when load exceed to limit it wil restart the service...

catkin 07-29-2011 03:24 AM

How much are you willing to pay a consultant to write this script for you?

centos123 07-30-2011 05:17 AM

none....

mesiol 07-30-2011 07:51 AM

Do i understand correct, you are requesting us to provide you with code?

chrism01 08-01-2011 12:27 AM

You might want to set a limit here http://linux.die.net/man/5/limits.conf

chandramani_yadav 08-01-2011 10:04 AM

You can use "htop" to view more details.

Chandramani Yadav
http://Linuxconsultant.co.in

TB0ne 08-01-2011 09:16 PM

Quote:

Originally Posted by centos123 (Post 4429187)
none....

Oh, that's different then.

Write your own code, if you want it for free. We will be glad to HELP you, but we're not here to give you handouts, because you don't want to do the work for yourself.

centos123 08-02-2011 01:18 AM

Quote:

Originally Posted by TB0ne (Post 4431192)
Oh, that's different then.

Write your own code, if you want it for free. We will be glad to HELP you, but we're not here to give you handouts, because you don't want to do the work for yourself.


iam not a programmer, just beginner in linux..to learn coding will takes time.so i asked for help regarding issue.if any body have better option then coding then please provide me....
if i get code then definitely i will post it. so dont say i dont want to do work...

other also get help from this post.

TB0ne 08-02-2011 04:03 PM

Quote:

Originally Posted by centos123 (Post 4431313)
iam not a programmer, just beginner in linux..to learn coding will takes time.so i asked for help regarding issue.if any body have better option then coding then please provide me....if i get code then definitely i will post it. so dont say i dont want to do work...

other also get help from this post.

"Help", means YOU do some of the work, and others do other parts. You are not doing ANY of this, but asking others to do it ALL for you. Don't make it seem like you're asking to help others in the community. There are plenty of sites you can find that have free scripts to monitor different things, and you've already been directed to both a bash scripting guide and to the limits settings on your system.

And yes, coding takes time...so your options are either:
  1. TAKE the time, learn it, and do it yourself
  2. HIRE someone (and PAY THEM), to write it for you

centos123 08-03-2011 03:54 AM

Quote:

Originally Posted by TB0ne (Post 4431981)
"Help", means YOU do some of the work, and others do other parts. You are not doing ANY of this, but asking others to do it ALL for you. Don't make it seem like you're asking to help others in the community. There are plenty of sites you can find that have free scripts to monitor different things, and you've already been directed to both a bash scripting guide and to the limits settings on your system.

And yes, coding takes time...so your options are either:
  1. TAKE the time, learn it, and do it yourself
  2. HIRE someone (and PAY THEM), to write it for you



the guru --i always first google and search.and if i didnot found or i didnot understand the ans then only i post thread...
HELP also means to help in searching solution.if you know the script site then beside of writing all this waste you should have mention it.this turn into help..thats help

by the way i found the script soon i am going to post the links...

TB0ne 08-03-2011 08:11 AM

Quote:

Originally Posted by centos123 (Post 4432409)
the guru --i always first google and search.and if i didnot found or i didnot understand the ans then only i post thread...
HELP also means to help in searching solution.if you know the script site then beside of writing all this waste you should have mention it.this turn into help..thats help

Looking things up for you isn't 'help', sorry.
Quote:

by the way i found the script soon i am going to post the links...
Really?? Great...so, you FOUND a link and didn't post it? Wasn't that was WE were supposed to do for YOU???


All times are GMT -5. The time now is 06:18 PM.