LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-24-2005, 12:29 PM   #1
gsibble
Member
 
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162

Rep: Reputation: 30
Still Need Help with 1 script.....


Hey everyone!! I'm making scripts to help monitor some servers. I've already made two that send me an email if there is too little free disk space and too little free memory.

Here's one of them for disk space:

#!/bin/bash +x

FD=`df | grep hda2 | awk '{print $4}' `
echo $FD

if [ "$FD" -lt 2031088 ]; then

echo "FREE DISK SPACE LOW"
echo $FD | mail -s "WARNING: DISK SPACE LOW" *******@owen.vanderbilt.edu

fi

Now, I need to create one for AVERAGE PROCESSOR USAGE. Any idea how I would do that? Thanks guys!

-George
 
Old 03-24-2005, 01:57 PM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
vmstat or uptime might give you some valuable numbers.
 
Old 03-24-2005, 03:41 PM   #3
gsibble
Member
 
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by stickman
vmstat or uptime might give you some valuable numbers.
Cool. VMSTAT gave me what I needed.

-George
 
  


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
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:12 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