Scripting an alarm


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scripting an alarm
# 1  
Old 10-12-2011
Scripting an alarm

Hi All,
I am monitoring batch Processes running in UNIX environment.
I use PuTTy to monitor the process running.
I have to continuously monitor and look on the screen if some error has come or not.

If an error comes FAILURE word is displayed instead of SUCCESS as shown below on the screenshot.
I want to write a code such that if the word FAILURE appears on the PuTTy screen
a sound alarm may be raised or so.

Please see the attachment.

Kindly help me.
Scripting an alarm-1jpg
# 2  
Old 10-12-2011
redirect the output to grep, if there is a match - let it show an alert.


Code:
echo "failure" | grep 'failure' && notify-send "there is a failure"

echo "success" | grep 'failure' && notify-send "there is a failure"

If you dont have notify-send, use some other alerting mechanism in your OS.
# 3  
Old 10-12-2011
Quote:
Originally Posted by thegeek
redirect the output to grep, if there is a match - let it show an alert.


Code:
echo "failure" | grep 'failure' && notify-send "there is a failure"

echo "success" | grep 'failure' && notify-send "there is a failure"

If you dont have notify-send, use some other alerting mechanism in your OS.
But the Processes are running on PuTTy which is a Windows XP Software.
Where should I write this code which u have given and how to implement that?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Alarm interrupt and multithreading

Hi Friends any know how became a friend in this Android Programming Language (0 Replies)
Discussion started by: ljarun
0 Replies

2. Solaris

Sysedge alarm threshold

Hello, how can we determine alarm threshold from sysedge in a solaris box? can anybody please help me? Thanks, (1 Reply)
Discussion started by: Pouchie1
1 Replies

3. Programming

alarm signal processing

I'm writing a function right now, and I want to set an alarm to avoid a timeout, here's the general idea of my code: int amt = -2; alarm(10); amt = read(fd, &t->buf, TASKBUFSIZ - tailpos); //do a read when the alarm goes off, i want to check the value of "amt" ... (1 Reply)
Discussion started by: liaobert
1 Replies

4. Shell Programming and Scripting

raise an alarm in Unix

Hi members, I am working in WebSphere in Unix environment. we are working with 500 odd servers and most of the times processes got down. Can i have any shell script through whih some popup with alarm get raised whenever some server get down. kindly help.. Thanks Rishi (1 Reply)
Discussion started by: rishi.madan
1 Replies

5. Shell Programming and Scripting

File Accessed Alarm ??

Hey, I want to ask a simple Question.... How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (16 Replies)
Discussion started by: varungupta
16 Replies

6. AIX

File Accessed Alarm ??

Hey, I want to ask a simple Question.... How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (1 Reply)
Discussion started by: varungupta
1 Replies

7. Programming

Basic signal and alarm usage

I am trying to write a program that will; 1) Show the message "Snoozing now...zzzz" on the screen for 5 seconds 2) Then in the same position show the message "The ALARM is going off now!" for 5 seconds 3) Repeat 1) then 2) infinitely until user presses Ctrl C I can't make it work. Any hints... (17 Replies)
Discussion started by: enuenu
17 Replies

8. Shell Programming and Scripting

Perl alarm signal

I am trying to write a signal to exit when a process times out. What I have come up with from poking around the web is this. #!/usr/bin/perl eval { local $SIG{ALRM} = sub { die "alarm clock restart" }; alarm 10; open(DSMADMC, "dsmadmc -se=tsmpc1 -id=XXXXX... (2 Replies)
Discussion started by: reggiej
2 Replies

9. UNIX for Dummies Questions & Answers

alarm

Hello I have a server HP ES40 with unix 5.1B, and if i open from Start-Programs-IN Tools-GUI/pfmalarm/Alarm-start monitoring , I receive this error message "IOR : STRING IS TOO LONG ! MAXIMUM SIZE = 1024" Anybody heard about this error? Thanks Alin (0 Replies)
Discussion started by: tomaalin
0 Replies

10. UNIX for Dummies Questions & Answers

Alarm signal

Hi, when I execute a script on unix AIX, I've got an error message: "Execution: 85328 Signal d'alarme". If I edit this file with "vi", I ve got the same error after a while (about 1 minute). If I try with another user I still have the problem. But if I rename this file, no problem. My... (5 Replies)
Discussion started by: cgsteph
5 Replies
Login or Register to Ask a Question