LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-28-2011, 06:18 AM   #1
centos123
Member
 
Registered: Apr 2011
Posts: 397

Rep: Reputation: 16
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..
 
Old 07-28-2011, 07:27 AM   #2
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
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.
 
Old 07-29-2011, 02:25 AM   #3
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
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...

Last edited by centos123; 07-29-2011 at 02:30 AM.
 
0 members found this post helpful.
Old 07-29-2011, 03:24 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
How much are you willing to pay a consultant to write this script for you?
 
Old 07-30-2011, 05:17 AM   #5
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
none....
 
0 members found this post helpful.
Old 07-30-2011, 07:51 AM   #6
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Do i understand correct, you are requesting us to provide you with code?
 
Old 08-01-2011, 12:27 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You might want to set a limit here http://linux.die.net/man/5/limits.conf
 
1 members found this post helpful.
Old 08-01-2011, 10:04 AM   #8
chandramani_yadav
Member
 
Registered: Jan 2007
Location: Vienna
Distribution: Redhat
Posts: 47

Rep: Reputation: 19
You can use "htop" to view more details.

Chandramani Yadav
http://Linuxconsultant.co.in
 
Old 08-01-2011, 09:16 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by centos123 View Post
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.
 
1 members found this post helpful.
Old 08-02-2011, 01:18 AM   #10
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by TB0ne View Post
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.
 
0 members found this post helpful.
Old 08-02-2011, 04:03 PM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by centos123 View Post
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
 
1 members found this post helpful.
Old 08-03-2011, 03:54 AM   #12
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by TB0ne View 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


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...
 
0 members found this post helpful.
Old 08-03-2011, 08:11 AM   #13
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by centos123 View Post
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???
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Check CPU - Red Hat - how to check if CPU working correctly ? dlugasx Linux - Server 8 07-28-2011 01:58 AM
AMD CPU Generating Way More System Load Than Intel Xeon CPU? kresyzig Programming 1 10-11-2010 09:35 AM
cpu utilization and cpu load soltanloo Linux - General 1 06-07-2009 02:19 AM
simple program for displaying cpu load/temp? reakinator Linux - Software 3 05-29-2006 09:00 PM
CPU check !!! TheShemeta Linux - General 3 10-19-2003 10:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration