Sponsored Content
Top Forums UNIX for Advanced & Expert Users process pager - by cell phone or just e-mail notify Post 8960 by Perderabo on Friday 19th of October 2001 02:48:58 PM
Old 10-19-2001
Instead of:
ps -ef | grep init | grep -v grep
try this:
ps -ef | grep [i]nit
Here we're giving grep a regular expression that matches "init" but doesn't match itself. So we don't need a second grep process to remove the first. Saves a process.

squash, the ping command comes in several forms. Look at your man page and find out out to ping a host exactly four times then stop. On HP-UX it's "ping host -n 4" and on Sun it's "ping -I 1 host 64 4". I don't know what it will be on your system.

Next, pipe it to "wc -l" and run it against a real host and a non-existant one. See how many lines of output you get in each case. For example, on Sun, I get 3 lines for the bad host and 8 for the good. So now that will be our test.

On the Sun I would do:
WATCH=`ping -I 1 host 64 4 | wc -l`
and check that WATCH was 8 on I would page/send mail. But again, you will need to fiddle with both the ping command syntax and the constant for the test to match stuff to your system.
 

4 More Discussions You Might Find Interesting

1. AIX

mail, aliases, pager

Hi, I have two aliases for two types of alert. /etc/aliases italert1: user1@company.com italertb: 123456@paging.isp.com The first alias containts only an email to go through the company exchange/mail server. Works fine. The second alias contains only a pager which also works fine.... (2 Replies)
Discussion started by: itik
2 Replies

2. Shell Programming and Scripting

Using mail command to notify the status of script

Can someone please help me with this script, I'm trying to create system backup on AIX, for this I want to first mount the filesystem if it is not mounted, then create the backup and unmount the filesystem but I'm having problem while using the mail command to notify the status of filesystem... (9 Replies)
Discussion started by: mbak
9 Replies

3. Shell Programming and Scripting

notify-send does not notify real time

Hi, I am having a little trouble getting notify-send to work the way I would like it to. I am using ubuntu - karmic koala 2.6.31-19-generic #56-Ubuntu SMP So here's the problem run the following commands one after the other. notify-send -i info -t 100000 -- "Hi" "world" & notify-send -i... (3 Replies)
Discussion started by: linuxpenguin
3 Replies

4. Shell Programming and Scripting

Cronjob to notify by mail

I am planning some tasks that I need send mails regularly to my team members. I think to use cronjob with script to do it. Two init files are prepared, I can change the format if you ask for. name.txt: Bill bill@xxx.com Peter peter@xxx.com James james@xxx.com Tasks_list.txt ... (4 Replies)
Discussion started by: newoz
4 Replies
ZGREP(1)						      General Commands Manual							  ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 06:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy