- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: To search multiple strings
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
тАО08-08-2011 08:51 AM
тАО08-08-2011 08:51 AM
To search multiple strings
Hi,
I wrote a script for monitoring a remote box ( Unix box), for this i get the status of the server in a file and search for the faults, as i now need to modify the search, i would like to know if this is possible:
current search :
sear DISK1:[anup]out.txt ims,down/match=and
this was used as there were 4 unix boxes, but now 2 of them have been removed and hence not required to be monitored, but the other 2 are to be monitored.
The names of the boxes are:
ims01, ims02, ims21, ims31
ims01 and 02 are no more required but 21 and 31 are required.
i need to search :
"(ims21 or ims31), down/match=and"
is this possible?
Kindly help me identifying the possible solution.
Anup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2011 09:04 AM
тАО08-08-2011 09:04 AM
Re: To search multiple strings
[ If you need further help with this, you may want to show the EXACT format of out.txt in the topic or TXT attachement. ]
Change the AND or and (implied) OR:
$ search/wild out.txt "ims21*down", "ims31*down"
or, use a search tool with regular expression capability, liek AWK or PERL
$ perl -ne "print if /(ims21|ims32).*down/i" out.txt
fwiw,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2011 10:57 AM
тАО08-08-2011 10:57 AM
Re: To search multiple strings
>I wrote a script for monitoring a remote box (Unix box),
Wouldn't it be easier to monitor your Unix boxes using Unix commands and scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2011 11:11 AM
тАО08-08-2011 11:11 AM
Re: To search multiple strings
To add to Hein's post, if you are running TCP/IP Services, you likely have a flavor of awk on your system in SYS$COMMON:[SYSHLP.EXAMPLES.TCPIP.SNMP]GAWK
Flavors of perl are freely available, you just need to download and install them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2011 11:54 AM
тАО08-08-2011 11:54 AM
Re: To search multiple strings
And there are existing monitoring tools that can watch OpenVMS, and Mike mentions one of the main means for that: SNMP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2011 05:57 PM
тАО08-08-2011 05:57 PM
Re: To search multiple strings
Anup,
The DCL SEARCH command doesn't do complex expressions. If you're recent enough, wildcards might help. If not, you can achieve what you want as a pair of searches piped together:
$ PIPE SEARCH DISK1:[anup]out.txt ims21, ims31 | SEARCH SYS$PIPE down
So, the first SEARCH finds all lines containing "ims21" or "ims31" (easy to add any new nodes to the list). The second finds those containing "down".
That said, I'd go with Perl. You can be far more specific with a regular expression.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2011 02:54 AM
тАО08-09-2011 02:54 AM
Re: To search multiple strings
Thanks for the reply, but i am not in a position to install other tools for monitoring i am authorized to use only the DCL commands and write a script so that it can search. and the pipe command does not work here as the version is V6.2-1H2.
Anup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2011 04:04 AM
тАО08-09-2011 04:04 AM
Re: To search multiple strings
The following is somewhat crude, but with the restriction of V6.2, it should work. Implement the "pipe" functions using a temp file. Place the output of the first search into a temp file and then search that for "down". Clean up the tempfile when done and there you go...
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2011 06:20 AM
тАО08-09-2011 06:20 AM
Re: To search multiple strings
As far as perl goes, I guess it depends on what your management defines as "install" as there are versions that can be obtained or built that do not require a system-wide installation or special privileges. It might be hard to find one pre-built and supported on a VMS release that old, but it may build.
You've also got TPU on the system (it is the foundation of the EVE editor). It would take some effort to learn the syntax, but TPU is a language developed expressly for text processing and can be made to do nearly anything you want (both LSE and VAX Notes were implemented in TPU). The TPU documents are available online with the regular VMS OS documentation.