- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Need help with a perl 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
Forums
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
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
тАО10-09-2005 07:18 AM
тАО10-09-2005 07:18 AM
Need help with a perl script...
New applications structure does not make use of tuxedo, therefore no need to read any ubb files (the dump location is pretty much static) but the same script should be able to search for core files in either type of application (tuxedo and non-tuxed0... Can only show script to someone who can help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2005 07:55 AM
тАО10-09-2005 07:55 AM
Re: Need help with a perl script...
1) Main chunk of code attached.
2) 4 new applications are coming into play, let's call them: xxa, xxb, xxc, xxd
3) Neither one of these are specified in a ubb file, so in this case no need to havea "$ubbfileloc", however they all have a common "core" dump location, per say:
/main/obe/
PHASE is one of the corresponding "phases", this one is new and unique, named PPR (capitalized) and it's a test one too, and it's the only one that will have structure above for where core files are dumped.
for the new one,
4) The rest will still follow the same parameters as the attached file (how many files to keep, if to be removed what's the oldest they can be, etc.
Is this understandable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2005 07:36 PM
тАО10-09-2005 07:36 PM
Re: Need help with a perl script...
2. There's this site I always use when I need a quick answer:
http://www.perlmonks.org/
you need to register there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2005 08:10 AM
тАО10-10-2005 08:10 AM
Re: Need help with a perl script...
What it does:
1) Looks into a file (a tuxedo ubb file), to find out where it's configured in there for certain applications to do core dumps, if these should fail.
2) Once it finds possible locations of these core dumps, then it goes to those directories (all can have different directories, based on an environment phase fof the application, by that I mean production, development, one of many test, and the specific application), for example, one node may have as many paths as these:
1st is same application in two different test phases; second is 2 more in yet other different phases (core dump locations):
/main/obe/MIG/app1/com/bint
/main/obe/TST/app1/com/bint
/main/obe/TST2/app2/bint
/main/obe/PRP/app2/bint
The script parses the file to get these possible locations. Then it lists the core files in there and removes some if found, based on criteria: a) age, b) number of core dump files found (more than "x" only keep the latest created).
What it does not do:
A new series of applications has been created that does not have a file to parse (named ubb above). For these new applications the general location is:
/main/obe/
How can I integrate this entirely different option but yet follow the same guidelines for core files removal as explained above. Since applications of both types may run in the same system we'd like to stick using the one script.
Is this better?
MAD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-11-2005 08:16 AM
тАО10-11-2005 08:16 AM
Re: Need help with a perl script...
MAD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-11-2005 09:25 PM
тАО10-11-2005 09:25 PM
Re: Need help with a perl script...
then you can append a function to your script that searches some folder recursively and finds the "core" directories.
In the following example it prints the files it finds there,but you can do any manipulation you wish.
Hope I understood and it helps.
#!/usr/bin/perl
use File::Find;
$start_point="/main/obe";
find (\&search,$start_point);
for (@list)
{
@files=glob "$_/*";
for (@files)
{
print "$_\n";
}
}
sub search
{
if (-d $_ && /core$/)
{
push @list,$File::Find::dir."/$_";
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 04:49 AM
тАО10-13-2005 04:49 AM
Re: Need help with a perl script...
It's called from the following lines:
*****************************************
if ($APPLI_CNT > 0)
{
print "................>";
for ($j = 0; $j < scalar(@LES_APPLI); $j++)
{
chomp($LES_APPLI[$j]);
print "\n>>>>>>>App nber ", $j + 1, " is ", uc($LES_APPLI[$j]),"\n";
for ($t = 0; $t < scalar(@phases) ; $t++)
{
if ($LES_APPLI[$j] =~ /aaa|bbb|ccc|ddd/ )
{
$newpath = "/main/obe/$phases[$t]/$LES_APPLI[$j]/com/core";
print "check: $newpath\n";
new_path "$newpath";
}
elsif ($LES_APPLI[$j] =~ /eee|fff|ggg/ ) # special treatment needed for the CPX application
{
$environmentfile = "/main/obe/$phases[$t]/$LES_APPLI[$j]/com/etc/cfg/environment_$LES_APPLI[$j]";
print "check: $environmentfile\n";
look_for_environment "$environmentfile";
}
elsif ($LES_APPLI[$j] =~ /ngi/ ) # special treatment needed for the NGI
{
$environmentfile = "/main/obe/$phases[$t]/$LES_APPLI[$j]/com/etc/cfg/environment_com";
print "check: $environmentfile\n";
look_for_environment "$environmentfile";
}
else
{
$environmentfile = "/main/obe/$phases[$t]/$LES_APPLI[$j]/etc/cfg/environment_$LES_APPLI[$j]";
print "check: $environmentfile\n";
look_for_environment "$environmentfile";
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 04:54 AM
тАО10-13-2005 04:54 AM
Re: Need help with a perl script...
++++++++++++++++++++++++++++++++++++++
/ama/obe/TST1/bbb/bint/core.20050928 not found
/usr/local/bin/sudo: Illegal option -f
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
[-u username/#uid] -s |
/ama/obe/TST1/bbb/bint/core.20050930 not found
/usr/local/bin/sudo: Illegal option -f
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
[-u username/#uid] -s |
/ama/obe/TST1/bbb/bint/core.20050929 not found
/usr/local/bin/sudo: Illegal option -f
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
[-u username/#uid] -s |
/ama/obe/TST1/bbb/bint/core.20050926 not found
/usr/local/bin/sudo: Illegal option -f
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
[-u username/#uid] -s |
/ama/obe/TST1/bbb/bint/core.20050922 not found
/usr/local/bin/sudo: Illegal option -f
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
[-u username/#uid] -s |
++++++++++++++++++++++++++++++++++++++
This, after the files were actually found, they were there, they were also removed as per the subroutine's guidelines... anyone see the mistake I've made on the modifications I have used?
Thanks for any ideas...
MAD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 08:47 AM
тАО10-13-2005 08:47 AM
Re: Need help with a perl script...
MAD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 02:20 PM
тАО10-13-2005 02:20 PM
Re: Need help with a perl script...
Thanks!