- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- hp unix shell (urgent help guys)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2010 05:02 AM
тАО01-28-2010 05:02 AM
hp unix shell (urgent help guys)
i had a log file like this:
01/28/2010 06:09:06.599 GMT+02:00 main (08.003.11) INFORMATIVE: Setting next file to: //b03185545.dat
01/28/2010 06:09:06.652 GMT+02:00 main (00.000.00) INFORMATIVE: File /oracle/uibstest/b03185545.dat was successfully archived to /oracle/uibstest.b03185545.dat.20100128060906
01/28/2010 06:09:06.693 GMT+02:00 main (00.000.00) INFORMATIVE: File /oracle/uibstestb03185545.dat was archived into: /oracle/uibstest.b03185545.dat.20100128060906 - and delivered
to: /oracle/uibstestb03185545.dat/oracle/uibstest/b03185545.dat)
01/28/2010 08:31:45.904 GMT+02:00 RequestProcessor-3 (03.002.01) ACCOUNTING: Stop Collector
01/28/2010 08:31:45.911 GMT+02:00 RequestProcessor-3 (02.015.01) ACCOUNTING: Received Stop Request.
01/28/2010 08:31:45.934 GMT+02:00 main (07.003.11) INFORMATIVE: Aggregated 30,382 NMEs at a rate of 3 NMEs/sec
01/28/2010 08:31:46.108 GMT+02:00 main (06.016.04) INFORMATIVE: Wrote NME file: /oracle/uibstest 01/28/2010 08:31:46.226 GMT+02:00 main (06.016.04) INFORMATIVE: Wrote NME file: /oracle/uibstest for scheme S04_unbil.
i want a shell to cmpare the date and time of the processing (ex. 01/28/2010 08:31:46) with the system date and time,then to sent email or an SMS to me when delay of time about 30 minutes.
and i want also to send a notification if a word "error" appears in the log file.
Please advice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2010 06:03 AM
тАО01-28-2010 06:03 AM
Re: hp unix shell (urgent help guys)
Then at every half hour have sanother script grep your expression, place it in another file(file2), use "comm -13 file1 file2" and have the output emailed/SMS to you.
You can do the same with "error" notifications.
Beers,
robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2010 02:57 AM
тАО01-31-2010 02:57 AM
Re: hp unix shell (urgent help guys)
i appritiate if you send me a detailed solution.
many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2010 09:38 AM
тАО01-31-2010 09:38 AM
Re: hp unix shell (urgent help guys)
For example:
" want a shell to cmpare the date and time of the processing (ex. 01/28/2010 08:31:46) with the system date and time,then to sent email or an SMS to me when delay of time about 30 minutes."
What else is there to identify the line so that the time can be extracted (as you can see in the example, every line has a date / time stamp, so which should be compared to the system time)???
" want a shell to cmpare the date and time of the processing (ex. 01/28/2010 08:31:46) with the system date and time,then to sent email or an SMS to me when delay of time about 30 minutes."
you need to probably need rethink this request. Is that any occurance of the word "error"? occurring only with specific other words?
Once its found, should you only look for "error" occuring after the time of the first page/message?
".... want a shell to cmpare the date and time of the processing (ex. 01/28/2010 08:31:46) with the system date and time,then to sent email or an SMS to me when delay of time about 30 minutes."
You might want to visit http://www.shelldorado.com/ for tutorials as well.....
Shell scripting is lie any other language, you learn by actually writing code and testing it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2010 11:18 PM
тАО02-01-2010 11:18 PM
Re: hp unix shell (urgent help guys)
please any one can give me a script works every 1 hour , compares the time of the log with system time, if the gap is 30 min send email to my yahoo email or SMS to my number.
note that am a biggener in scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2010 11:47 PM
тАО02-01-2010 11:47 PM
Re: hp unix shell (urgent help guys)
And if you never try to write any scripts
yourself, then you may stay that way for a
very long time.
Some people will be willing to help you when
you run into a specific problem.
Some people will be willing to do your whole
job for you.
Some people will be willing to do your whole
job for you for no pay.
I suspect that there are many more people in
the first group than there are in the second
group or the third group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2010 07:05 AM
тАО02-02-2010 07:05 AM
Re: hp unix shell (urgent help guys)
Like Steven said
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2010 11:57 PM
тАО02-02-2010 11:57 PM
Re: hp unix shell (urgent help guys)
okay donot worry, i will try it my self.
i just needed some help regarding the comarision between the date of the log and the sysdate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2010 01:19 AM
тАО02-03-2010 01:19 AM
Re: hp unix shell (urgent help guys)
You can compare for a match but to do date arithmetic, you need to work very hard, or use a language like perl.
Here is the current time, assuming you are in the same timezone:
date "+%m/%d/%Y %H:%M:%S"