Archive for May, 2008

Verify reboot and oracle process with Perl Script

Posted in Linux, Perl Scripts, Tutorials/Whitepapers with tags , , , , on May 22, 2008 by triz

Here is a script I wrote that I will run in cron on the days that we have autosys reboot schedules. The script will check if the server has been rebooted in the last 2 hours and if it’s rebooted in the last 24 hours. It also checks to see if Oracle processes are running. In the case that either the reboot failed or the Oracle processes did restart or aren’t running it will send an e-mail notification to whoever is specified in the @to array variable. Read more »

Change ownership of files and directories with Perl script

Posted in Linux, Perl Scripts, Tutorials/Whitepapers, Windows with tags on May 12, 2008 by triz

I came across this method of changing the ownership of files when working on a DataStage startup/shutdown script and changing the permissions on the logfiles the script creates. So I wrote a simple script that takes a username from input and a file name or multiple names from input and changes the owner and group of that directory. Read more »

A Perl script called logHunter.pl

Posted in Linux, Perl Scripts, Tutorials/Whitepapers, Windows with tags on May 12, 2008 by triz

Ok here is a perl script that is pretty much useless in Linux, becuase linux has the grep command, but I’m a geek so I wrote it anyways. Hey, it could be usefull in windows…lol. So if you haven’t figured it out yet, this script will look thru a file for keywords and only print out the lines that contain the keyword. Of course you could also just output the results to a new file. Read more »

Monitor processes in Linux using Perl script

Posted in Linux, Perl Scripts, Tutorials/Whitepapers with tags on May 12, 2008 by triz

This is another perl script I wrote to monitor critical processes in Linux and report status to log. This script is alot like the earlier script I wrote to check mount points in that it opens a command and write it to a file in order to use regular expressions to check if something is true or not. Also this script can be edited to monitor any number of process and report it any number of ways including syslog, Nagios, or just system mail. Read more »

Check mount points with Perl script

Posted in Linux, Perl Scripts, Tutorials/Whitepapers with tags on May 3, 2008 by triz

Here is my script I wrote to possibly add to the cron job to check and mount… mount points.

#!/usr/bin/perl -w
#
# Name: chkMounts.pl
# written by trizsolo
# Usage: ./chkMounts.pl args args args
#you can check as many mount points as needed
#with arguments or use defaults
################################### Read more »