Scripts for monitoring real time for the error code


 
Thread Tools Search this Thread
Operating Systems HP-UX Scripts for monitoring real time for the error code
# 1  
Old 10-06-2003
Question Scripts for monitoring real time for the error code

Hi ! I wish extract one information(error code) from the machine which is running on the HP-UX platform. Can anyone help me?

Wanted to write a scripts that monitor real time at the error code and transfer the information out from the machine. The information is then process and SMS out to the user.
# 2  
Old 10-06-2003
What error message? The best you can reasonably do is to check for the error, say, once every 5 minutes or so. You can check as often as you like within reason, but you don't want to overload the machine.

By sms, I assume that you want to send a very text message to a particular email address?
# 3  
Old 10-06-2003
Java

Hi Perderabo,
Many thanks for your quick reply. When there the machine encounter an error, it will need some human assistance. Therefore i need to monitor the error it generated in real time and continuously because i want to notify the users so that the users can address the error promptly and the down time of the machine can be minimized.

How can i overload the machine by monitoring the machine error code?

The user will be notified by SMS using their email address/mobile phone.
# 4  
Old 10-06-2003
You still have specified what errors you are looking to monitor. I'll guess that you want to monitor /var/adm/messages for anything.

From your thread in the Linux forum, I gather that you are writing in C++. You can use fstat() or stat() to see if the file has been changed. But you must repeatedly invoke fstat(). Let's say that you want your program to notice a new error message in less than a millisecond. Then 1000 times each second you must fstat() that file. That is quite a load for the box. Even HP's fastest cpu will spend a high percentage of it's time doing that. Most realtime applications can tolerate a millisecond delay so I'm guessing that this would be enough. Now suppose that you can tolerate a one second delay between the arrivial of the error message and your program noticing it. That would reduce the load on the box by a factor of 1000. At this point the cpu can do some other things. Most of us will actually tolerate 2 or 3 minutes in a situation like this. Some of us would even go as high as 5 minutes. But it's your box, you can loop as fast as you want.
# 5  
Old 10-07-2003
How can i prevent the machine from overloading if i wish to monitor the status at real time?

Currently we are donwloading the errorlog every 30 min from the machine. The errorlog is being copy out from the machine through netwoking.
# 6  
Old 10-07-2003
I would write a script to examine errlog and if finds something, it will email someone. It would do this once, it would not loop. Then I would use cron to schedule it to run every five minutes.
# 7  
Old 10-07-2003
The main idea is to notify the user when the machine encounter an error so that the user can address the problem promptly.

If i do not loop, user will not know that there is a problem with the machine immediatley.

Can you shed some light for me as to guide me to better solution regarding my concern?

If i am unable to add or change any scripts at the machine side, can i used another PC(external source) to interrogate the machine status by monitong the path where the error is kept and copy the error code and send the message to the user through SMS?
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting real time to epoch time

# date +%s -d "Mon Feb 11 02:26:04" 1360567564 # perl -e 'print scalar localtime(1360567564), "\n";' Mon Feb 11 02:26:04 2013 the epoch conversion is working fine. but one of my application needs 13 digit epoch time as input 1359453135154 rather than 10 digit epoch time 1360567564... (3 Replies)
Discussion started by: vivek d r
3 Replies

2. Shell Programming and Scripting

Shell script to convert epoch time to real time

Dear experts, I have an epoch time input file such as : - 1302451209564 1302483698948 1302485231072 1302490805383 1302519244700 1302492787481 1302505299145 1302506557022 1302532112140 1302501033105 1302511536485 1302512669550 I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies

3. Shell Programming and Scripting

DR monitoring shell scripts

Hi All, we need to have 2 scripts in place for the following:. 1) One which will verify if archive log sequence in Production is getting replicated in DR or not. If there is difference, we should receive an email. 2)If there are any errors in DR site like in alert log, mail should be sent to... (1 Reply)
Discussion started by: a1_win
1 Replies

4. UNIX for Dummies Questions & Answers

capturing real time

Newbie question: I wrote korn shell script that lets me connect to a cisco switch thru telnet from sun server. I'm wodering if or what command i would use to capture info that is being sent to standard output when the script is running. Putting part of my script below and results. #!/bin/ksh... (2 Replies)
Discussion started by: wisher115
2 Replies

5. UNIX for Advanced & Expert Users

EPOCH to real time?

hi all :confused: i am wondering if there is a way to convert from EPOCH time to the standard tim, may be using a script or some thing else??????? thanks............................ (5 Replies)
Discussion started by: TheEngineer
5 Replies
Login or Register to Ask a Question