Tuesday, June 30, 2009

More Funny Linux Posters - Or, Part Two

Ahoy,

Another day spent raging against (or in some kind of opposition to) the machine has left me no time to write, if I want to get to know my kids before they grow up ;) I think, given the economy, I may have to break my streak and go to posting 3 or 4 times a week instead of every day (I can't afford to work contracts anymore and I'm not entirely comfortable quitting my full time job and rolling the dice in America's economy just yet ;) I think I'm going to be dropping a 500+ day-or-so streak (I'm too mentally goofed to even add now... yay ;)

Enjoy the rest of the posters. They certainly enjoy you ;)

Cheers,



Ubuntu
Oooobuntu
Please change your password. It smells awful!
Another fake book for idiots who like being called dummies
Alien Idol
God Bless Her




, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Monday, June 29, 2009

Humorous Linux Posters - Part One

A cheerful, bright and sun-shiney Monday to you,

In our ongoing tradition of scouring the web for funny stuff (to make up for actually having to work, which takes away from blog-writing time ;), here's another collection of humor pieces. Posters, actually. The sentence before last was an attempt to sound highbrow while writing about low art. Not that posters are bad, in principal, but... Well, you be the judge :)

BTW, if the Linux Command Reference poster seems out of place, you can rest assured that it is. There's no joke to find in there. The reason we chose it was because of how very little it seems to actually cover. Pity the sysadmin who tries to get by on that amount of advice. It's got some good stuff in there, but it's not a safety-net by any means. Think of it as equivalent to MS Word's "Grammar Checker" to a non-English-speaking American, writing his new resumé. He can get rid of all those red and green underlines, but, in the end, his job application will be completely unreadable and insane. At best, he'll have a shot at landing a job in a special-needs environment ;)

Enjoy the posters, all pictures are copywrite of their respective creators and, as always, Cheers,



RedHat
Look, A Linux Poster!
Go Get 'Em
Gentoo
Fedora
Birds In Black



, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Sunday, June 28, 2009

GloboChem: Hilarious Video From Mr. Show

Happy Sunday :)

SPECIAL NOTE FOR PARENTS: The video embedded in today's post contains effusive amounts of swearing in certain parts. Please don't watch with children present unless you've previewed and approved!

Today's post is way off-topic, but, as some of you may know, I'm a huge fan of Mr. Show and suffered from terrible depression for the entire period following its sudden cancellation and the release of the DVD box set of all 4 seasons. It wasn't all that long between the two, I'll admit, but it was really really hard on my fragile psyche ;) Check out this link for our post featuring another Mr. Show sketch called "The pre-taped call-in show." It's just as funny, if not funnier, and much more family-friendly :)

I hope you enjoy this video. I can't watch it without, at least, laughing on the inside. It runs a bit long, but, if you stay with it, you won't be disappointed.

Pit-Pat loves you ;)

Cheers,







, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Saturday, June 27, 2009

Cool Computer Tricks - Interesting Optical Illusions!

Hey There,

Here's a little something that should be fun for a Saturday: Computer generated optical illusions! Probably everyone who reads this page has had a run in with some sort of optical illusion in their life (on purpose, of course ;) I'm just crossing the middle years of my own existence and I still love these things. And, despite what most everyone has told me to date, even staring at the LCD screen, optical illusions haven't diminished my eyesight. Of course, I'd be hard pressed to stare too long at my old Apple IIc. In fact, just turning that thing on begins to melt my flesh. It's probably a highly dangerous piece of equipment ;) I'll be giving it away soon (to a fellow old-computer aficionado) and (for some masochistic reason) I'll probably really miss it...

I found all of the illusions (and one "neat picture") posted here today over at coolopticalillusions.com. It's a great place to visit and has a huge variety of different illusions and other art and graphics that are just cool (as their site title suggests ;).

Below, I've posted pictures of the standard "spinning circles" illusion (although that's probably not the technical name for it), the Obama Illusion (which is eerily similar to the "Jesus" illusion - and the site has an animated version of it available), the disappearing confetti illusion" (which you should visit their site to check out, since they have three different versions of it which all work slightly differently) and a simple "cool picture" of a snowy grill that looks as though it's a human skull... who can explain why I choose the things I choose? ;)

Hope you enjoy these, and check out coolopticalillusions.com for some serious fun and equally serious eye-strain :)

Cheers,



What happened to Romper Room?

Obama Cures Cancer

Bye Bye

Grillin' Up Skull



, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Friday, June 26, 2009

Warm computer accessories: The perfect gift for Dad!

Hey There,

Hopefully, regular readers will pardon this week's insanity as I've spent most of my free time in a fruitless struggle with Mail2Blogger. I'm going to give up on that until I have lots of time on my hands (and no pent-up aggression left... I should be something like an empty vessel by the time I take it on again ;)

Also, as part of this rambling preamble, I'd like to apologize to the many people who's emails I have yet to reply to (or even get around to reading). As my children grow up, and work continues to come my way, I'm finding less and less time to write decent posts, read emails, maintain my sanity, etc ;) I'm thinking that, soon, I'll probably cut my posting down to 3 or 4 days (pre-set) of the week. Believe it or not, writing fluff to fill those days when I don't have time to crank out any good stuff actually takes more out of me in the long run and then, when it comes time to put up something decent, the end-product is much worse than I'd prefer. Hopefully, some of the stuff I've put up in the meantime has been helpful and/or given you a good laugh (both works, too ;)

With that said, here's another fluff-piece ;) I found all of the pictures (except for the first one) at WarmMouse.info. The site is actually pretty interesting and has lots of useful information on combatting carpal tunnel syndrome. I must admit that it sounds like it's a very painful and annoying condition yet, strangely enough, I've never met anyone who suffers from it and (I've been typing since I was a kid) have yet to be cursed with it. I can't explain why I don't have it, since everything I use to get my work done is ergonomically-challenged (I'm typing this while bent over sideways from the side of the couch on my laptop that I can just barely reach on the ottoman a foot away ;) Perhaps it has to do with the way I always have my work-space set up. The picture below is a pretty accurate representation. It's just missing the keyboard :)

Yes, This is the Maxell commercial from way back when!



In any event, for those of you who don't already have sweaty clammy palms, check out the site above (pictures from it below). They have a computer accessory to warm virtually every computing appendage on your body (that you might reasonably be expected to use. If you end up with carpal tunnel from overindulgence in under-the-table behaviour, they can't help you there. Your best bet in that situation is to see your doctor and tell him you have Tennis Elbow ;)

With warm regards,

Click any of the pictures below and get ready for an edge-of-your-seat thrill-ride that will take you to places you never... okay, they'll just get slightly larger ;)







, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Thursday, June 25, 2009

Can Code And/Or Pictures Be Posted Via Mail2Blogger - Test Number 2

Thursday, June 25, 2009

Revisiting The Command Line Init Script Generator For Linux Or Unix


So far, this experiment in mobile blogging has been a disappointment.  Not much works when you try to work with HTML and the font seems to get screwed up.  I've continued to try and make this a seemless "post via email," but much work is always left at the other end.  I'm leaving this post alone - as sent, with all it's imperfections.  I think, basically, sending a decent post via email using Mail2Blogger will require at least 2 things:

1.  Explicitly encoding text blocks so they're parsed as html and not as plaintext.  This same trap also makes character entity conversion not work since they are, themselves, converted to even more bizarre character entities.
2.  Scripting out actually rewriting the entire Blogger post area in such a fashion, including the uuencoded attachment of any binary files, like video or pictures.

Below are a few smatterings of things I hope make it into this post, including some shell script and a picture.

For reasons that are probably obvious, I'm not really going out there and tooting my own horn about these posts ;)

Enjoy, hopefully :)

b

Cheers,

Creative Commons License
rcscript.sh by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Based on a work at linuxshellaccount.blogspot.com.
Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com.

#!/bin/sh # # Generic Init Script Creator # 2009 - Mike Golvach - eggi@comcast.net # #Creative Commons License rcscript.sh by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License. Based on a work at linuxshellaccount.blogspot.com. Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com. # trap 'rm -f ${init_dir}/${script_name} ${rc3_dir}/${script_name} ${rc0_dir}/${script_name} ${script_name}' 1 2 3 9 15 # Tips for a few command line arguments - setting an argument to zero will not be considered equivalent to not defining it # a. set init_dir to 0 if you don't want any scripts and links setup - set rc3_dir, rc2_dir and/or init_dir to "0" to not create that link/script. # b. If any of the init_dir, rc2_dir and/or rc3_dir variables are not set, they will default to the examples below. # c. options that include 0 in the example do not need to be set and are entirely optional # # init_dir= /etc/init.d or 0 # rc3_dir= /etc/rc3.d or 0 # rc0_dir= /etc/rc0.d or 0 # script_name= myStartScript.sh # program_name= testProgram # fully_qualified_program_name= /usr/local/sbin/testProgram # start_options= "start" or 0 # stop_options= "stop" or 0 # sure_kill= "space delimited list of extra programs to kill" or 0 # common_bin_directory= "place where common binaries are on your system" or defaults to /usr/bin # function usage() { echo echo "Usage: $0 [-h for this help screen]" echo echo "Required switches:" echo "[-n init script name] [-p name of program to control]" echo "[-f controlled program's fully qualified name]" echo echo "Optional switches:" echo "[-i init directory] [-3 rc3.d directory] [-0 rc0.d directory" echo "[-s start options for your program]" echo "[-S stop options for your program]" echo "[-k additional programs to kill on stop - space separated]" echo "[-b common binary directory - defaults to /usr/bin]" echo echo "Be sure to \"double quote\" any switch arguments with spaces!" echo exit 1 } while getopts 0:3:b:f:hi:k:n:p:s:S: option do case $option in 'i') if [[ "$OPT_ARG" == "0" ]] then init_dir=0 else init_dir="$OPTARG" fi ;; '3') if [[ "$OPT_ARG" == "0" ]] then rc3_dir=0 else rc3_dir="$OPTARG" fi ;; '0') if [[ "$OPT_ARG" == "0" ]] then rc0_dir=0 else rc0_dir="$OPTARG" fi ;; 'n') script_name="$OPTARG" ;; 'p') program_name="$OPTARG" ;; 'f') fully_qualified_program_name="$OPTARG" ;; 's') if [[ "$OPT_ARG" == "0" ]] then start_options="" else start_options="$OPTARG" fi ;; 'S') if [[ "$OPT_ARG" == "0" ]] then stop_options="" else stop_options="$OPTARG" fi ;; 'k') if [[ "$OPT_ARG" == "0" ]] then additional_kills="" else additional_kills="$OPTARG" fi ;; 'b') if [[ "$OPT_ARG" == "0" || -z "$OPT_ARG" ]] then common_bin_directory="/usr/bin" else common_bin_directory="$OPTARG" fi ;; 'h') usage ;; *) usage ;; esac done if [[ -z $script_name || -z $program_name || -z $fully_qualified_program_name ]] then echo echo "Options -n -p and -f are required!" usage fi if [[ -z $common_bin_directory ]] then common_bin_directory="/usr/bin" fi if [[ -e $script_name ]] then rm $script_name fi cat << EOM >>$script_name #!/bin/sh # # ${program_name} init script # Usage: $script_name [start|stop|restart] # case \$1 in 'start') echo echo Starting ${program_name}.... echo ${fully_qualified_program_name} ${start_options} >/dev/null 2>&1 & ${program_name}_running=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "${fully_qualified_program_name}"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\` if [ "\$${program_name}_running" == "" ] then echo "${program_name} start cannot be confirmed. Please check" echo "system output and application logs for further detail" else echo "${program_name} started successfully" fi ;; 'stop') echo echo Stopping ${program_name}.... echo if [ "$stop_options" != " " ] then ${fully_qualified_program_name} ${stop_options} >/dev/null 2>&1 & fi ${program_name}_walking=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "${fully_qualified_program_name}"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\` if [ "\$${program_name}_walking" == "" ] then echo "${program_name} does not appear to be running." echo "Process not found. Not shut down." else counter=5 dead="alive" echo "Shutting ${program_name} down." echo "${fully_qualified_program_name} - pid ${program_name}_walking - stopping." while [ \$counter -gt 0 ] do ${program_name}_still_walking=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "${fully_qualified_program_name}"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\` if [ "\$${program_name}_still_walking" != "" ] then echo "killing pid \$${program_name}_still_walking " ${common_bin_directory}/kill \$${program_name}_still_walking counter=\`expr \$counter - 1\` sleep 1 else dead="dead" echo "dead" counter=0 fi done if [ \$dead = "alive" ] then echo "Could not kill process after 5 attempts." echo "Process ${program_name}_walking still active." ${common_bin_directory}/ps -ef|${common_bin_directory}/grep "${fully_qualified_program_name}"|${common_bin_directory}/grep -v grep fi fi EOM if [[ $additional_kills && ! -z $additional_kills ]] then cat << EOM >>$script_name for aks in `echo $additional_kills` do echo echo Stopping \$aks.... echo aks_walking=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "\$aks"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\` if [ "\$aks_walking" == "" ] then echo "\$aks does not appear to be running." echo "Process not found. Not shut down." else counter=5 dead="alive" echo "Shutting \$aks down." echo "\$aks - pid \$aks_walking - stopping." while [ \$counter -gt 0 ] do aks_still_walking=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "\$aks"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\` if [ "\$aks_still_walking" != "" ] then echo "killing pid \$aks_still_walking " ${common_bin_directory}/kill \$aks_still_walking counter=\`expr \$counter - 1\` sleep 1 else dead="dead" echo "dead" counter=0 fi done if [ \$dead = "alive" ] then echo "Could not kill process after 5 attempts." echo "Process \$aks_walking still active." ${common_bin_directory}/ps -ef|${common_bin_directory}/grep "\$aks"|${common_bin_directory}/grep -v grep fi fi done EOM fi cat << EOM >>$script_name ;; 'restart') echo echo ReStarting ${program_name}.... echo \$0 stop \$0 start ;; *) echo "Usage: \$0 [start|stop|restart]" ;; esac EOM ${common_bin_directory}/chmod 750 ${script_name}; ${common_bin_directory}/cp ${script_name} ${init_dir}/${script_name} ${common_bin_directory}/ln -s ${init_dir}/${script_name} ${rc3_dir}/${script_name} ${common_bin_directory}/ln -s ${init_dir}/${script_name} ${rc0_dir}/${script_name} Labels: backup, bpdbjobs, linux, netbackup, perl, report, reporter, reports, script, symantec, unix, veritas




Wednesday, June 24, 2009

Mail2Blogger Test Post 1

Hey there,

Today is a concept post that will be followed up on, based on the functionality of Mail2blogger and some incredible, seeming, deficiencies in its application.  Here is a link to a page about how to
report on NetBackup backup activity which should work, I think.

But last, a few notes:

NOTE: The labels function is probably the biggest binger of this whole wangle-dangle (I'm trying really hard not to swear since I'm this close to putting a gun in my mouth ;)

 

I wonder if the labels functionality can be made to work?  Probably not today, but I think getting the hyperlinks right is good for today.

 

If things go as swimmingly as they have today, I should have the date-mangling finished by tomorrow (For my automated posts over my vacation, I had the posts already written and scheduled to post 3 times each… more on that when I get this figured out.

 

Hopefully, this post will be the start of something that will be of benefit to anyone who searches Google for these answers with the same search strings I do.   BTW, it is widely held that adding tags to your post using Mail2Blogger is impossible.  It's probably true, but I'm too stupid to not try to get it to work ;)

 

Cheers,

 

Mike

 


NOTE: THE LABELS BELOW HAVE BEEN FAKED AND ARE NOT LEGITIMATE LABELS, ALTHOUGH THE FUNCTIONALITY IS EXACTLY THE SAME

backup, bpdbjobs, linux, netbackup, perl, report, reporter, reports, script, symantec, unix, veritas

Tuesday, June 23, 2009

Eclectic And Funny Linux Pictures - Last Day Of Vacation

Hey there,

The last day of vacation is here. Tomorrow (assuming everything has gone to plan) I'll be back in town to either be pleasantly surprised or utterly horrified. And, of course, I'm talking about the blog... Nothing to do with my home life or job ;)

Hope you enjoy the pictures and I can't wait to get back and write something soon. Hopefully, I'll remember how to after going through my backlogged emails (work and play)

Cheers,

NOTE: All pictures are copywrite of their original creators.



Too

many

pictures

not

enough

cutsie

comments




, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Monday, June 22, 2009

Out To Lunch - More Funny Linux Pictures

Hola,

This blog's owner is still on vacation, but hopes to return shortly (and very soon ;)

Hopefully this post is actually making it online. The guy who writes this blog hasn't checked on me in a little while, and, being a simple chunk of text, I have no idea if I'm posting correctly or not... Here's hoping ;)

Enjoy the pictures and, dear author, please come back and take care of me soon!

Cheers,



a

b

c

d

e.  nice comments, huh?

f.  And you thought I'd give this one some effort...



, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Sunday, June 21, 2009

Off-Topic Humor - Chuck Norris On Chuck Norris Facts

Here's hoping you're having a happy and healthy Sunday :)

Today's topic (embedded at the end of the post) is, yet again, Chuck Norris. The video below is from "The Best Damn Sports Show Period," and linked to on the incredibly funny ChrisLawson.net.

Enjoy the video and follow the link trail above. Not much Linux and Unix related stuff (except for one post entitled Linux Programmer or Saddam Hussein! , which may offend some readers other than myself), but packed with tons of hilarity. Check it out. Something on ChrisLawson.net has to make you laugh :)

Cheers,







, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Saturday, June 20, 2009

Another Google Maps Goof. Italian Or Mexican?

Hey there and happy Saturday to you if this gets posted on time,

As some of you may know, I'm on vacation right now and taking a gamble with BlogSpot's post scheduling service. Actually, the scheduling service works just fine, but I like to post before the preceding day and have it show the next day so that I can keep my posts labeled daily and, at the same time, go to sleep before midnight the day before and not have to wake up until the last possible second the day of ;) If this works and anyone has a hard time doing it, let me know and I'll post the method. Of course, I won't know if this experiment has been a success or a failure until the future, which makes it hard for me to get too excited right now (or, am I in the past? ;)

Below is a little something I found over on another blog titled WigBlog. It's got lots of entertaining posts to offer, but I'm just showcasing this one for today. I'd hate to have my experiment not work (as in "not post at all") and waste an in-depth write up.

I've included the picture below, from the post linked to here and above.

Apparently, Google Maps thinks Pizzeria Uno serves Mexican food. I can't wait to check out the new menu ;)

Cheers, and apologies for the "Alternate Text" I put in the picture below. It will probably offend someone, but it struck me as amusing at the time :)



That's A Spicy Meat Burrito



, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Friday, June 19, 2009

More Fun With Google On YouTube!

Happy Friday,

Before I blow town to avoid a pending arrest warrant (or am I just going on a regular family vacation? ;) I put together a few fluff posts so I don't have to worry too much about any mistakes I may have made.

Today, check out a few secret images of Google Earth, How to do the Google Chuck Norris hack and some new hidden Google tricks - also embedded below (except the Google Earth video, which has embedding disabled by request).

My favorite, of course is the Chuck Norris one (as show in our previous post linked to in this looong sentence :)

Cheers,










, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Thursday, June 18, 2009

Some Interesting Google Tricks

Hey there,

I got a little involved in making Visio diagrams today and lost track of time (In just under 8 hours I managed to produce a crude depiction of a full rack in a datacenter). And thank goodness I had the software to help me out. I never would have been able to legitimately waste that much time in a row on my own ;)

So today, I found this video on a site called FunnyHack. The video below is from there and doesn't contain anything below-board that I noticed... It's funny how the opposite of above-board just doesn't sound quite right. The same with the opposite of upper-handed ;)

Enjoy the video and check the site out. A lot of it is Windows-related, but there are quite a few entries over there that appeal to the general public (like how to hack an elevator :)

Cheers,




Google Tips And Tricks - These bloopers are hilarious



, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Wednesday, June 17, 2009

Easily Removing VCS resources From A Running Configuration On Unix Or Linux

Hey there,

Today's post is going to be a bit brief (which is a relative statement. If you've never been here before, this post may seem incredibly long ;). The subject matter (as noted in the Subject ;) deals with how to easily, and safely, remove resources from a running VCS (Veritas Cluster Server) configuration. And, just as a matter of course, I feel I must qualify the previous statement by noting that if you remove a vital resource from your running VCS configuration, no matter how safely and correctly you do it, you may end up with a major headache ;) (Please see our other posts on VCS for Linux or Unix if any part of this run-down requires further explanation. Hopefully, we've already covered it :)

And here we go. The method to doing this is so simple, I will be writing the rest of this post in "Dick and Jane" style. See VCS configuration. See VCS configuration running. See Sysadmin. See Sysadmin answer 15 Instant Messages and respond to 3 emails while fielding questions on a conference call... No. That won't work ;)

Here we go, for real. Removing VCS resources from a running VCS configuration can be extremely simple. In fact, in order to make sure that you not only do it simply, but also correctly, you're going to make use of a file that VCS creates automatically when you save your main.cf file. That file is called "main.cmd" The "main.cmd" file should exist already, but if there's any reason you have to doubt that your main.cmd is correct (or you just don't have one - it should be located in /etc/VRTSvcs/conf/config), you can always create one from the running configuration by doing the following with the "hacf" command (I do this, usually, just to be sure):

host # cp /etc/VRTSvcs/conf/config/main.cf /var/tmp/main.cf
host # hacf -cftocmd /var/tmp


The above sequence of commands will create a file named "main.cmd" in your /var/tmp directory. This file contains every single command line (from the most basic to the most specific) that you would need to completely recreate your VCS configuration (of course, using the "-cmdtocf" flag might be a bit easier ;) As such, you can, of course, also use this file as a guide to easily "add" resources to your running VCS config, but that's beyond the scope of this post. "hacf" also allows you to use the "-dest" option so you can put the main.cmd that you created in a separate location, like so:

host # hacf -cftocmd /var/tmp -dest /home/user1/.

And here's where it gets easy :)

Let's say that you wanted to remove a Veritas disk volume from your running VCS configuration (which would, also, usually mean that you would want to remove the mount point from VCS control and remove any dependencies). Assuming that you know the volume's name, you can find out everything you need to know about the volume and the mountpoint, including dependency linkage, by simply using the "grep" command against your main.cmd file (Note that, even if you don't know your volume's name, you can figure that out just as easily by simply grepping for "Volume" - the VCS resource type, which is case sensitive - in your main.cmd file, and looking for the name of the disk volume that way).

Then let's say that your volume's name is VOL_volume54_host. And let's also say that you have the privilege and means to execute the VCS commands you'll be discovering (I'm heavily fighting a strong Airplane joke urge right now ;)

host # grep VOL_volume54 /var/tmp/main.cmd
hares -add VOL_volume54_host Volume SG_host
hares -modify VOL_volume54_host Critical 0
hares -modify VOL_volume54_host Volume volume54
hares -modify VOL_volume54_host DiskGroup hostdg
hares -modify VOL_volume54_host Enabled 1
hares -link MNT_mount54_host VOL_volume54_host
hares -link VOL_volume54_host DG_hostdg_host


For now, we'll just use this information to find the disk mount (Mount) name and grep for that, as well:

host # grep MNT_mount54_host /var/tmp/main.cmd
hares -add MNT_mount54_host Mount SG_host
hares -modify MNT_mount54_host Critical 0
hares -modify MNT_mount54_host MountPoint "/disk54/files"
hares -modify MNT_mount54_host BlockDevice "/dev/vx/dsk/hostdg/volume54"
hares -modify MNT_mount54_host FSType vxfs
hares -modify MNT_mount54_host MountOpt largefiles
hares -modify MNT_mount54_host FsckOpt "%-y"
hares -modify MNT_mount54_host CkptUmount 1
hares -modify MNT_mount54_host SecondLevelMonitor 0
hares -modify MNT_mount54_host SecondLevelTimeout 30
hares -modify MNT_mount54_host Enabled 1
hares -link MNT_mount54_host VOL_volume54_host
hares -link RANDOMRESOURCE_resourcename_host MNT_mount54_host


Now you'll put these all together in order (I prefer to remove link dependencies first, then remove the mount followed by the volume - doing otherwise may cause problems for you). Note that one dependency link showed up in both greps. You can run the same command twice without doing any harm, but I'm stripping the duplicate out for neatness' sake. You're almost ready to go. At this point, you'll end up with this list of VCS commands (which you shouldn't run, but - if you do, accidentally - won't cause any harm):

hares -link MNT_mount54_host VOL_volume54_host
hares -link VOL_volume54_host DG_hostdg_host
hares -link RANDOMRESOURCE_resourcename_host MNT_mount54_host
hares -add MNT_mount54_host Mount SG_host
hares -modify MNT_mount54_host Critical 0
hares -modify MNT_mount54_host MountPoint "/disk54/files"
hares -modify MNT_mount54_host BlockDevice "/dev/vx/dsk/hostdg/volume54"
hares -modify MNT_mount54_host FSType vxfs
hares -modify MNT_mount54_host MountOpt largefiles
hares -modify MNT_mount54_host FsckOpt "%-y"
hares -modify MNT_mount54_host CkptUmount 1
hares -modify MNT_mount54_host SecondLevelMonitor 0
hares -modify MNT_mount54_host SecondLevelTimeout 30
hares -modify MNT_mount54_host Enabled 1
hares -add VOL_volume54_host Volume SG_host
hares -modify VOL_volume54_host Critical 0
hares -modify VOL_volume54_host Volume volume54
hares -modify VOL_volume54_host DiskGroup hostdg
hares -modify VOL_volume54_host Enabled 1


Now, you'll strip this down and "reverse" the commands. And by "reverse" I mean reverse the intent, and not the order ;) So, all -link options will become -unlink options, etc. This will leave you with the following (we're removing every "unnecessary" command, since, for instance, removing a volume automatically removes all of its attributes):

hares -unlink MNT_mount54_host VOL_volume54_host
hares -unlink VOL_volume54_host DG_hostdg_host
hares -unlink RANDOMRESOURCE_resourcename_host MNT_mount54_host
hares -delete MNT_mount54_host
hares -delete VOL_volume54_host


and that's a much shorter, and much nicer, list. Now all you have to do to remove the resources successfully is to do the following (Also, consider that you may want to shut down VCS on all but the primary node, if possible, so that your new configuration doesn't get overwritten, and that all your secondary, tertiary, etc, VCS nodes do a remote build of the new configuration from your primary node):

host # haconf -makerw
host # hares -unlink MNT_mount54_host VOL_volume54_host
host # hares -unlink VOL_volume54_host DG_hostdg_host
host # hares -unlink RANDOMRESOURCE_resourcename_host MNT_mount54_host
host # hares -delete MNT_mount54_host
host # hares -delete VOL_volume54_host
host # haconf -dump -makero


And you're all set. Easy Peasy :)

Cheers,

, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Tuesday, June 16, 2009

Making Use Of Lazarus' Web Interface On Linux Or Unix

Hey There,

Today's post is a follow up (and, in many respects, a point of closure) to our previous posts on using TCT's unrm to recover lost data and using TCT's Lazarus to make data recovery using TCT's unrm a bit simpler (both posts are filled with sentences even more convoluted than that one ;)

As we noted in those previous posts, Lazarus comes with the option to restore from tagged blocks using an HTML interface (Please see the preceding two posts for any back-explanation. It took two posts to cover all the details, and this post won't benefit from being 6 screen length's longer ;). At first this may seem trivial. In point of fact, it is to a certain degree. Everything that's done for you via the web browser, you could do yourself. However, this might be a bear of a wheel to reinvent ;)

We're using the same recovered data blocks that we used in our first two posts (so everything will tie together nicely if you need to refer back to them) to showcase what the HTML output from Lazarus can produce. Also, one should note that producing the HTML output (in addition to the tagged blocks) didn't seem to add any noticeable time to Lazarus' block-tagging process (which takes so freakin' long, you'll walk away eventually ;) and can be added by simply inserting the "-h" flag into your command line. So:

host # ./lazarus /usr/local/recovery/the_found_file_I_hope

becomes

host # ./lazarus -h /usr/local/recovery/the_found_file_I_hope

NOTE: Although (since we didn't specify on the command line) the default directory for block restoration is under TCT's main directory (the one with bin, etc in it - see the previous post), the main HTML files get created in the directory you named on the command line! In our case: /usr/local/recovery

Below, we're going to walk through a few different ways you can get to your recovered data more easily (or browse through all the stuff you thought you'd gotten rid of or never knew was there ;) using the HTML files created by Lazarus. The first thing to note (which is very easy to see when you do an "ls" on /usr/local/recovery) is that Lazarus creates three main HTML files:

host # ls /usr/local/recovery
the_found_file_I_hope the_found_file_I_hope.html
the_found_file_I_hope.frame.html the_found_file_I_hope.menu.html


You'll want to open the "frame" HTML page so that the upper menu and main screen are both visible. Every single link in the main screen is already created (assuming you've let Lazarus finish ;) in TCT's main directory under the "www" directory. Each block has a frame and a menu HTML page. The main page (when you select a particular hyperlink to a block) is actually just the block itself viewed through a browser. This works out very nicely in some ways, as we'll see below. Enough with the explaining. Let's go :)

The first picture in our gallery is the main screen you'd see (the_found_file_I_hope.frame.html), as brought up on a local browser. The cartoonish arrows and big letters were drawn in by yours truly using The Gimp's line tool. The same with the blanked out parts. It's a much better tool than we make it seem. Thankfully, we don't work in graphic design ;)

Click any of the below Pictures to return them to their original gigantic size :)

The Kids Menu

The next two pictures demonstrate what executable data looks like. It's not very impressive in the browser, but you'll note that the menu allows you to follow blocks of a similar type, so you can just hop from one to the next and note those numbers so you'll have an easier go of recreating a binary executable from its individual blocks (if it spans more than one) when you get back to the command line. Of course, you can do that just as simply by grepping out the block numbers and types from the available files in the blocks directory. Purists may note that one of these "exe" blocks is an "elf" block. I have no idea how Lazarus makes the distinction, but I'm not going to complain about it, either... The next stuff is cooler - I promise :)

Binary makes for good reading
Keep the naughty bits coming

This next picture shows how a recovered HTML block would look (in HTML, but not parsed as such):

html as plaintext: A study in regression

And this picture shows us how a "program" (What it says in the menu) looks like. Every one we found before boredom set in was actually a shell (or someother kind of) script, which would account for the "exe," "elf," and generic "binary" types being represented.

This script was written to distract you

And, neatest of all, most of the pictures we found came up just like this one; no guessing involved (unless your browser's MIME types or associations are set up non-standardly). We have no idea who this picture belonged to. Probably the last guy who used this machine:

Objects in this diagram may be closer than they appear

The moral of the story? I don't suppose there is one, since this is just a demonstration of easy data recovery, but, if this were a morality play, I suppose the moral would be: Be sure to scrub your disk before you leave it behind. Some goofballs may come around later and find stuff you didn't want them to ;)

Hope you enjoyed the slide-show!

Cheers,

, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Monday, June 15, 2009

Command Line Init Script Generator For Linux Or Unix

Hey There,

To start this week off, we've got another updated script (now that we have over 600 some odd posts, we actually have about 400 some odd loose ends to finish up, as well ;) This script is an update of an earlier post we did to showcase a basic init script generator for Linux or Unix, again hearkening back to 2007. How time flies when you're not paying attention to what you're doing ;)

This script includes several updates (which haven't been tested to perfection - so feel free to write in with complaints ;) such as the ability to use command line arguments to specify a wider variety of options, set some to default and not even enter any (except three) if you don't want to. Actually, the only three required arguments are the name of the program you want to start with the init script you generate, the fully qualified name of the same program and the name of the init script itself. All the other options are easily displayed by just running the command without any arguments, like so:

host # ./rcscript.sh

Options -n -p and -f are required!

Usage: ./rcscript.sh [-h for this help screen]

Required switches:
[-n init script name] [-p name of program to control]
[-f controlled program's fully qualified name]

Optional switches:
[-i init directory] [-3 rc3.d directory] [-0 rc0.d directory
[-s start options for your program]
[-S stop options for your program]
[-k additional programs to kill on stop - space separated]
[-b common binary directory - defaults to /usr/bin]

Be sure to "double quote" any switch arguments with spaces!


Hope you enjoy the updates and this script helps you out in some way or fashion :)

Cheers,

Creative Commons License
rcscript.sh by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Based on a work at linuxshellaccount.blogspot.com.
Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com.

#!/bin/sh
#
# Generic Init Script Creator
# 2009 - Mike Golvach - eggi@comcast.net
#
#Creative Commons License
rcscript.sh by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Based on a work at linuxshellaccount.blogspot.com.
Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com.
#

trap 'rm -f ${init_dir}/${script_name} ${rc3_dir}/${script_name} ${rc0_dir}/${script_name} ${script_name}' 1 2 3 9 15

# Tips for a few command line arguments - setting an argument to zero will not be considered equivalent to not defining it
# a. set init_dir to 0 if you don't want any scripts and links setup - set rc3_dir, rc2_dir and/or init_dir to "0" to not create that link/script.
# b. If any of the init_dir, rc2_dir and/or rc3_dir variables are not set, they will default to the examples below.
# c. options that include 0 in the example do not need to be set and are entirely optional
#

# init_dir= /etc/init.d or 0
# rc3_dir= /etc/rc3.d or 0
# rc0_dir= /etc/rc0.d or 0
# script_name= myStartScript.sh
# program_name= testProgram
# fully_qualified_program_name= /usr/local/sbin/testProgram
# start_options= "start" or 0
# stop_options= "stop" or 0
# sure_kill= "space delimited list of extra programs to kill" or 0
# common_bin_directory= "place where common binaries are on your system" or defaults to /usr/bin
#

function usage()
{
echo
echo "Usage: $0 [-h for this help screen]"
echo
echo "Required switches:"
echo "[-n init script name] [-p name of program to control]"
echo "[-f controlled program's fully qualified name]"
echo
echo "Optional switches:"
echo "[-i init directory] [-3 rc3.d directory] [-0 rc0.d directory"
echo "[-s start options for your program]"
echo "[-S stop options for your program]"
echo "[-k additional programs to kill on stop - space separated]"
echo "[-b common binary directory - defaults to /usr/bin]"
echo
echo "Be sure to \"double quote\" any switch arguments with spaces!"
echo
exit 1
}

while getopts 0:3:b:f:hi:k:n:p:s:S: option
do
case $option in
'i')
if [[ "$OPT_ARG" == "0" ]]
then
init_dir=0
else
init_dir="$OPTARG"
fi
;;
'3')
if [[ "$OPT_ARG" == "0" ]]
then
rc3_dir=0
else
rc3_dir="$OPTARG"
fi
;;
'0')
if [[ "$OPT_ARG" == "0" ]]
then
rc0_dir=0
else
rc0_dir="$OPTARG"
fi
;;
'n')
script_name="$OPTARG"
;;
'p')
program_name="$OPTARG"
;;
'f')
fully_qualified_program_name="$OPTARG"
;;
's')
if [[ "$OPT_ARG" == "0" ]]
then
start_options=""
else
start_options="$OPTARG"
fi
;;
'S')
if [[ "$OPT_ARG" == "0" ]]
then
stop_options=""
else
stop_options="$OPTARG"
fi
;;
'k')
if [[ "$OPT_ARG" == "0" ]]
then
additional_kills=""
else
additional_kills="$OPTARG"
fi
;;
'b')
if [[ "$OPT_ARG" == "0" || -z "$OPT_ARG" ]]
then
common_bin_directory="/usr/bin"
else
common_bin_directory="$OPTARG"
fi
;;
'h')
usage
;;
*)
usage
;;
esac
done

if [[ -z $script_name || -z $program_name || -z $fully_qualified_program_name ]]
then
echo
echo "Options -n -p and -f are required!"
usage
fi

if [[ -z $common_bin_directory ]]
then
common_bin_directory="/usr/bin"
fi

if [[ -e $script_name ]]
then
rm $script_name
fi

cat << EOM >>$script_name

#!/bin/sh

#
# ${program_name} init script
# Usage: $script_name [start|stop|restart]
#

case \$1 in
'start')
echo
echo Starting ${program_name}....
echo
${fully_qualified_program_name} ${start_options} >/dev/null 2>&1 &
${program_name}_running=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "${fully_qualified_program_name}"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\`
if [ "\$${program_name}_running" == "" ]
then
echo "${program_name} start cannot be confirmed. Please check"
echo "system output and application logs for further detail"
else
echo "${program_name} started successfully"
fi
;;
'stop')
echo
echo Stopping ${program_name}....
echo
if [ "$stop_options" != " " ]
then
${fully_qualified_program_name} ${stop_options} >/dev/null 2>&1 &
fi
${program_name}_walking=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "${fully_qualified_program_name}"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\`
if [ "\$${program_name}_walking" == "" ]
then
echo "${program_name} does not appear to be running."
echo "Process not found. Not shut down."
else
counter=5
dead="alive"
echo "Shutting ${program_name} down."
echo "${fully_qualified_program_name} - pid ${program_name}_walking - stopping."
while [ \$counter -gt 0 ]
do
${program_name}_still_walking=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "${fully_qualified_program_name}"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\`
if [ "\$${program_name}_still_walking" != "" ]
then
echo "killing pid \$${program_name}_still_walking "
${common_bin_directory}/kill \$${program_name}_still_walking
counter=\`expr \$counter - 1\`
sleep 1
else
dead="dead"
echo "dead"
counter=0
fi
done
if [ \$dead = "alive" ]
then
echo "Could not kill process after 5 attempts."
echo "Process ${program_name}_walking still active."
${common_bin_directory}/ps -ef|${common_bin_directory}/grep "${fully_qualified_program_name}"|${common_bin_directory}/grep -v grep
fi
fi
EOM
if [[ $additional_kills && ! -z $additional_kills ]]
then
cat << EOM >>$script_name
for aks in `echo $additional_kills`
do
echo
echo Stopping \$aks....
echo
aks_walking=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "\$aks"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\`
if [ "\$aks_walking" == "" ]
then
echo "\$aks does not appear to be running."
echo "Process not found. Not shut down."
else
counter=5
dead="alive"
echo "Shutting \$aks down."
echo "\$aks - pid \$aks_walking - stopping."
while [ \$counter -gt 0 ]
do
aks_still_walking=\`${common_bin_directory}/ps -ef|${common_bin_directory}/grep "\$aks"|${common_bin_directory}/grep -v grep|${common_bin_directory}/awk '{print \$2}'\`
if [ "\$aks_still_walking" != "" ]
then
echo "killing pid \$aks_still_walking "
${common_bin_directory}/kill \$aks_still_walking
counter=\`expr \$counter - 1\`
sleep 1
else
dead="dead"
echo "dead"
counter=0
fi
done
if [ \$dead = "alive" ]
then
echo "Could not kill process after 5 attempts."
echo "Process \$aks_walking still active."
${common_bin_directory}/ps -ef|${common_bin_directory}/grep "\$aks"|${common_bin_directory}/grep -v grep
fi
fi
done
EOM
fi
cat << EOM >>$script_name
;;
'restart')
echo
echo ReStarting ${program_name}....
echo
\$0 stop
\$0 start
;;
*)
echo "Usage: \$0 [start|stop|restart]"
;;
esac
EOM

${common_bin_directory}/chmod 750 ${script_name};
${common_bin_directory}/cp ${script_name} ${init_dir}/${script_name}
${common_bin_directory}/ln -s ${init_dir}/${script_name} ${rc3_dir}/${script_name}
${common_bin_directory}/ln -s ${init_dir}/${script_name} ${rc0_dir}/${script_name}


, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Sunday, June 14, 2009

msilaerruS nI tnemirepxE llamS A - dnEkooB A sA tsoP s'yadnuS

Wishing everyone a nice tasty Sunday!

If You haven't guessed Already, This is yesterday's post after being processed by our Backward Web Page Perl Script. Why? Why Not? ;)
Below is another collection of some funny, bizarre and interesting pictures I've found all over the web.

Since I collect these randomly, here and there, I don't remember where I got most of them by the time I set to put them up here. This week, however, I do remember that createdigitalmotion.com hosts the 3-D picture below. I haven't been able to test if it works (since I still don't know where to go to buy those old-style blue/red 3-D specs), but I can almost guarantee you that it will give you a splitting headache if you stare at it for too long ;)

Enjoy the amusing pictures. Try not to laugh out loud, or roll on the floor while laughing your ass off. Your safety is our primary concern ;)

Cheers,

, Mike






















Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Saturday, June 13, 2009

Goofy Linux Pictures - Funny And, Sometimes, Bad For The Eyes

Wishing everyone a nice tasty Saturday!

Below is another collection of some funny, bizarre and interesting pictures I've found all over the web.

Since I collect these randomly, here and there, I don't remember where I got most of them by the time I set to put them up here. This week, however, I do remember that createdigitalmotion.com hosts the 3-D picture below. I haven't been able to test if it works (since I still don't know where to go to buy those old-style blue/red 3-D specs), but I can almost guarantee you that it will give you a splitting headache if you stare at it for too long ;)

Enjoy the amusing pictures. Try not to laugh out loud, or roll on the floor while laughing your ass off. Your safety is our primary concern ;)

Cheers,

, Mike






















Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Friday, June 12, 2009

Yet Another Reason Why Old Computers Are Better

Hey There,

Here's hoping your weekend is starting off well (or will start off well as soon as you get out of the office ;) If you started your weekend last night, God bless you :)

Today I found an interesting blog called Feld Thoughts and a cool page regarding an unexpected return of some of his old computers. Amazingly enough, they all worked flawlessly. Neither one had Microsoft Office 2015 installed yet, but they were old, after all ;)

Checking out the pictures (from the site linked to above), it's kind of sad to think how well things used to be made (I'm not saying that everything that gets produced today is crap ;) and how poorly they seem to be now. "Planned obsolescence" was a phrase we learned in school from old codgers and curmudgeons who were obviously old and bitter and could find nothing better to do than complain. Now, the old coots seem like sages and I'm probably the same age they were back then. And, believe it or not, I feel more negatively about the state of consumer affairs than they probably did (at the time). It seems like today, about 15 minutes after you buy anything, there's a newer version out that you either "have to have" (peer pressure via television, magazines, media, etc - which doesn't work on me for some reason ;) or "have to have" (because the manufacturer stopped making parts before the production life-cycle completed - And, why exactly "do" we need "Windows 7" already, anyway? ;)

One day, I predict, you'll not have the time it takes to lift your ass out of your armchair to purchase whatever the people on TV are telling you you must have immediately, before trends change. I also predict that the word paradigm will no longer have any significant meaning since there will be no time to plot trends with out-of-date hardware/software and dinosaur methodologies (plus, it's a word... words sometimes come from books... books imply that reading - possibly thinking - is going on, and nothing good can come of that ;)

Anyway, enough of my bitching,

Enjoy the pic's below (from the site linked to above) and the remainder of your weekend :)

Cheers,



Old school


Sweet



, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Thursday, June 11, 2009

Dealing With "Permissions on the password database may be too restrictive" Errors On SUSE Linux 10.x

Hey there,

Here's something I ran into for the first time in my life today (and I don't mean the longest frickin' subject line I've ever written ;)

I was working with a colleague, booting up a recently panicked (I'm assuming, since I wasn't involved when "the incident" happened) SUSE Linux 10 system, when we saw the following error:

Login Failed: Permissions on the password database may be too restrictive.

Or something to that effect. Unfortunately, I don't have the screen to cut-and-paste from (not complaining). We ended up getting this error for regular users and administrative users, including root. It seemed like there wasn't an account available that could log in to the box. Eventually the problem was solved, but it was an interesting situation and, perhaps, some of the following troubleshooting information might be of help to you in the future (So you don't have to boot "rescue" off of CD more than once ;)

Here's how it went down (try to contain your excitement. This is edge-of-your-seat stuff, so, please, go to the bathroom before you continue reading ;)

1. The first thing we did was to try logging in with all the accounts we could think of. None of them worked, although we were relatively sure that they were enabled and had worked previously.

2. Then we did the sanity-check that (interestingly) you don't see too many people do any more: We quit trying to login to the default run level (5 - X-Windows) and tried the same logins we did in step 1 on the machine's local console. At this point, we considered that we may have hit some limit on failed login attempts, but quickly discounted that theory, since our logins had been failing from the start. It's also worth mentioning that this was a newer machine and (as it turned out) had not been attacked in any way that might disable passwords from being accepted.

3. Next, we booted off of CD and ran SUSE Linux in "rescue" mode. This gave us a very easy login. Username: root. No password required. Using "lvscan" we were able to to identify the root partition and ran fsck on all available partitions to ensure that no file system corruption existed.

4. Once all the fsck's came back "OK," we mounted /dev/system/root onto a temporary directory (/tmp/root for instance):

host # mkdir /tmp/root
host # mount /dev/system/root /tmp/root


5. Then we changed directories into what would normally be our /etc directory to look for any obvious signs of damage. None could be found. In fact, it seemed as though the error we were getting was completely erroneous:

host # cd /tmp/root/etc
host # ls -l passwd shadow
-rw-r--r-- 1 root root 25729 Jun 10 05:52 passwd
-r-------- 1 root root 14268 Jun 10 05:51 shadow


Those permissions may seem restrictive, but they're actually required so that users' passwords can remain secure. /etc/passwd should be readable by anyone, but the "passwd" program actually runs "setuid root" so that it can verify the user's password by reading the /etc/shadow file:

-rwsr-xr-x 1 root root 27768 Jul 17 2006 /usr/bin/passwd

6. We added our own user id's to the "wheel" group (root was already a member) and rebooted, to see if that would help, but it didn't. That was lame, I know, but much better than finding out later that it was actually the solution and we never tried it ;)

7. Booting up in rescue mode and mounting the root partition again, we took a look at the /tmp/root/etc/sysconfig/permissions file (We couldn't use Yast's X-Window interface, as explained below). It turns out that the line:

PERMISSION_SECURITY=

was set to paranoid for local security!!!! This was easily fixable by changing it back to the least restrictive of settings (you have easy, secure and paranoid to pick from, I believe):

PERMISSION_SECURITY="easy local"

saved that file and rebooted. All was well :)

The Aftermath:

One interesting thing I noted, when taking a look at the problem afterward, was that "paranoid" local settings were actually set on purpose by another admin (the default for our install image was what we reverted back to - "easy local").

This setting seems like a good idea, because, from the documentation I could find, it purports to make it so that the administrator gets to choose which users can run X sessions and "setuid" programs, although (obviously) it should never be set up and not completely finished and tested before leaving it go ;)

One of the major issues is that, if no one is specifically allowed to run X sessions and/or use setuid programs after this setting is enforced and the machine is rebooted, root is included in the accounts that are denied access to these programs.

The X denial is okay. I can live with that. But not allowing root (and every other account) to use setuid programs makes it impossible for anyone to login. The reason for this is actually pretty simple. When login asks for your password, in simplistic terms, it employs "passwd" (a "setuid" program, as shown above) to read your user entry from /etc/shadow and confirm that your password is actually correct. Since no one is allowed to use "setuid" programs, no one (including root) can login (Via X, remotely or even directly on the local console).

Crazy, but fun for a while ;) Hopefully this helps someone out there :)

Cheers,

, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Wednesday, June 10, 2009

Mid-Week Neat Trick - With Proper Attribution

Hey there,

I actually have some stuff to write today, and was going to write it, but while I was trying to figure out an issue at work (that, strangely enough, had absolutely nothing to do with the topic of this post ;), I happened upon a great article, regarding novel uses of dd and text-based web tools like curl and wget, over at omnipotent.net's Linux article section

The trick it describes is one you may have heard of before, or put into practice, but I liked the author's enthusiasm for the subject matter (which comes through in the writing - along with many links to other interesting pieces) and thought I'd table my own meandering thoughts for a day and turn you on to someone else's ;)

I've included the introduction below. Follow this link, or the link at the end of this section, to continue reading. In fact, just click the link. All the really cool stuff follows the opener, although it sets up the mood quite nicely :)

Enjoy and cheers,



Surprisingly, I got quite a bit of response from my last piece, "Stupid Linux Tricks." That article was something I'd dashed off at the last second because I hadn't thought of anything provocative or rant-worthy to write about. Still, it seems to have hit an interesting chord with quite a few people. The idea that the best way to convert a person is to demonstrate some of the incredibly cool, useful, or just plain well-designed stuff about Linux. So, since I'm out of ideas this week too, I'll do something similar -- but instead concentrating on some of the smaller tools and what they can do.
Let's face it: Unix isn't a single, large product -- it's a fantastically modular system. It's so modular, in fact, that every component can in theory be replaced! So much so, that there is no single part of the Unix architecture that can, strictly speaking, be called Unix. The Linux kernel is just an implementation of an API, and an abstraction layer for hardware. That's not Unix. Neither are any of the potentially thousands of programs that make up Solaris, Linux, BSD, or any of the other ones. Any individual component is trivial, and is a part of a larger, cohesive whole.

Within that collective framework of tools, the user learns how to take advantage of them, one by one, learning how they interact and lock together, and their purposes and use. Often, a tool is used for purposes very unlike its intent. Almost frighteningly so, in fact. Very impressively so. Showing someone what these tools, few of which work as well as eye candy, can do to make your life easier is how you "clinch the sale" so to speak. So what if Linux can do all these cool things to impress people? Now you have to show them what it can do to make their lives easier in some small way... CONTINUE READING...




, Mike


Banner for College Student-Oriented Sites (728 version 1)



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Tuesday, June 9, 2009

Intel SQL Modifications For Our NetBackup Backup Reporter Script

Hey There,

Well, I guess it's never to early for an update on a script (most of the times I realize I royally screwed one up occur just minutes after I officially hand it off ;)

Today's update is a follow-up to yesterday's updated NetBackup backup report script for Linux or Unix with Perl. The additions (noted in the comment section at the head of the script) include one user request (support for the Intel SQL module and the Veritas/Symantec required .bch extensioned files) and dusting away a few cobwebs.

Again, if you don't care about the script's output, click here to go straight to the script!

Improvements (I hope ;)

Added:
Support For Intel SQL and OS backups
Reporting of .bch Intel SQL script execution
Explicit close on MAIL file descriptor
Explicit return to STDOUT file descriptor before exit
Minimal signal handling to remove temp file
A bit more error checking and handling

Changed:
Job parsing rule to make exceptiong for .bch files

Modified:
Rule to determine job reporting eligibility

Downsides Noted So Far:
The script now takes about a second and a half to execute on the same system.
I still don't know if it works for everything :)

-------------

Here's some updated output, that you should expect to see (except for the errors, hopefully... ;) Again, you can skip straight to the script by clicking here!



ERROR FREE REPORT - 24 HOUR TIME SPAN - TRUNCATED WITH ELLIPSES...


-------------------
NetBackup Status Report
-----------------------------------------------
Report Span = 06/07/09 ¦ 17:31:47 through 06/08/09 ¦ 17:31:47
-----------------------------------------------


Jobs Completed Successfully!

***************************************************

Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - File List
***************************************************

host123 ¦ Database_Backup ¦ Default-Application-Backup ¦ 25847840 kb ¦ 14.57 min ¦ 06/07/09 ¦ 22:00:37 ¦ 06/07/09 ¦ 22:15:11
/lafjaiefal_1
***************************************************
host123 ¦ Database_Backup ¦ Default-Application-Backup ¦ 387360 kb ¦ 1.85 min ¦ 06/07/09 ¦ 22:17:10 ¦ 06/07/09 ¦ 22:19:01
/eiwoujlsdjf_1
...
***************************************************
host123-v ¦ NBU ¦ Catalog Backup ¦ 56096 kb ¦ 0.13 min ¦ 06/08/09 ¦ 01:08:52 ¦ 06/08/09 ¦ 01:09:00
***************************************************
host123-v ¦ NBU ¦ Catalog Backup ¦ 56864 kb ¦ 0.13 min ¦ 06/07/09 ¦ 22:23:15 ¦ 06/07/09 ¦ 22:23:23
***************************************************
host123-v ¦ NBU ¦ Catalog Backup ¦ 58400 kb ¦ 0.13 min ¦ 06/07/09 ¦ 19:46:09 ¦ 06/07/09 ¦ 19:46:17
***************************************************
host123-v ¦ NBU ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/07/09 ¦ 22:23:25 ¦ 06/07/09 ¦ 22:23:26
***************************************************
host123-v ¦ NBU ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/08/09 ¦ 01:09:01 ¦ 06/08/09 ¦ 01:09:02
***************************************************
host123-v ¦ NBU ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/08/09 ¦ 13:09:02 ¦ 06/08/09 ¦ 13:09:03
***************************************************
host123-v ¦ NBU ¦ image catalog cleanup ¦ 0 kb ¦ 0.03 min ¦ 06/07/09 ¦ 19:46:18 ¦ 06/07/09 ¦ 19:46:20
***************************************************
intelsql1 ¦ INTEL_SQL ¦ Default-Application-Backup ¦ 4832 kb ¦ 0.55 min ¦ 06/07/09 ¦ 19:39:18 ¦ 06/07/09 ¦ 19:39:51
/MEMMISOIE.MSSQL7.DIKKEISKK\\EKKKDISS.db.model.~.7.001of001.20090607203913..C
...
***************************************************
intelsql1 ¦ INTEL_SQL ¦ FULL ¦ 0 kb ¦ 11.18 min ¦ 06/07/09 ¦ 19:30:00 ¦ 06/07/09 ¦ 19:41:11
nbu_sql_script.bch
***************************************************
intelsql1 ¦ INTEL_OS ¦ DAILY ¦ 1607132 kb ¦ 5.18 min ¦ 06/07/09 ¦ 19:30:00 ¦ 06/07/09 ¦ 19:35:11
ALL_LOCAL_DRIVES
***************************************************
intelsql2 ¦ INTEL_OS ¦ DAILY ¦ 2163310 kb ¦ 16.18 min ¦ 06/07/09 ¦ 19:30:00 ¦ 06/07/09 ¦ 19:46:11
ALL_LOCAL_DRIVES
***************************************************

-----------------------------------------------



REPORT WITH ERRORS IN IT - 48 HOUR TIME SPAN - TRUNCATED WITH ELLIPSES...


NetBackup Status Report
-----------------------------------------------
Report Span = 06/06/09 ¦ 17:51:26 through 06/08/09 ¦ 17:51:26
-----------------------------------------------

Jobs With Errors To Report!

***************************************************
Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - Error - File List
***************************************************

host456 ¦ Database_Backup ¦ warm_back ¦ 0 kb ¦ 13.90 min ¦ 06/06/09 ¦ 23:24:02 ¦ 06/06/09 ¦ 23:37:56
ERROR: the backup failed to back up the requested files!!!
/usr/local/bin/warm_backup.sh
***************************************************
host456 ¦ Database_Backup ¦ warm_back ¦ 0 kb ¦ 15.28 min ¦ 06/07/09 ¦ 23:24:09 ¦ 06/07/09 ¦ 23:39:26
ERROR: the backup failed to back up the requested files!!!
/usr/local/bin/warm_backup.sh
***************************************************

-----------------------------------------------

Jobs Completed Successfully!

***************************************************

Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - File List
***************************************************

host456 ¦ Database_Backup ¦ Default-Application-Backup ¦ 12589911 kb ¦ 10.77 min ¦ 06/06/09 ¦ 23:00:20 ¦ 06/06/09 ¦ 23:11:06
/fsladfjf_1_1
***************************************************
host456 ¦ Database_Backup ¦ Default-Application-Backup ¦ 12589911 kb ¦ 10.87 min ¦ 06/07/09 ¦ 23:00:14 ¦ 06/07/09 ¦ 23:11:06
/fajlfasljf_1_1
***************************************************
...
SEE ABOVE :)
***************************************************

-----------------------------------------------





Creative Commons License
bpreport.pl by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Based on a work at linuxshellaccount.blogspot.com.
Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com


#!/usr/bin/perl
#
# bpreport.pl - 2009 Mike Golvach - eggi@comcast.net
#
#bpreport.pl by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License. Based on a work at linuxshellaccount.blogspot.com. Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com.
#
# 06/08/09:
# Added: Support For Intel SQL And OS backups
# Added: Reporting of 0kb .bch Intel SQL script execution
# Added: Explicit close on MAIL file descriptor
# Added: Explicit return to STDOUT file descriptor before exit
# Added: Minimal signal handling to remove temp file
# Added: A bit more error checking and handling
# Modified: Job parsing rule to make exceptiong for .bch files
# Modified: Rule to determine job reporting eligibility
#

$SIG{INT} = \&bail;

$first_tmp = $$;
$offset = $ARGV[0];

if ( -f "tmp.$first_tmp" ) {
unlink("tmp.$first_tmp")
}

if ( $#ARGV != 0 ) {
print "Usage: $0 TimeInSecondsToReportBack\n";
exit(1)
}

$sisosig = system("/usr/openv/netbackup/bin/admincmd/bpdbjobs -all_columns >>tmp.$first_tmp");

if ( $sisosig > 0 ) {
bail();
}

open(FT, "<tmp.$first_tmp");
@all_jobs = <FT>;
close(FT);

if ( -f "tmp.$first_tmp" ) {
unlink("tmp.$first_tmp")
}

$global_error_flag = 0;
$separator = "***************************************************";
$hostname=`hostname`;

foreach $job (@all_jobs) {
@file_list="";
@job = split(/,/, $job);
chomp($job[14]);
if ( $job[14] =~ /^$/ ) {
$job[14] = "0";
}
$error_flag = 0;
$report_time = $job[8];
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($job[8]);
$today = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($job[10]);
chomp($today_end = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday));
if ( $today_end =~ /12\/31\/69/ ) {
$today_end = "JOB IN PROGRESS";
}
$today_span_pre = ( $job[9] / 60 );
$today_span = sprintf("%.2f min", $today_span_pre);
$actual_time = time;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$right_now = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time-$offset);
$back_then = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday);
report_span($report_time, $actual_time, $offset);
next if $dont_report;
if ( $job[3] > 1 ) {
@error_condition = `/usr/openv/netbackup/bin/admincmd/bperror -S $job[3]`;
chomp($error_condition = $error_condition[0]);
$job[3] = $error_condition;
$error_flag = 1;
$global_error_flag = 1;
}
### next if ( $job[6] eq "backuphost" && $job[14] == 0 && ! $error_flag );
next if ( $job[6] eq "backuphost" && ! $error_flag );
$job[$file_list] = $job[31] if ( $job[4] =~ /Intel_SQL/ && $job[5] =~ /FULL/ );
$file_list=32;
$file_list_still_going = 1;
$just_starting = 1;
while ($file_list_still_going) {
if ( ( $job[$file_list] =~ /(\/¦\\¦ALL)/ ) ¦¦ ( $job[4] =~ /Intel_SQL/ & $job[$file_list] =~ /\.bch/ ) ) {
if ( $just_starting ) {
push(@file_list, "$job[$file_list] ");
$file_list++;
$just_starting = 0;
} else {
push(@file_list, "¦ $job[$file_list] ");
$file_list++;
}
} else {
$file_list_still_going = 0;
}
}
if ( ! $job[5] && ! $job[6] ) {
if ( $job[42] =~ /^.*(image catalog cleanup).*$/ ) {
$job[6] = $job[25];
$job[5] = $job[42];
$job[5] =~ s/^.*(image catalog cleanup).*$/$1/;
$job[4] = "NBU";
} else {
$job[5] = "Server UNKNOWN";
$job[4] = "NBU";
}
} elsif ( ! $job[5] && $job[6] ) {
if ( $job[42] =~ /^.*(Catalog Backup).*$/ ) {
$job[6] = $job[25];
$job[5] = $job[42];
$job[5] =~ s/^.*(Catalog Backup).*$/$1/;
$job[4] = "NBU";
} else {
$job[5] = "Policy UNKNOWN";
$job[4] = "NBU";
}
}
if ( $#file_list == 0 ) {
push(@job_successes, "$job[6] ¦ $job[4] ¦ $job[5] ¦ $job[14] kb ¦ $today_span ¦ $today ¦ $today_end\n$separator\n");
} elsif ( $error_flag ) {
push(@job_errors, "$job[6] ¦ $job[4] ¦ $job[5] ¦ $job[14] kb ¦ $today_span ¦ $today ¦ $today_end\nERROR: ${error_condition}!!!\n@{file_list}\n$separator\n");
} else {
push(@job_successes, "$job[6] ¦ $job[4] ¦ $job[5] ¦ $job[14] kb ¦ $today_span ¦ $today ¦ $today_end\n@file_list\n$separator\n");
}
}

$¦=1;

## Don't send out okay mails if everything is fine)
#if ( @job_errors ) {

open(MAIL, "¦/usr/lib/sendmail -t");
select(MAIL);
if ( ( $#job_errors < 0 )&& ( $#job_successes < 0 ) ) {
print "Subject: NO JOBS: $hostname NetBackup Status Report - $right_now\n";
} elsif ( @job_errors ) {
print "Subject: ERRORS: $hostname NetBackup Status Report - $right_now\n";
} else {
print "Subject: ALL OK: $hostname NetBackup Status Report - $right_now\n";
}
print "From: them\@xyz.com\n";
print "Reply-To: us\@xyz.com\n";
print "To: us\@xyz.com\n";
print "\n\n";
print "NetBackup Status Report\n";
print "-----------------------------------------------\n";
print "Report Span = $back_then through $right_now\n";
print "-----------------------------------------------\n";
print "\n";
if ( ( $#job_errors < 0 )&& ( $#job_successes < 0 ) ) {
print "No Activity To Report! Check If NetBackup Is Running!\n";
print "-----------------------------------------------\n";
} else {
if ( @job_errors ) {
print "Jobs With Errors To Report!\n\n$separator\n";
print "Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - Error - File List\n";
print "$separator\n\n";
@job_errors = sort @job_errors;
$job_error_count = @job_errors;
if ( $job_error_count ) {
print "@job_errors\n";
} else {
print "NO ERRORS TO REPORT. REPORT MAY BE IN ERROR!!!\n\n"
}
print "-----------------------------------------------\n";
}
if ( @job_successes ) {
print "\nJobs Completed Successfully!\n\n$separator\n\n";
print "Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - File List\n";
print "$separator\n\n";
@job_successes = sort @job_successes;
print "@job_successes\n";
print "-----------------------------------------------\n";
}
}
select(STDOUT);
close(MAIL);
#} # End of possibly-no-mail section
exit(0);

sub parse_date {

my ($sec,$min,$hour,$mday,$mon,$year,$wday) = @_;
%months = qw(0 Jan 1 Feb 2 Mar 3 Apr 4 May 5 Jun 6 Jul 7 Aug 8 Sep 9 Oct 10 Nov 11 Dec);
%weekdays = qw(0 Sun 1 Mon 2 Tue 3 Wed 4 Thu 5 Fri 6 Sat);
if ( $sec < 10 ) {
$sec = "0" . $sec;
}
if ( $min < 10 ) {
$min = "0" . $min;
}
if ( $hour < 10 ) {
$hour = "0" . $hour;
}
if ( $mday < 10 ) {
$mday = "0" . $mday;
}
if ( $yday < 10 ) {
$yday = "0" . $yday;
}
$mon = $mon + 1;
if ( $mon < 10 ) {
$mon = "0" . $mon;
}
$wday = $weekdays{$wday};
$year = 1900 + $year;
$year =~ s/^..(.*)$/$1/;
$nice_date = "${mon}/${mday}/$year ¦ ${hour}:${min}:$sec";
}

sub report_span {

my ($report_time,$actual_time,$offset) = @_;
$dont_report = 0;
$more_than_offset_hours_old = $actual_time - $report_time;
if ( $more_than_offset_hours_old > $offset ) {
$dont_report = 1;
}
}

sub bail {

print "BAILING\n";
if ( -f "tmp.$first_tmp" ) {
unlink("tmp.$first_tmp")
}
exit(2);
}




, Mike




Banner for College Student-Oriented Sites (728 version 1)





Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Monday, June 8, 2009

NetBackup Backup Report Script

Hey there,

Today we've got an update that's been a while in the coming (mostly because no one ever requested it ;). Back in December of 2007, we put out a Perl script to report on NetBackup backup activity and, today, it's finally being updated.

But first, a few notes:

NOTE: If you don't care about what got updated or seeing any usage statistics and information, the script is tacked on to the end of this post and you can jump to it by clicking here.

VERY SPECIAL NOTE: This script's update has only been tested on Solaris (7,8,9,10) with the regular NetBackup backup and Oracle modules. If anyone runs this against another module (for Windows backups or any other module NetBackup has available) and it doesn't work, please send me (via the email link at the upper right of the page) your /usr/openv/netbackup/bin/admincmd/bpdbjobs -all_columns output (The location of your bpdbjobs binary may differ) for a successful job and a failed one. I'll be happy to update this script to include support for them. Of course, if you do send me that output, please alter any information that may be proprietary and get you in trouble! I promise not to do anything with it, but it's best to play it safe.

Some of the changes incorporated in this update include a check for "Catalog Backup" and "Backup Image Cleanup" jobs as well as checks to make the output more easily and quickly viewable. For instance, in the original script, no status was actually put in the Subject line. In this version, you'll get a status summary ("NO JOBS," "ALL OK" or "ERRORS") as well as the name of the server the report was generated on. Then you can just delete all the email reports you get that report that everything's fine (according to the reporter - Now, I've officially used that word enough to match my keywords. Let's just pray I don't have to use it again ;). And (since it was simple to do and not all of you may need to keep evidence that all was well at one point ;) we added a small - commented out for now - outer loop so you can remove those comments and have the script "only" mail you if there are errors to report(argh!).

Click on the picture below and maybe you'll be able to read those poorly doctored Subject lines ;)

My loyal Subjects

The script is, again, very simple to use. All you need to do is run it from the command line and let it know how far back you want to go for your reporting (Generally, putting this in cron to run once a day and setting the command line offset to 86400 is good enough). Of course, the script can only report (I've stopped counting, now ;) as far back as "bpdbjobs" is set to remember! If you forget how to use it, and don't want to read the first 10 or 15 lines of it, just run it without any arguments and you'll get a "Usage" message.

host # ./bpreport.pl
Usage: ./bpreport.pl TimeInSecondsToReportBack


The output generally looks like the output below and, under moderate load on a system that only does its own backups, it runs in under a second for a day's worth of information (again, this timing would be affected by how much activity is logged on your server in the time span you specify on the command line)

Click the picture below and maybe something really cool will happen... probably not. Most likely the picture will just get larger again ;)

Put out output

Below are some sample report outputs from the three types of reports shown in the "Subjects" picture from way up above, and the command line output directly above. After that, it's the script and we're out, baby ;)

Cheers,

P.S. Please forgive the exclamation marks. Typing in all caps is just so very exciting ;)

Click here to get directly to the script!



SAMPLE EMAIL REPORT WITH ERRORED JOBS - 24 HOUR SPAN!


NetBackup Status Report
-----------------------------------------------
Report Span = 06/06/09 ¦ 13:46:15 through 06/07/09 ¦ 13:46:15
-----------------------------------------------

Jobs With Errors To Report!

***************************************************
Server ¦ Policy ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦End Date ¦ Time - Error - File List
***************************************************

host123 ¦ warm_backup ¦ 0 kb ¦ 13.90 min ¦ 06/06/09 ¦ 23:24:02 ¦ 06/06/09 ¦ 23:37:56
ERROR: the backup failed to back up the requested files!!!
/usr/local/bin/mybackup.sh
***************************************************

-----------------------------------------------

Jobs Completed Successfully!

***************************************************

Server ¦ Policy ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦End Date ¦ Time - File List
***************************************************

host123 ¦ Catalog Backup ¦ 209056 kb ¦ 0.25 min ¦ 06/07/09 ¦ 02:04:35 ¦ 06/07/09 ¦ 02:04:50
***************************************************
host123 ¦ Catalog Backup ¦ 211872 kb ¦ 0.23 min ¦ 06/06/09 ¦ 23:37:52 ¦ 06/06/09 ¦ 23:38:06
***************************************************
host123 ¦ Default-Backup-Policy ¦ 12589911 kb ¦ 10.77 min ¦ 06/06/09 ¦ 23:00:20 ¦ 06/06/09 ¦ 23:11:06
/abcdef_1
***************************************************
host123 ¦ Default-Backup-Policy ¦ 12589911 kb ¦ 11.45 min ¦ 06/06/09 ¦ 23:24:09 ¦ 06/06/09 ¦ 23:35:36
/ghijkl_1
***************************************************
host123 ¦ Default-Backup-Policy ¦ 240761 kb ¦ 0.92 min ¦ 06/06/09 ¦ 23:12:31 ¦ 06/06/09 ¦ 23:13:26
/mnopqr_1
***************************************************
host123 ¦ Default-Backup-Policy ¦ 2759769 kb ¦ 3.77 min ¦ 06/06/09 ¦ 23:00:20 ¦ 06/06/09 ¦ 23:04:06
/stuvwxyz_1
***************************************************
host123 ¦ Default-Backup-Policy ¦ 2759769 kb ¦ 4.28 min ¦ 06/06/09 ¦ 23:24:09 ¦ 06/06/09 ¦ 23:28:26
/abcdef_2
***************************************************
host123 ¦ Default-Backup-Policy ¦ 548 kb ¦ 0.62 min ¦ 06/06/09 ¦ 23:36:49 ¦ 06/06/09 ¦ 23:37:26
/ghijkl_2
***************************************************
host123 ¦ Default-Backup-Policy ¦ 6640326 kb ¦ 8.43 min ¦ 06/06/09 ¦ 23:00:20 ¦ 06/06/09 ¦ 23:08:46
/mnopqr_2
***************************************************
host123 ¦ Default-Backup-Policy ¦ 6640326 kb ¦ 9.12 min ¦ 06/06/09 ¦ 23:24:09 ¦ 06/06/09 ¦ 23:33:16
/stuvwxyz_2
***************************************************
host123 ¦ Default-Backup-Policy ¦ 8547 kb ¦ 0.63 min ¦ 06/06/09 ¦ 23:11:28 ¦ 06/06/09 ¦ 23:12:06
/abcdefghijklm_3
***************************************************
host123 ¦ Default-Backup-Policy ¦ 8547 kb ¦ 0.63 min ¦ 06/06/09 ¦ 23:35:48 ¦ 06/06/09 ¦ 23:36:26
/nopqrstuvwxyz_3
***************************************************
host123 ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/06/09 ¦ 15:19:14 ¦ 06/06/09 ¦ 15:19:15
***************************************************
host123 ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/06/09 ¦ 23:38:08 ¦ 06/06/09 ¦ 23:38:09
***************************************************
host123 ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/07/09 ¦ 02:04:51 ¦ 06/07/09 ¦ 02:04:52
***************************************************
host123-p ¦ Diff-Inc ¦ 3070549 kb ¦ 4.60 min ¦ 06/07/09 ¦ 02:00:00 ¦ 06/07/09 ¦ 02:04:36
/
***************************************************
host123-s ¦ Diff-Inc ¦ 359900 kb ¦ 1.77 min ¦ 06/07/09 ¦ 02:00:00 ¦ 06/07/09 ¦ 02:01:46
/
***************************************************

-----------------------------------------------



SAMPLE EMAIL REPORT WITH NO ERRORED JOBS - 12 HOUR SPAN!


NetBackup Status Report
-----------------------------------------------
Report Span = 06/07/09 ¦ 01:46:22 through 06/07/09 ¦ 13:46:22
-----------------------------------------------


Jobs Completed Successfully!

***************************************************

Server ¦ Policy ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦End Date ¦ Time - File List
***************************************************

host123 ¦ Catalog Backup ¦ 209056 kb ¦ 0.25 min ¦ 06/07/09 ¦ 02:04:35 ¦ 06/07/09 ¦ 02:04:50
***************************************************
host123 ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/07/09 ¦ 02:04:51 ¦ 06/07/09 ¦ 02:04:52
***************************************************
host123-p ¦ Diff-Inc ¦ 3070549 kb ¦ 4.60 min ¦ 06/07/09 ¦ 02:00:00 ¦ 06/07/09 ¦ 02:04:36
/
***************************************************
host123-s ¦ Diff-Inc ¦ 359900 kb ¦ 1.77 min ¦ 06/07/09 ¦ 02:00:00 ¦ 06/07/09 ¦ 02:01:46
/
***************************************************

-----------------------------------------------



SAMPLE EMAIL REPORT WITH NO JOBS AT ALL - 6 HOUR SPAN!


NetBackup Status Report
-----------------------------------------------
Report Span = 06/07/09 ¦ 07:46:49 through 06/07/09 ¦ 13:46:49
-----------------------------------------------

No Activity To Report! Check If NetBackup Is Running!
-----------------------------------------------





Creative Commons License
bpreport.pl by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Based on a work at linuxshellaccount.blogspot.com.
Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com.

#!/usr/bin/perl
#
# bpreport.pl - 2009 Mike Golvach - eggi@comcast.net
#
#bpreport.pl by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License. Based on a work at linuxshellaccount.blogspot.com. Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com.
#

$first_tmp = $$;
$offset = $ARGV[0];

if ( -f "tmp.$first_tmp" ) {
unlink("tmp.$first_tmp")
}

if ( $#ARGV != 0 ) {
print "Usage: $0 TimeInSecondsToReportBack\n";
exit(1)
}

system("/usr/openv/netbackup/bin/admincmd/bpdbjobs -all_columns >>tmp.$first_tmp");

open(FT, "<tmp.$first_tmp");
@all_jobs = <FT>;
close(FT);

if ( -f "tmp.$first_tmp" ) {
unlink("tmp.$first_tmp")
}

$global_error_flag = 0;
$separator = "***************************************************";
$hostname=`hostname`;

foreach $job (@all_jobs) {
@file_list="";
@job = split(/,/, $job);
chomp($job[14]);
if ( $job[14] =~ /^$/ ) {
$job[14] = "0";
}
$error_flag = 0;
$report_time = $job[8];
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($job[8]);
$today = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($job[10]);
chomp($today_end = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday));
if ( $today_end =~ /12\/31\/69/ ) {
$today_end = "JOB IN PROGRESS";
}
$today_span_pre = ( $job[9] / 60 );
$today_span = sprintf("%.2f min", $today_span_pre);
$actual_time = time;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$right_now = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time-$offset);
$back_then = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday);
report_span($report_time, $actual_time, $offset);
next if $dont_report;
if ( $job[3] > 1 ) {
@error_condition = `/usr/openv/netbackup/bin/admincmd/bperror -S $job[3]`;
chomp($error_condition = $error_condition[0]);
$job[3] = $error_condition;
$error_flag = 1;
$global_error_flag = 1;
}
next if ( $job[6] eq "backuphost" && $job[14] == 0 && ! $error_flag );
$file_list=32;
$file_list_still_going = 1;
$just_starting = 1;
while ($file_list_still_going) {
if ( $job[$file_list] =~ /(\/¦\\¦ALL)/ ) {
if ( $just_starting ) {
push(@file_list, "$job[$file_list] ");
$file_list++;
$just_starting = 0;
} else {
push(@file_list, "¦ $job[$file_list] ");
$file_list++;
}
} else {
$file_list_still_going = 0;
}
}
if ( ! $job[5] && ! $job[6] ) {
if ( $job[42] =~ /^.*(image catalog cleanup).*$/ ) {
$job[6] = $job[25];
$job[5] = $job[42];
$job[5] =~ s/^.*(image catalog cleanup).*$/$1/;
} else {
$job[5] = "Server UNKNOWN";
}
} elsif ( ! $job[5] && $job[6] ) {
if ( $job[42] =~ /^.*(Catalog Backup).*$/ ) {
$job[6] = $job[25];
$job[5] = $job[42];
$job[5] =~ s/^.*(Catalog Backup).*$/$1/;
} else {
$job[5] = "Policy UNKNOWN";
}
}
if ( $#file_list == 0 ) {
push(@job_successes, "$job[6] ¦ $job[5] ¦ $job[14] kb ¦ $today_span ¦ $today ¦ $today_end\n$separator\n");
} elsif ( $error_flag ) {
push(@job_errors, "$job[6] ¦ $job[5] ¦ $job[14] kb ¦ $today_span ¦ $today ¦ $today_end\nERROR: ${error_condition}!!!\n@{file_list}\n$separator\n");
} else {
push(@job_successes, "$job[6] ¦ $job[5] ¦ $job[14] kb ¦ $today_span ¦ $today ¦ $today_end\n@file_list\n$separator\n");
}
}

$¦=1;

## Don't send out okay mails if everything is fine)
#if ( @job_errors ) {

open(MAIL, "¦/usr/lib/sendmail -t");
select(MAIL);
if ( ( $#job_errors < 0 )&& ( $#job_successes < 0 ) ) {
print "Subject: NO JOBS: $hostname NetBackup Status Report - $right_now\n";
} elsif ( @job_errors ) {
print "Subject: ERRORS: $hostname NetBackup Status Report - $right_now\n";
} else {
print "Subject: ALL OK: $hostname NetBackup Status Report - $right_now\n";
}
print "From: root\@yourcompany.com\n";
print "Reply-To: you\@yourcompany.com\n";
print "To: you\@yourcompany.com\n";
print "\n\n";
print "NetBackup Status Report\n";
print "-----------------------------------------------\n";
print "Report Span = $back_then through $right_now\n";
print "-----------------------------------------------\n";
print "\n";
if ( ( $#job_errors < 0 )&& ( $#job_successes < 0 ) ) {
print "No Activity To Report! Check If NetBackup Is Running!\n";
print "-----------------------------------------------\n";
} else {
if ( @job_errors ) {
print "Jobs With Errors To Report!\n\n$separator\n";
print "Server ¦ Policy ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦End Date ¦ Time - Error - File List\n";
print "$separator\n\n";
@job_errors = sort @job_errors;
$job_error_count = @job_errors;
if ( $job_error_count ) {
print "@job_errors\n";
} else {
print "NO ERRORS TO REPORT. REPORT MAY BE IN ERROR!!!\n\n"
}
print "-----------------------------------------------\n";
}
if ( @job_successes ) {
print "\nJobs Completed Successfully!\n\n$separator\n\n";
print "Server ¦ Policy ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦End Date ¦ Time - File List\n";
print "$separator\n\n";
@job_successes = sort @job_successes;
print "@job_successes\n";
print "-----------------------------------------------\n";
}
}
#} # End of possibly-no-mail section

sub parse_date {

my ($sec,$min,$hour,$mday,$mon,$year,$wday) = @_;
%months = qw(0 Jan 1 Feb 2 Mar 3 Apr 4 May 5 Jun 6 Jul 7 Aug 8 Sep 9 Oct 10 Nov 11 Dec);
%weekdays = qw(0 Sun 1 Mon 2 Tue 3 Wed 4 Thu 5 Fri 6 Sat);
if ( $sec < 10 ) {
$sec = "0" . $sec;
}
if ( $min < 10 ) {
$min = "0" . $min;
}
if ( $hour < 10 ) {
$hour = "0" . $hour;
}
if ( $mday < 10 ) {
$mday = "0" . $mday;
}
if ( $yday < 10 ) {
$yday = "0" . $yday;
}
$mon = $mon + 1;
if ( $mon < 10 ) {
$mon = "0" . $mon;
}
$wday = $weekdays{$wday};
$year = 1900 + $year;
$year =~ s/^..(.*)$/$1/;
$nice_date = "${mon}/${mday}/$year ¦ ${hour}:${min}:$sec";
}

sub report_span {

my ($report_time,$actual_time,$offset) = @_;
$dont_report = 0;
$more_than_offset_hours_old = $actual_time - $report_time;
if ( $more_than_offset_hours_old > $offset ) {
$dont_report = 1;
}
}


, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Sunday, June 7, 2009

Some Very Strange Accessories

Hey there and a fine Sunday to you,

You may have noticed that today's title specifically doesn't say "Some Very Strange COMPUTER Accessories," since not all of these accouterments are for the home computer. They're all interesting, none the less. How could anyone not be interested in a Rubik's Cube for blind people? ;)

I found this list of oddities (aged, but still bizarre) over at Techeblog.com.

I've included a few pictures of some the interesting stuff over there, but the list is much more extensive and worth, at least, five minutes of your time. Hopefully some of it will make you laugh, even though none of it is a joke :)

Cheers,



Wipe your RSS
Not pretty, but safe
Do not taunt happy fun ball
Cousin of the gas powered transistor radio



, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Saturday, June 6, 2009

Another Joke Server - The SPUD - Much Better Than The Other Gigantic One

Happy Saturday :)

I found another funny "hoax" on the web (Technically, I remembered that I'd found it a long time ago and then forgot to remember that I'd found it ;), even better than that Gigantic Old Server that I was silly enough to not research before I put the picture up here on this blog. In respect to the honesty of this online rag, I'm never going to retract that post and will leave it there, for however long Google lets me, to remind everyone that I'm a frickin' idiot some times (no further comments, please ;)

Enjoy The SPUD Server - They say it's vegetable powered, runs a perverted Linux kernel (keep it away from the kids ;), and that it's a hoax, but, even though a tuber is a type of vegetable, I'm still paranoid about being wrong. But not so much that I won't risk my reputation to get a post out here today ;)

Enjoy the pictures and check out the The main SPUD server site. There are links to a lot of other interesting projects there, as well :)

Cheers,



The Official Logo
The convoluted schematics
It's cute, too



, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Friday, June 5, 2009

The Bourne Shell War On Terror

Hey There,

I'm now, officially, a fan of The Thin Guy's Blog over at blogs.sun.com. At least, I'm officially a fan of the post I'm highlighting here today.

I don't really get too worked up over religion, politics and/or any other subject that most people hold very strong beliefs about (What's the point in having an argument that you can't possibly win? ;), but I thought this post, titled The War On Terror, as viewed from the Bourne shell was funny enough to share and absorb any backlash (that I'm positive I'm going to get) from family and friends.

I've included the basic post below, but you should check out the official page. A lot of the comments offer suggestions for improvement or addition that are just as entertaining :)

Cheers,



The War on Terror


As viewed from the Bourne shell.


$ cd /middle_east
$ ls
Afghanistan   Iraq          Libya         Saudi_Arabia  UAE
Algeria       Israel        Morrocco      Sudan         Yemen
Bahrain       Jordan        Oman          Syria
Egypt         Kuwait        Palestine     Tunisia
Iran          Lebanon       Qatar         Turkey

$ cd Afghanistan
$ ls
bin  Taliban    
$ rm Taliban
rm: Taliban is a directory
$ cd Taliban
$ ls
soldiers
$ rm soldiers
$ cd ..
$ rmdir Taliban
rmdir: directory "Taliban": Directory not empty
$ cd Taliban
$ ls -a
.            ..           .insurgents
$ chown -R USA .*
chown: .insurgents: Not owner
$ cd ..
$ su
Password: *******
# mv Taliban /tmp
# exit
$ ls
bin
$ cd bin
$ ls
laden
$ cd ..
$ rm -r bin/laden
bin/laden: No such file or directory
$ find / -name laden
$
$ su
Password: *******
# mv bin /tmp
# exit
$ pwd
/middle_east/Afghanistan
$ cd /opt/UN
$ ln -s /Bad_Guys/Al_Qaeda /middle_east/Iraq/.
ln: cannot create /middle_east/Iraq/Al_Qaeda: Permission denied
$ su
Password:*******
# ln -s /Bad_Guys/Al_Qaeda /middle_east/Iraq/.
# cd /middle_east/Iraq/Al_Qaeda
Al_Qaeda: does not exist
# rm /middle_east/Iraq/Al_Qaeda
# mkfile 100g /middle_east/Iraq/Al_Qaeda
mkfile: No space left on device
# rm /middle_east/Iraq/Al_Qaeda
# cd /opt/Coalition/Willing
# mkfile 1b /middle_east/Iraq/Al_Qaeda
# chown -R USA:Proof /middle_east/Iraq/Al_Qaeda
#exit
$ cd /middle_east/Iraq
$ ls
saddam
$ ls
saddam
$ ls
saddam
$ ls -a
.            ..           saddam
$ find / -name [Ww][Mm][Dd]
/Korea/North/wMd
$ wall Propaganda.txt
Broadcast Message from USA (pts/1) on USS_Abraham_Lincoln Th May 1st
Mission Accomplished!
$ rm saddam
saddam: No such file or directory
$ find / -name saddam
/var/opt/dictators/spiderhole/saddam
$ wall NewsWorthy.txt
Broadcast Message from USA (pts/1) on Time.Magazine Sat Dec 13
We Got Him!
$ mv /var/opt/dictators/spiderhole/saddam /opt/jail
$ cd /opt/USA
$ cp -Rp Democracy /middle_east/Iraq
$ cd /middle_east/Iraq/Democracy
$ ./install
Install Error: Install failed.  See install_log for details.
$ more install_log
Installed failed!
Prerequisite packages missing
Conflicting package Wahhabism found in /midde_east/Saudi_Arabia
Packages Church and State must be installed separately
File System /PeakOil nearing capacity
Please read the install guide to properly plan your installation.
$


Shirt Update:  New Shirts for sale over at Giant Robot Printing.  Please read here for details.  I will be closing down the CafePress shirt store, but will leave the poster up for sale.  After working with Ken from GRP, there is no way that all that text is going to look good on the CafePress Shirt.  I fully expect to have all the prior shirts returned.


Update:  If you don't get it, go here.





, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Thursday, June 4, 2009

Setting Up A Remote SMTP Relay In Postfix On Linux Or Unix

Hey there,

Too much to do today to write anything with gristle ;)

I did, however, run into an issue with Postfix email SMTP relaying that drove me nuts until I found this link on the web about how to configure postfix to use a remote smtp relay host

I've paraphrased below to save my saviour some bandwidth :)

I hadn't dealt with Postfix in forever and, naturally, assumed that the whole setup was far more complicated than it was, and it ended up costing me a bit of time. Once again, life knocks me down a peg. Pretty soon I won't be sitting so high and mighty ;)

Here's the solution (from the link above) Easy as Pie:

This is a public service message, because when I queried google "configure postfix remote smtphost", I couldn't find anything useful to the question I was trying to answer.

So you're running Linux, and your ISP is filtering traffic on port 25, thus blocking you from sending outgoing mail, and so you want to configure your mailserver to relay all your mail out through your ISP's server, like they want you to. If you're running postfix, this turns out to be very easy -- in /etc/postfix/main.cf, just set the variable:

relayhost = smtp.yourisp.com
then restart postfix (/etc/init.d/postfix restart, as root).

You're welcome.


, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Wednesday, June 3, 2009

Troubleshooting NetBackup Error 6 Failures More Easily

Hey there,

Here's another one for all the NetBackup aficionados out there (in a long list of posts, including our last one on solving NetBackup issues through sheer exhaustion.

This post probably won't be interesting unless you're having this problem or have had it in the past. Also, if you're a woman who is, or may become, pregnant (which I alwasy figured was a polite of saying "not barren"), reading this post may result in a rare but fatal side effect ;) ...Sorry, but I just love pharmaceutical disclaimers in advertising these days. Some guy who's got a severe rash, the sweats, heart palpitations, sudden uncontrollable flatulence, nausea, dizziness and vertigo is actually happy to take on all those side-effects just so he won't get the sniffles anymore. I'm not that positive. I'll deal with my allergies if it means I don't have to wear a colostomy bag ;)

Anyway, on to the meat of the post:

This has probably happened to most folks who've had to set up one of many aspects of NetBackup (new tape drives, new tape robots, new policies, new backup clients, etc). It's the dreaded "Error (6)" which Veritas/Symantec describes as:

host # /usr/openv/netbackup/bin/admincmd/bperror -S 6
the backup failed to back up the requested files
Errors caused the user backup to fail.


This is a perfectly reasonable error message and is probably true for every backup you've ever had that didn't work ;) And, for that very same reason, it can be a headache. Luckily NetBackup is good enough to provide other, more specific, error messages (in the hundreds) to make sure this error generally only applies to fairly specific situations.

You can check out this Veritas Support Page for NetBackup Error 6 that's a good starting point. It covers a bit of what we'll cover here and was actually helpful in nudging me in the right direction on this occasion.

If you ever do get stuck with that error, here's a pretty good way to resolve your issue (no matter what type of policy you're using - Standard, Oracle, etc):

NOTE: All examples are from Solaris 10. While the file locations on most Linux and Unix distro's are exactly the same, things may not be where my examples show they are (...another disclaimer ;)

1. Turn on verbose logging right off the bat. You can start out with specific logging, if you're pretty sure you know what the issue is, but, assuming you're totally lost, you may as well get all the information you can from NetBackup. You can turn off the logging as soon as you've figured out what's wrong and fixed it, by simply undoing what you do in this step:

a. Create the following log directories (some are not in the provided "mklogdir" script to create logging directories) in your NetBackup directory (/usr/openv/netbackup):

host # cd /usr/openv/netbackup
host # mkdir admin bpcompatd bpjava-msvc bpsynth symlogs bpbrm bpdbm bpjava-susvc bptm user_ops bpbrmds bpdm bpjobd vnetd bpcd bphdb bprd vopied


b. Then add the following line to your bp.conf file (no restart of NetBackup is necessary for these changes in logging to take effect):

host # echo "VERBOSE = 1" >>/usr/openv/netbackup/bp.conf

2. Now, kick off the job that's constantly failing with the 6 error (do it via the GUI or using bpadm selecting m, browsing to the policy you need to backup, and then typing i to initiate the manual backup)

3. Once everything fails, you'll have some reading to do. For our purposes we'll assume that your backup policy kicks off a script to run some RMAN backups for Oracle (why not?). The first place to look is in /usr/openv/netbackup/logs/bpcd, and read the log with today's date tagged on the end (probably the only log if you just created these dirs, but maybe not). It's also sometimes easier to just tail this file while you kick off your backup:

NOTE: This output is from one job that fails immediately with error 6. It seems like a lot of nonsense and (in most circumstances) you really don't "need" to pay attention to it all. For instance, if you're getting an error 6, you don't have to worry about the server name comparison, generally, since there are several other error codes that deal with that. For all of its bluster, the only thing we really care about, with regards to error 6 (assuming it's not a canard) is the last line (in italics)

host # cd /usr/openv/netbackup/logs/bpcd
host # tail -100 `ls -1tr|tail -1`
16:47:11.062 [3213] <2> bpcd main: offset to GMT 18000
16:47:11.062 [3213] <2> logconnections: BPCD ACCEPT FROM 10.99.99.216.37567 TO 10.99.99.123.13724
16:47:11.062 [3213] <2> bpcd main: setup_sockopts complete
16:47:11.063 [3213] <2> bpcd peer_hostname: Connection from host vhost1 (10.99.99.216) port 37567
16:47:11.063 [3213] <2> bpcd valid_server: comparing vhost1 and vhost1
16:47:11.064 [3213] <4> bpcd valid_server: hostname comparison succeeded
16:47:11.064 [3213] <2> bpcd main: output socket port number = 1
16:47:11.076 [3213] <2> bpcd main: Duplicated vnetd socket on stderr
16:47:11.076 [3213] <2> bpcd main: <---- NetBackup 6.5 0 ------------initiated
16:47:11.076 [3213] <2> bpcd main: VERBOSE = 0
16:47:11.076 [3213] <2> bpcd main: Not using VxSS authentication with vhost1
16:47:11.078 [3213] <2> bpcd main: BPCD_FORK_CMD_RQST
16:47:11.078 [3213] <2> bpcd main: fork cmd = /usr/openv/netbackup/bin/bptm bptm -unload -dn Drive001 -dp /dev/rmt/0cbn -dk 2000027 -m C03426 -mk 4000033 -mds 8 -alocid 34 -jobid -1243881659 -jm
16:47:11.078 [3213] <2> bpcd main: filter type = -1
16:47:11.078 [3213] <2> bpcd main: backuptime before fork = 0
16:47:11.080 [3213] <2> bpcd exit_bpcd: exit status 0 ----------->exiting
16:47:11.082 [3215] <2> bpcd main: Converting args string into an argv
16:47:11.083 [3215] <2> bpcd main: Done converting args string into an argv
16:47:11.083 [3215] <2> bpcd main: child_args[0] = /usr/openv/netbackup/bin/bptm
16:47:11.083 [3215] <2> bpcd main: child_args[1] = bptm
16:47:11.083 [3215] <2> bpcd main: child_args[2] = -unload
16:47:11.083 [3215] <2> bpcd main: child_args[3] = -dn
16:47:11.083 [3215] <2> bpcd main: child_args[4] = Drive001
16:47:11.083 [3215] <2> bpcd main: child_args[5] = -dp
16:47:11.083 [3215] <2> bpcd main: child_args[6] = /dev/rmt/0cbn
16:47:11.083 [3215] <2> bpcd main: child_args[7] = -dk
16:47:11.083 [3215] <2> bpcd main: child_args[8] = 2000027
16:47:11.083 [3215] <2> bpcd main: child_args[9] = -m
16:47:11.083 [3215] <2> bpcd main: child_args[10] = C03426
16:47:11.083 [3215] <2> bpcd main: child_args[11] = -mk
16:47:11.083 [3215] <2> bpcd main: child_args[12] = 4000033
16:47:11.083 [3215] <2> bpcd main: child_args[13] = -mds
16:47:11.083 [3215] <2> bpcd main: child_args[14] = 8
16:47:11.083 [3215] <2> bpcd main: child_args[15] = -alocid
16:47:11.083 [3215] <2> bpcd main: child_args[16] = 34
16:47:11.083 [3215] <2> bpcd main: child_args[17] = -jobid
16:47:11.083 [3215] <2> bpcd main: child_args[18] = -1243881659
16:47:11.083 [3215] <2> bpcd main: child_args[19] = -jm
16:47:11.083 [3215] <2> bpcd main: Before execvp of command


The "Before execvp of command" line that ends the output usually means that your NetBackup command either ran out of time before it started (not likely, but maybe depending upon your setup - different systems in different time zones might cause this error, or very very very slooow machines) or that it failed to execute because one of the files in the policy doesn't exist. There are plenty of other reasons this could happen, but the latter reason, above, is generally it.

4. Once you've determined that your policy is trying to back up a file that either doesn't exist (or it doesn't have permission to access), the next step is to determine what that file is. The "bphpd" directory we created before will give you very specific information with regards to this as long as you have VERBOSE logging enabled and have created the directory yourself (it doesn't get created by the "mklogdir" script). If you've just created the directory and run your job, there will be three files present (one for stdout, one for stderr and one for both. I always use the one with both - log.060209 in this instance):

host # cd /usr/openv/netbackup/logs/bphpd
host # ls
log.060209 obk_stderr.060209 obk_stdout.060209


Checking out this log can bring you to a resolution very quickly. For instance, in the example for today, our policy was attempting to run an Oracle script (that may very well have had problems itself - you'd go looking at that to make sure it worked at all if you couldn't find the problem in here) that had been entered into the policy with an incorrect name (Doh!):

host # cat log.060209
14:53:38.341 [11086] **LOCALE ERROR** locale not found in file
14:53:38.342 [11086] <2> logparams: -sb -rdbms oracle -S host1 -to 300 -c ORACLE_HOT_BACKUP -s piping_hot_backup -clnt vhost1 -FULL -kl 28 -b vhost1_1243968817 -jobid 135 -shm
14:53:38.342 [11086] <4> bphdb main: INF - setenv NB_ORA_POLICY=ORACLE_HOT_BACKUP
14:53:38.342 [11086] <4> bphdb main: INF - setenv NB_ORA_CLIENT=vhost1
14:53:38.342 [11086] <4> bphdb main: INF - setenv NB_ORA_MODE=B
14:53:38.342 [11086] <4> bphdb main: INF - NB_ORA_POLICY=ORACLE_HOT_BACKUP
14:53:38.342 [11086] <4> bphdb main: INF - NB_ORA_SCHED not defined.
14:53:38.342 [11086] <4> bphdb main: INF - NB_ORA_PC_SCHED=piping_hot_backup
14:53:38.342 [11086] <4> bphdb main: INF - NB_ORA_SERV=host1
14:53:38.342 [11086] <4> bphdb main: INF - NB_ORA_PC_BTYPE not set
14:53:38.342 [11086] <4> bphdb main: INF - setenv NB_ORA_FULL=1
14:53:38.342 [11086] <4> bphdb main: INF - setenv NB_ORA_INCR=0
14:53:38.343 [11086] <4> bphdb main: INF - setenv NB_ORA_CINC=0
14:53:38.343 [11086] <4> bphdb main: INF - setenv NB_ORA_SCHEDULED=1
14:53:38.343 [11086] <4> bphdb sync_server: INF - BACKUP START
14:53:38.343 [11086] <4> bphdb sync_server: INF - CONTINUE BACKUP message received.
14:53:38.343 [11086] <2> bphdb get_filelist: INF - Read filename:
14:53:38.343 [11086] <2> bphdb get_filelist: INF - Read filename:
14:53:38.343 [11086] <4> bphdb do_backup: INF - Processing /usr/local/bin/oraback.sh
14:53:38.345 [11086] <4> bphdb keepalive_timeout: INF - bphdb still working.
14:53:38.345 [11086] <2> bphdb keepalive_timeout: INF - bphdb- Sending a keepalive.
14:53:38.345 [11086] <4> bphdb do_backup: INF - Keepalives will be sent every 150 seconds.
14:53:38.345 [11086] <4> bphdb do_backup: INF - Waiting for the child status.
14:53:38.347 [11087] <4> bphdb do_backup: INF - Child executing /usr/local/bin/oraback.sh
14:53:38.347 [11087] <32> bphdb do_backup: FTL - Child exec of /usr/local/bin/oraback.sh failed.
14:53:38.347 [11087] <32> bphdb do_backup: errno = 2: No such file or directory
14:53:38.347 [11087] <16> bphdb Exit: ERR - bphdb exit status = 29: failed trying to exec a command
...


and there's a lot more where that came from, but the final lines (that we're showing above) indicates our issue very clearly. The file "/usr/local/bin/oraback.sh" does not exist. In fact, the file name is supposed to be "/usr/local/bin/oracleback.sh" (We all make mistakes when we're overworked, underfed and sleep deprived. Lots of people make mistakes while they're operating at 100% capacity. There's no shame in it ;)

5. Changing that attribute in our policy, and rerunning the job results in success! Now it's time to undo everything we did in step 1, assuming we don't have a lot of space for useless debug logs (useless only, of course, if everything is okay, for the most part... I smell another disclaimer coming on ;)

Here's the kicker. While this may seem like a very simplistic breakdown of what's certainly a more complex process, it actually is just that; the result of hours of kicking the tires before finding out that the answer was right under my nose! Like I said; we all make mistakes. There's nothing to be ashamed of. I'm going to go curl up in a ball and twitch for a while now ... ;)

Cheers,

, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Tuesday, June 2, 2009

Happy Birthday Ian! You're 6 Years Old Today :)

Hey There,

This post is dedicated to my son, Ian, who just turned 6 today (well, actually yesterday, but - as most regular readers know - I publish a day in advance. Makes life confusing sometimes ;)

The ASCII art I used as an inspiration for the scripts below was, again, grabbed from Joan Stark's ASCII Art Gallery, which is a great place to find quality ASCII art for almost any occasion.

The second bash script below, as usual, contains X's where spaces should be, so you don't get a bad pull from a copy/paste off of the web page.

Not much more to say except:

Click the greeting below to see it in IMAX ;)

Happy Big Number Six!

Cheers,


Creative Commons License


This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License



#!/bin/bash

#
# ibday.sh - Happy Birthday Ian!
#
# 2009 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

echo -ne "\n ~ ~\n * * * *\n * *\n ~ * * ~ * \n * ~ * * ~\n ) ( ) *\n * ~ (_) (_) (_) *\n * # ) ) # ( # *\n _ .-#(_)- -(_)# - - -(_)#-. _ \n * .' # # # # # # \`. ~ *\n : # # # : \n ~ :. # # # .: *\n * | \`-.__ __.-' | *\n | \`\`\`\`\`\"\"\"\"\"\"\"\"\"\"\"\`\`\`\`\` | *\n * | | ||\ |~)|~)\ / | \n | |~||~\|~ |~ | | ~\n ~ * | | * \n | |~)||~)~|~| ||~\|\ \ / | *\n * _.-| |~)||~\ | |~|| /|~\ | |-._ \n .' '. ~ ~ .' \`. *\n jgs : \`-.__ __.-' :\n \`. \`\`\`\`\`\"\"\"\"\"\"\"\"\"\"\"\`\`\`\`\` .'\n \`-.._ _..-'\n \`\`\`\`\`\"\"\"\"-----------\"\"\"\"\`\`\`\`\`\n\n # #\n # # ## ##### ##### # #\n # # # # # # # # # #\n ####### # # # # # # #\n # # ###### ##### ##### #\n # # # # # # #\n # # # # # # #\n \n ######\n # # # ##### ##### # # ##### ## # #\n # # # # # # # # # # # # # #\n ###### # # # # ###### # # # # #\n # # # ##### # # # # # ###### #\n # # # # # # # # # # # # #\n ###### # # # # # # ##### # # #\n \n ### # # #\n # # # ## #\n # # # # # #\n # # # # # #\n # ####### # # #\n # # # # ##\n ### # # # #\n \n # #\n ### ###\n # #\n \n # #\n # #\n # #\n ###\n"



#!/bin/bash

#
# xbday.sh - Happy Birthday Ian!
#
# 2009 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

echo -ne "\nXXXXXXXXXXX~XXXXXXXXXXXXXXXXXX~\nXXXXX*XXXXXXXXXXXXXXXXXXX*XXXXXXXXXXXXXXXX*XXXXXXX*\nXXXXXXXXXXXXXXXXXX*XXXXXXXXXXXXXXX*\nXX~XXXXXXX*XXXXXXXXXXXXXXXX*XXXXXXXXX~XXXX*XXXXXXXXXX\nXXXXXXXXXXXXXX*XXXXXXX~XXXXXXXX*XXXXXXXXXXXXXX*XXX~\nXXXXXXXXXXXXXXXXXX)XXXXXXXXX(XXXXXXXXX)XXXXXXXXXXXXXX*\nXXXX*XXXX~XXXXXXX(_)XXXXXXX(_)XXXXXXX(_)XXXX*\nXXXXXXXXXXX*XXXXXX#X)XXXXX)X#XXXXXXX(X#XXXXXXXXXXX*\nXXXXXXXXXXXXXX_X.-#(_)-X-(_)#X-X-X-(_)#-.X_XXXX\nXX*XXXXXXXXX.'XXXX#X#XXXXX#X#XXXXXXX#X#XXXX\`.XXX~XXXXX*\nXXXXXXXXXXX:XXXXXXXX#XXXXX#XXXXXXXXX#XXXXXXXX:XXX\nXXXX~XXXXXX:.XXXXXXX#XXXXX#XXXXXXXXX#XXXXXXX.:XXXXXX*\nXXXXXXXX*XX|X\`-.__XXXXXXXXXXXXXXXXXXXXX__.-'X|X*\nXXXXXXXXXXX|XXXXXX\`\`\`\`\`\"\"\"\"\"\"\"\"\"\"\"\`\`\`\`\`XXXXXX|XXXXXXXXX*\nXXXXX*XXXXX|XXXXXXXXX|X||\X|~)|~)\X/XXXXXXXXX|XXXX\nXXXXXXXXXXX|XXXXXXXXX|~||~\|~X|~XX|XXXXXXXXXX|XXXXXXX~\nXXX~XXX*XXX|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|X*X\nXXXXXXXXXXX|XXXXXX|~)||~)~|~|X||~\|\X\X/XXXXX|XXXXXXXXX*\nXXX*XXXX_.-|XXXXXX|~)||~\X|X|~||X/|~\X|XXXXXX|-._XX\nXXXXXX.'XXX'.XXXXXX~XXXXXXXXXXXX~XXXXXXXXXXX.'XXX\`.XX*\nXXjgsX:XXXXXX\`-.__XXXXXXXXXXXXXXXXXXXXX__.-'XXXXXX:\nXXXXXXX\`.XXXXXXXXX\`\`\`\`\`\"\"\"\"\"\"\"\"\"\"\"\`\`\`\`\`XXXXXXXXX.'\nXXXXXXXXX\`-.._XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_..-'\nXXXXXXXXXXXXXX\`\`\`\`\`\"\"\"\"-----------\"\"\"\"\`\`\`\`\`\n\nXXXXXXXXXXX#XXXXX#\nXXXXXXXXXXX#XXXXX#XXXX##XXXX#####XXX#####XXXX#XXX#\nXXXXXXXXXXX#XXXXX#XXX#XX#XXX#XXXX#XX#XXXX#XXXX#X#\nXXXXXXXXXXX#######XX#XXXX#XX#XXXX#XX#XXXX#XXXXX#\nXXXXXXXXXXX#XXXXX#XX######XX#####XXX#####XXXXXX#\nXXXXXXXXXXX#XXXXX#XX#XXXX#XX#XXXXXXX#XXXXXXXXXX#\nXXXXXXXXXXX#XXXXX#XX#XXXX#XX#XXXXXXX#XXXXXXXXXX#\nXXXXX\nXXX######\nXXX#XXXXX#XXXXX#XXXX#####XXXX#####XX#XXXX#XX#####XXXXX##XXXXX#XXX#\nXXX#XXXXX#XXXXX#XXXX#XXXX#XXXXX#XXXX#XXXX#XX#XXXX#XXX#XX#XXXXX#X#\nXXX######XXXXXX#XXXX#XXXX#XXXXX#XXXX######XX#XXXX#XX#XXXX#XXXXX#\nXXX#XXXXX#XXXXX#XXXX#####XXXXXX#XXXX#XXXX#XX#XXXX#XX######XXXXX#\nXXX#XXXXX#XXXXX#XXXX#XXX#XXXXXX#XXXX#XXXX#XX#XXXX#XX#XXXX#XXXXX#\nXXX######XXXXXX#XXXX#XXXX#XXXXX#XXXX#XXXX#XX#####XXX#XXXX#XXXXX#\nXXXXX\nXXXXXXXXXXXXXXX###XXXXXX#XXXX#XXXXX#\nXXXXXXXXXXXXXXXX#XXXXXX#X#XXX##XXXX#\nXXXXXXXXXXXXXXXX#XXXXX#XXX#XX#X#XXX#\nXXXXXXXXXXXXXXXX#XXXX#XXXXX#X#XX#XX#\nXXXXXXXXXXXXXXXX#XXXX#######X#XXX#X#\nXXXXXXXXXXXXXXXX#XXXX#XXXXX#X#XXXX##\nXXXXXXXXXXXXXXX###XXX#XXXXX#X#XXXXX#\nXXXXX\nXXXXXXXXXXXXXXXXXXXXXX#XXX#\nXXXXXXXXXXXXXXXXXXXXX###X###\nXXXXXXXXXXXXXXXXXXXXXX#XXX#\nXXXXXXXXXXXXXXXXX\nXXXXXXXXXXXXXXXXXXXXX#XXXXX#\nXXXXXXXXXXXXXXXXXXXXX#XXXXX#\nXXXXXXXXXXXXXXXXXXXXXX#XXX#\nXXXXXXXXXXXXXXXXXXXXXXX###\n"




, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Monday, June 1, 2009

Fixing NetBackup Media Management Issues Through Mental Exhaustion

Hey there,

If you're ever setting up a new NetBackup server, and you're pretty sure you've done everything correctly, you very well may have ;)

Today's post is drawn directly from the 3 or 4 hours of insanity I went through trying to fix a broken setup "correctly" (which may work for you :) and then the neat little trick I pulled, as a last ditch effort, that actually ended up solving the problem. This is somewhat of an informal post, so if any of the steps I describe below aren't specific enough, check out our other posts on NetBackup troubleshooting and Set up (and other NetBackup Tips - with some bleed-over) where we've spent more time on the nitty-gritty :)

Note: I spent a lot of time reading NetBackup forums on and off of Veritas' site (or is it Symantec now? Nothing's changed ;) and some of the help will be very valuable to me in the future, I'm sure. However, and this drives me nuts, about 80% of the time, if I found someone who had the "exact" same problem as me, the responses were either:

1. Non-existent. A bummer, but, actually, somewhat comforting, since I could feel like no on else in the world knew what the fuck the deal was with that problem ;)

2. Argumentative and off-topic. This, I will never understand. Not so much that people will write random replies (often spiteful) that are of no use to anyone whatsoever, but that forum moderators (especially on the official NBU site) don't just delete that crap. I realize that reading someone else's opinionated bullshit is absolutely free and I don't "have to read it" (just like everyone who reads this blog is free to check out another web site at any time ;), but I question a world in which opinion, itself, is elevated above substance in the improper venue. If there isn't one out there already, I'm going to start a forum for people who need to vent. I'll keep the topics legitimate sounding, but the whole site will be all about belittling your fellow man for no reason any more noble than inflating your own floundering and pathetic ego. Is that the sound of hate mail, already? ;)

Anyway, back to NetBackup.

THE PROBLEM: All systems came up good. Drives recognized at the OS and Software layer and everything, seemingly, good to go. Unfortunately, every backup resulted in an error 96 (Unable to allocate new media for backup). This was on a server that had been setup in a disciplined manner (I must qualify that with "I think" since I didn't verify that folks were actually following procedure, but the build was close enough that they almost "had" to be) and it actually did have fresh media to allocate).

The Problem's (somewhat) human translation: The EMM (Enterprise Media Manager) database cannot find an entry for any of the media in your tape robot that it can use to satisfy your request for a backup. On a good day, the solution may be as easy as just inventorying your robot (using the "update" flag or checkbox) or reassigning your tapes to the volume pools that your policies belong to).

Assuming that's not the issue, they recommend that you get rid of everything and re-add it. Although this sounds like a big pain in the ass, it's really not that bad of an idea, and makes sense. Especially since I was working with a new setup and didn't have to worry about preserving any old backups. Burn it all down and rebuild. No problem :)

Rather than lifting, and rewording, the content from This Veritas Knowledge Base Page For Error 96, I would suggest you check out that page first if you run into this issue (It's a good jumping off point to various other avenues if your problem doesn't get resolved, as it has a few tests that may help narrow down your issue). I visited a number of other helpful places, but most of the stuff I ended up doing there didn't help me (today) and I don't want this post to get too confusing.

And finally...

THE SOLUTION THAT WORKED FOR ME: After trying to expire media and having NetBackup tell me that it wasn't in the EMM database, and then trying to add it to the EMM database and having the EMM database complain that an entry for the media already existed (a contrary position that I arrived at by taking many different paths ;), I eventually threw my hand up in the air (not literally) and just deleted the "volume group" that all the "volume pools" belonged to, because it was the single stupidest thing I could think of doing at the time ;)

As it turns out, once I whacked that thing (the only volume group we had), my next plaintive re-inventory actually updated the robot. Of course, after doing that, none of the tapes belonged to any of our volume groups anymore, but all I had to do was add the media back to their respective volume groups and, lo and behold, backups started working.

The moral of the story? Don't be afraid to give up. Every once in a while, it works ;)

Cheers,

, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.