shell script to alert cpu memory and disk usage help please


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell script to alert cpu memory and disk usage help please
# 8  
Old 09-27-2011
Quote:
Originally Posted by ahamed101
Try this...

Code:
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{if(NF<2){x=$0;getline;$0=x" "$0}} { if( 100-$5 < 10 ) print $6  "  warning " $1 }'

--ahamed
this worked ahamed
can you help me to script for hign physical memory usage
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with Shell script that monitors CPU Usage

I'm a newbie to shell scripting, I was given this script to modify. This script that monitors when CPU Usage is too high based off the top command. The comparison is not working as it should. Its comparing a decimal to a regualar interger. When it send me an email, it send an email and ignores the... (21 Replies)
Discussion started by: mhannor
21 Replies

2. Shell Programming and Scripting

Shell script for logging cpu and memory usage of a Linux process

I am looking for a way to log and graphically display cpu and RAM usage of linux processes over time. Since I couldn't find a simple tool to so (I tried zabbix and munin but installation failed) I started writing a shell script to do so The script file parses the output of top command through... (2 Replies)
Discussion started by: andy_dufresne
2 Replies

3. Shell Programming and Scripting

Get the memory and cpu usage

what is the best way to get the memory and cpu usage of a process on any system? this is relatively simple. however, i'm looking for a unified method that would work on linux, sunos, hpux, aix. ps -ef | egrep myprocess | awk '{print $4}' ---> there could be several instances of 'myprocess'... (3 Replies)
Discussion started by: SkySmart
3 Replies

4. Shell Programming and Scripting

help in high memory usage alert script

can any one please help me to shell script high memory usage alert (6 Replies)
Discussion started by: robo
6 Replies

5. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

6. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

7. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

8. UNIX for Dummies Questions & Answers

cpu, memory and virtual memory usage

Hi All, Does anyone know what the best commands in the UNIX command line are for obtaining this info: current CPU usage memory usage virtual memory usage preferably with date and time parameters too? thanks ocelot (4 Replies)
Discussion started by: ocelot
4 Replies

9. Programming

CPU usage and memory usage

Please tell me solaris functions/api for getting following information 1- Function that tells how much memory used by current process 2- Function that tells how much memory used by all running processes 3- Function that tells how much CPU is used by current process 4- Function that tells how... (1 Reply)
Discussion started by: mansoorulhaq
1 Replies

10. Programming

Monitor CPU usage and Memory Usage

how can i monitor usages of CPU, Memory, Hard disk etc. under SUN Solaries through a c program or java program i want to store that data into database so i can show it graphically thanks in advance (2 Replies)
Discussion started by: Gajanad Bihani
2 Replies
Login or Register to Ask a Question
GETFLAGS(8)						      System Manager's Manual						       GETFLAGS(8)

NAME
getflags, usage - command-line parsing for shell scripts SYNOPSIS
getflags $* usage [ progname ] DESCRIPTION
Getflags parses the options in its command-line arguments according to the environment variable $flagfmt. This variable should be a list of comma-separated options. Each option can be a single letter, indicating that it does not take arguments, or a letter followed by the space-separated names of its arguments. Getflags prints an rc(1) script on standard output which initializes the environment variable $flagx for every option mentioned in $flagfmt. If the option is not present on the command-line, the script sets that option's flag vari- able to an empty list. Otherwise, the script sets that option's flag variable with a list containing the option's arguments or, if the option takes no arguments, with the string 1. The script also sets the variable $* to the list of arguments following the options. The final line in the script sets the $status variable, to the empty string on success and to the string usage when there is an error parsing the command line. Usage prints a usage message to standard error. It creates the message using $flagfmt, as described above, $args, which should contain the string to be printed explaining non-option arguments, and $0, the program name (see rc(1)). If run under sh(1), which does not set $0, the program name must be given explicitly on the command line. EXAMPLE
Parse the arguments for leak(1): flagfmt='b,s,f binary,r res,x width' args='name | pid list' if(! ifs=() eval `{getflags $*} || ~ $#* 0){ usage exit usage } SOURCE
/src/cmd/getflags.c /src/cmd/usage.c SEE ALSO
arg(3) GETFLAGS(8)