- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Modifying DCL script
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
тАО06-15-2011 01:12 AM
тАО06-15-2011 01:12 AM
Modifying DCL script
I am very new to writing DCL scripts, I have a script which i am using for monitoring the server for its availablity, but i need to modify this.
The
When the server is not reachable it writes a log to the error log and the script reads the error log and sends out a error message to the reciptents mail box.
But even if the error is rectified the scripts keeps on sending the error message as the script reads only the date and not the time.
The script runs every 15 min once and i would like to modify the time selection that is it should check for the last 15 min alone to see if any error messages and not for the whole date.
The script used to select the date is :
date1 = f$extract(0,11,f$time())
and the search script is :
sear ssfmoni:erf.log JHF,Failed,'date1/match=and/nooutput/nowarn
Kindly guide me here to modify the script.
- Tags:
- DCL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 02:03 AM
тАО06-15-2011 02:03 AM
Re: Modifying DCL script
15-JUN-2011
$ write sys$output f$extract(0,16,f$time())
15-JUN-2011 11:0
Run some tests changing the the 11 to a 16 and run the job every 10 minutes.
Check what happens when the day value is <10, though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 02:52 AM
тАО06-15-2011 02:52 AM
Re: Modifying DCL script
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 03:16 AM
тАО06-15-2011 03:16 AM
Re: Modifying DCL script
Replace 'date1 with "''date1'"
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 03:33 AM
тАО06-15-2011 03:33 AM
Re: Modifying DCL script
If we are increasing the charater limit that is insted of
date1 = f$extract(0,11,f$time()) if we give date1 = f$extract(0,16,f$time()) and run the script for every 10 min then consider the situation like the error occured at 11:59 and the job ran at 12:00 the this error will not be identified.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 04:14 AM
тАО06-15-2011 04:14 AM
Re: Modifying DCL script
Read the last entry , and build the time difference to now using f$delta_time().
Eventually use a descending sort of the file to have the last entry in the first line.
(don't use VMS format to store the date/time, but ISO format, also called VMS comparison format).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 04:31 AM
тАО06-15-2011 04:31 AM
Re: Modifying DCL script
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 07:09 AM
тАО06-15-2011 07:09 AM
Re: Modifying DCL script
There is simply no way to select the lines using a single search.
What comes nearest would be to write the
SEARCH logifile JHF,Failed/match=and/window=1
/output=to a temporary file, read the file line-by-line until the first one where f$delta-time() tells it is not older than 15 minutes; then display/handle (send to mailbox) all lines up to the end of the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 07:22 AM
тАО06-15-2011 07:22 AM
Re: Modifying DCL script
I dont have much knowledge on the DCL scripts can you please help me in formaing a script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-15-2011 10:23 AM
тАО06-15-2011 10:23 AM
Re: Modifying DCL script
In place of this:
date1 = f$extract(0,11,f$time())
I'd tend to use this:
$ date1 = f$cvtime(,"ABSOLUTE","DATE")
And as for learning DCL, see the OpenVMS User's Guide available in the OpenVMS documentation shelf at:
http://www.hp.com/go/openvms/doc
If you're looking to outsource your DCL coding (or acquire training), then there are various providers available in the listings of companies over at the HP AllianceONE site:
http://www.hp.com/go/allianceone
There are various partners (that provide OpenVMS services and training) listed under the "find more partners" link at the bottom of that AllianceONE web page. (Various folks here provide these services, as well.)
And FWIW, I wrote the second edition of the _The Writing Real Programs in DCL_ book, if you can find a copy of that book around somewhere. (It's been out of print for a while.) That book goes into rather more detail, and specifically on DCL programming on OpenVMS.
I'd probably avoid this current design approach, and head toward a more managed and proactive notification approach, rather than basing the design on polling files at periodic intervals.
Have the code that is generating that log generate errors somewhere you can deal with, rather than adding more bags and baggage and complexity into the designs.
Also look to move to a scheduling tool as (when I see these piles of hacks) the folks have tended to build their own schedulers, and that gets to be a whole lot of work as compared with using a scheduler to start with. That might be Kronos or cron or a commercial package.
(And others have described the /BEFORE=time and /SINCE=time syntax, and you can have a look at specifying delta times in the /SINCE=time or /MODIFIED /SINCE=time specification. But polling is pretty gross, regardless, and as it tends involve various edge cases. So does process control. Even if you should know DCL well, these tasks and these areas can get slightly hairy.)
- Tags:
- AllianceONE