hpux
Enabling locked accounts in HPUX
Submitted by madvip on Mon, 05/19/2008 - 07:18.You can’t use vi to re-enable an account if you are using password aging or “trusted” password databases, and the user is aged out or locked out due to too many login failures.
To enable a disabled HP-UX account via the command line, run one of these commands:
/usr/lbin/modprpw -l -k username /usr/lbin/modprpw -l -x username
Is my OS / Oracle running 32-bit or 64-bit software?
Submitted by madvip on Mon, 04/14/2008 - 17:00.DBAs often need to know if they should install Oracle 32-bit or 64-bit software on a given server. If the operating system support 64-bit applications, the 64-bit Oracle distribution can be loaded. Otherwise, the 32-bit distribution must be installed. The following Unix commands will tell you whether your OS is running 32-bits or 64-bits:
Solaris - isainfo -v (this command doesn't exist on Solaris 2.6 because it is only 32-bits) HP-UX - getconf KERNEL_BITS AIX - bootinfo -K
Enabling Largefile support on HPUX
Submitted by madvip on Wed, 03/05/2008 - 11:10.This morning I tried to uncompress an Oracle dump file which was quite big (around 3.5GB) and to my dismay I was greeted by the following error:
# time uncompress bigfile.dmp.Z bigfile.dmp: File too large real 3:05.3 user 2:21.9 sys 18.4
After some research I found out that my vxfs filesystem didn't support large files. To enable largefile system support:
# /usr/lib/fs/vxfs/fsadm -o largefiles / Example: # /usr/lib/fs/vxfs/fsadm -o largefiles /u12
To verify that the largefiles flag is enabled:
Flush sendmail queue
Submitted by madvip on Fri, 02/22/2008 - 15:18.I just found out about this feature for flushing the sendmail queue. This is useful if, say, your mail server was down all weekend and you JUST CAN'T WAIT for the normal queue flush to occur because you've gone through email withdrawal by not being connected for a couple days. In the event that you, say, just rebuilt your mail server and wanted to make sure everything was working correctly you'd also want to watch the queue as it's processing. Normally you'd just run the following to flush the queue and see the results:
/usr/sbin/sendmail -q -v
Script to email changes in a file
Submitted by madvip on Fri, 02/01/2008 - 12:48.Suppose you want to email changes in the Oracle's alert log, or maybe syslog's messages, it would be nice to email new 'tailed' entries. Something like tail -f logfile | mailx ... won't work as tail -f will never pipe any output. The idea is to take a snapshot of the file every x minutes, archive it, take another snapshot after x minutes, diff the two files, and email the changes. Then you roundrobin the snapshot and repeat the whole process:
crontab -l */5 * * * * /usr/local/bin/swatch-action.sh > /dev/null 2>&1 [root]# cat /usr/local/bin/swatch-action.sh
Monitoring an HP-UX server with EMS
Submitted by madvip on Thu, 01/31/2008 - 14:57.EMS (Event Monitoring Service) is a monitoring service that polls a system resource and sends messages when events occur. An event is something you want to know about. For example, you may want to be alerted when a disk goes down or when available filesystem space falls below a certain level. EMS allows you to configure what you consider an event for any given system resource (disk, filesystem space, network interfaces).
The advantage EMS has over built-in monitors is that requests can be made to send events to a wide variety of software using multiple protocols (opcmsg, SNMP, TCP, UDP).
Identifying which processes are accessing a file or socket
Submitted by madvip on Fri, 01/18/2008 - 16:37.Sometime you want to know which processes are blocking you from unmounting a directory. To list which processes are accessing a file, directory or socket, you can use the following command:
fuser -c /directory_name
Similarly if you want to SIGKILL these processes you can use the -k switch:
fuser -kc /directory_name
...Quite a handy *nix tool!
Configuring sendmail to relay to a Smart Host
Submitted by madvip on Fri, 01/18/2008 - 16:31.To configure sendmail to be able to relay emails from a UNIX system (its host) to another SMTP or Exchange server (ex. the corporate exchange server), you need to modify /etc/mail/sendmail.cf and set the Smart Relay:
#/etc/mail/sendmail.cf: DSmy_email_gateway
You have to make sure that you have appropriate entries in the nsswitch.conf to first resolve from /etc/hosts if you have problems with setting up a DNS!!
#/etc/nsswitch.conf: hosts: files dns
Finally apply changes by restarting sendmail:
/sbin/init.d/sendmail stop

