process pager - by cell phone or just e-mail notify


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users process pager - by cell phone or just e-mail notify
# 8  
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.
# 9  
Old 10-19-2001
ok

ok, tks.. Smilie now it's working..
# 10  
Old 10-23-2001
Quote:
Originally posted by Perderabo
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.
I love this guy!
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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
Login or Register to Ask a Question