Sponsored Content
Top Forums Shell Programming and Scripting Using top command to email if process is exceeding 25% and sending an email alert if so Post 302603956 by codemaniac on Friday 2nd of March 2012 11:23:41 AM
Old 03-02-2012
You can do a redirect to a file if you wish .Something like below .

Code:
ps -eo pri,psr,pcpu,stat | awk '{if($3 >= 25)print $0}' >> processUsage.log

The report will be appended to the file processUsage.log .
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sending email

I have an Solaris 8 machine running a managment application. One of the features of this application is to configure alarm forwarding to an email undress. When i configured the application to do that, it asked me only about the recipient email address. Quesiton: how to configure my Solaris 8... (7 Replies)
Discussion started by: bcheaib
7 Replies

2. UNIX for Dummies Questions & Answers

sending email

hi, is there any possiblity to send email from the command prompt, for eg i want to send alert to any mail id like /data/logs is 80% to my hotmail account , xxx@hotmail.com is this really possible,, if not, then what are the prerequistes need to do this (1 Reply)
Discussion started by: vasikaran
1 Replies

3. Shell Programming and Scripting

Sending find command results to email

This is probably simple so forgive me... I just want to find all files in a folder created within the last 10 minutes... This is easy: # find /home/folder -cmin -10 If the find command locates any files created in the last ten minutes I want it to send an email alert. I just want to... (3 Replies)
Discussion started by: gardellap
3 Replies

4. Shell Programming and Scripting

Sending an email with more than one files

Hi, I would like to send an email with more than one attachement. I am using uuencode. I want to achive by suing uuencode. Also please let me know other ways. -Thambi (7 Replies)
Discussion started by: thambi
7 Replies

5. UNIX for Dummies Questions & Answers

Sending email attachments

Hello, I've search the forum, but I cannot find an answer to my specific question. I'm trying to send some files to my professor. Upon his request, I used the following: tar -cvf vh.tar vh_part1.c vh_part2.c vh_part3.c vh_part4.c vh_sample_run15.txt uuencode vh.tar vh.tar > proj1 mail... (2 Replies)
Discussion started by: venush
2 Replies

6. AIX

email alerts for memory or cpu exceeding thresholds

Hi Guys, I hope this is an easy question: I need some kind of script or an idea how I can convince syslog to send an email to root or someone else once cpu usage exceeds 95% or the memory consumption (maybe via AVM value times 4k) exceeds 85% of my real memory on any of my 700 lpars. We're... (4 Replies)
Discussion started by: zxmaus
4 Replies

7. Shell Programming and Scripting

sending email as background process

Hi All, Solaris Bash v3x I have a script that accepts an error code, and if the error code is not 0 then an email is sent using mailx to details the error. I want to be able to implement the functiuonlity whereby i can send the email in a background process so the script can continue with... (3 Replies)
Discussion started by: satnamx
3 Replies

8. Linux

sending an email

I have used an already-built ActiveX control to send email from my asp web pages. One of the parameters I fill is FromName which defines the tittle the recipient will see in the From entrance in his Inbox. Now Iīm trying to use mail to send an email from a Shell but I havenīt found the... (1 Reply)
Discussion started by: RandomAccess
1 Replies

9. Shell Programming and Scripting

sending output of command via email

Hi all i want to send the output of a command by email, i have done this <comand> | mail -s <subject> <email address> which works well, but if the command retunrs noting then i just get a blank email, is there a way to stop this thanks Adam (4 Replies)
Discussion started by: ab52
4 Replies
PRINTF(9)						   BSD Kernel Developer's Manual						 PRINTF(9)

NAME
printf, uprintf, tprintf, log -- formatted output conversion SYNOPSIS
#include <sys/types.h> #include <sys/systm.h> int printf(const char *fmt, ...); void tprintf(struct proc *p, int pri, const char *fmt, ...); int uprintf(const char *fmt, ...); #include <sys/syslog.h> void log(int pri, const char *fmt, ...); DESCRIPTION
The printf(9) family of functions are similar to the printf(3) family of functions. The different functions each use a different output stream. The uprintf() function outputs to the current process' controlling tty, while printf() writes to the console as well as to the log- ging facility. The tprintf() function outputs to the tty associated with the process p and the logging facility if pri is not -1. The log() function sends the message to the kernel logging facility, using the log level as indicated by pri. Each of these related functions use the fmt parameter in the same manner as printf(3). However, printf(9) adds two other conversion speci- fiers. The %b identifier expects two arguments: an int and a char *. These are used as a register value and a print mask for decoding bitmasks. The print mask is made up of two parts: the base and the arguments. The base value is the output base expressed as an integer value; for example, 10 gives octal and 20 gives hexadecimal. The arguments are made up of a sequence of bit identifiers. Each bit identifier begins with an integer value which is the number of the bit (starting from 1) this identifier describes. The rest of the identifier is a string of characters containing the name of the bit. The string is terminated by either the bit number at the start of the next bit identifier or NUL for the last bit identifier. The %D identifier is meant to assist in hexdumps. It requires two arguments: a u_char * pointer and a char * string. The memory pointed to be the pointer is output in hexadecimal one byte at a time. The string is used as a delimiter between individual bytes. If present, a width directive will specify the number of bytes to display. By default, 16 bytes of data are output. The log() function uses syslog(3) level values LOG_DEBUG through LOG_EMERG for its pri parameter (mistakenly called 'priority' here). Alter- natively, if a pri of -1 is given, the message will be appended to the last log message started by a previous call to log(). As these mes- sages are generated by the kernel itself, the facility will always be LOG_KERN. RETURN VALUES
The printf() and the uprintf() functions return the number of characters displayed. EXAMPLES
This example demonstrates the use of the %b and %D conversion specifiers. The function void printf_test(void) { printf("reg=%b ", 3, "102BITTWO1BITONE "); printf("out: %4D ", "AAAA", ":"); } will produce the following output: reg=3<BITTWO,BITONE> out: 41:41:41:41 The call log(LOG_DEBUG, "%s%d: been there. ", sc->sc_name, sc->sc_unit); will add the appropriate debug message at priority ``kern.debug'' to the system log. SEE ALSO
printf(3), syslog(3) BSD
September 8, 2006 BSD
All times are GMT -4. The time now is 03:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy