Operating System - HP-UX
1825768 Members
3481 Online
109687 Solutions
New Discussion

Re: List of common mistakes

 
SOLVED
Go to solution
Manoj1
Advisor

Re: List of common mistakes

Hi Hakki,

Do you mean fully qualified domain name with ?

#hostname

For example:
#hostname monster.abc.com

Right ??

vishnu.khandare
Respected Contributor

Re: List of common mistakes

Hi Manoj,

Its just hostname of server
#hostname server_name

This one is correct.


Regards
Vishnu Khandare
You should deserve before U desire!!!!
Steven E. Protter
Exalted Contributor

Re: List of common mistakes

Shalom,

Know thy host name.

I was just asked today what my most embarrassing mistake was in systems administration.

That was while supposedly vetting a patch set in the sandbox, actually installing it in production with reboot during business hours.


Things like that happen more often than you imagine.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Raj D.
Honored Contributor

Re: List of common mistakes

Manoj,
Also few good points:

1. Be careful about the right click , when you are using putty session(s):
It can paste all the buffer contents with a wrong right click, and can damage if you have root session open.

One example: one fine morning we found that none of the LVM commands are working. Like vgdisplay , lvdisplay , lvcreate nothing works and giving error. After reviewing we found that all the files are 0 byte.
Later found by mistake pasting of ">" character did the damage.



2. Take system config backup before any activity ,like reboot, or upgrade or scheduled maintenance or hardware upgrade :
If the config data taken prior the activity the verification would be easy after the system is backup up, and eliminates confusions. There are many scripts sysinfo, infoc , nickel collector etc are available that can quickly collect system info before any activity.



3. Track/preserver historical filesystem config data to resolve problem quickly:
Suppose you got a ticket that /var is 95% in your server.
If you have bdf output , archived offsite, %, you can easily track how much it was earlier before it is 95% , so you can take an action quickly. And troubleshooting flowchart would be simple.
- If it was earlier just 94% , so you will know only 1% increased and you will try to reduce 1% or 2% only.
- Suppose If it was 60% earlier, then you will think oh something really filled up the file system, and the hunt for large files will begin,
- Sometime application or backup/restore restores something by mistake on root or vg00 filesystems, so that can also be tracked.


for now these three ,

Enjoy, Have fun!,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
Patrick Wallek
Honored Contributor

Re: List of common mistakes

1) Being in too much of a hurry to do something and making a careless mistake.

2) Panicking when something goes wrong and rushing to try to fix something when you don't know the real problem. (Management standing over your shoulder and asking 'When will it be fixed?' can be a big cause!)

3) Not reading complete error messages.

4) Not using support when there's a problem. You likely pay HP, or someone, for support. Use it. That's why you pay them.
Anshumali
Esteemed Contributor

Re: List of common mistakes

avoid @ in passwords..
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Ralph Grothe
Honored Contributor

Re: List of common mistakes

The perils of shell globs as command arguments (especially in connection with potentially highly destructive commands) have been already mentioned by many foreposters.
So when in doubt how the shell would expand those globs it is often advisable to have a "dry-run" in advance to see what would get obliterated by prepending an echo statement to the command line (provided the expansion wouldn't affect hundreds of files which would impair readability).
As we most likely all make use of the shells' keystroke history feature such a practise can generally be easily exercised.
Madness, thy name is system administration
Dennis Handly
Acclaimed Contributor

Re: List of common mistakes

>MK: This is true for all files, including directories.

Except directories can't be removed if they still have files in them.
But if you are saying that you can remove the directory out from under yourself, I've had that happen to me.
Manoj1
Advisor

Re: List of common mistakes

Is there a best way to avoid mistake by
copy pasting the commands using mouse on PUTTY session ?
James R. Ferguson
Acclaimed Contributor

Re: List of common mistakes

Hi:

Two practices that I use constantly:

Remove (or truncate with '>' or 'cat /dev/null >' the shell history file ('.sh_history') that contains the 'reboot' or 'shutdown' command from you last use. This prevents inadvertent command recall and re-execution if you move too quickly.

Get in the habit of using 'set -u' in your shell scripts. This makes unset parameters an error when substituting. What you want to avoid is running a script where you *think* a variable has been set, but it hasn't been and you do something like:

# rm -r /${MYPATH}

If '${MYPATH}' is empty, you just removed everything under the root directory. Ignite, anyone?

Regards!

...JRF...
Raj D.
Honored Contributor

Re: List of common mistakes

Manoj,

> Is there a best way to avoid mistake by
copy pasting the commands using mouse on PUTTY session ?

- If you are trying to run some commands and may be really long commands from your desktop to putty, and trying to paste them, try getting them first on a file ,and then analyze the commands and then you can paste.
- Best open a vi session. $ vi temp-cmds
- ": se noai"
- "right click" , it will paste
- save and review the file. And you can select and paste for actual execution.
(- Remeber there is a chance of getting garbage character when pasting to putty, like "-" "converts to "." etc. so reviewing the pasted commands in vi, before actual executing would fix that.)


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Manoj1
Advisor

Re: List of common mistakes

Anshumali, Is there any reason we should be avoiding @ in password ?
Patrick Wallek
Honored Contributor

Re: List of common mistakes

>>Is there any reason we should be avoiding @ in password

It can have a special meaning to the TTY, especially if you are logging into a serial attached terminal (console).

From the WARNINGS section of the passwd man page:

*****
Avoid password characters which have special meaning to the tty driver, such as # (erase) and @ (kill). You may not be able to login with these characters.
*****
R.K. #
Honored Contributor

Re: List of common mistakes

Hi Manoj,

> Is there any reason we should be avoiding @ in password ?
When logging in, the backspace key will NOT work (if you have mis-typed), use the # key to backspace one character at a time, or use @ to erase the line and start again.
This is why these characters are NOT allowed as part of your login name or password.



Another tip: There are a number of commands which can be run in "preview" mode like vgexport, swinstall, vgscan, make_tape_recovery etc. So, before actually running/executing these commands you can always run them in preview mode to see the outcome. If everything is fine, you can remove "p" and use rest of the command.

Example:
# vgscan -p
(here "p" is for preview mode)

Don't fix what ain't broke
AnthonySN
Respected Contributor

Re: List of common mistakes

be carfull with the tar command the only difference between a backup and restore is just c and x.

if doing any lvm changes in cluster systems have a proper vg map file backup before and after changes.


All men make mistakes, but only wise men learn from their mistakes -- Winston Churchill.

Ismail Azad
Esteemed Contributor

Re: List of common mistakes

Manoj,

Do not create manipulative symbolic links like one between rm and dir,

While configuring DNS, never forget to get into the /etc/named.data file. Know exactly when to give a character or block device file especially for LVM and file systems.Avoid use of Legacy DSFs if you are using v3. Do not do an fuser -ck /var on a production system. Never execute an rm -rf /*. Do not corrupt the startup scripts or accidently remove the kernel executable.While booting from BCH prompt give the right path of the boot device.
Use set_parms with care. Do not unplumb an active interface.

Regards
Ismail
Read, read and read... Then read again until you read "between the lines".....