Tag Archives: scripting

Working with configuration files

Not many people knows about the HP-UX tool ch_rc. This is a command line tool for people who are not so familiar with sed (stream editor), awk and pattern matching. SYNOPSIS /usr/sbin/ch_rc -a|-r|-l [-v] [-A] [-R root] [-p {parameter|parameter=value}...] [file...] If you want to query a variable in one of a config file under /etc/rc.config.d, [...]

UNIX95 variable influences to the ps command

Setting UNIX95 to some value (it doesn’t matter what it is) changes the behavior of the ps command to use the XPG4 environment instead of the HPUX environment. You can see all the different command line options and the XPG4 behaviors by looking at the man pages (e.g. man ps). Several options like ps -o [...]

Real-time ethernet bandwidth utilisation

Some weeks ago one of my colleagues asked me how could he monitor the traffic rate of the ethernet network. There is the netperf tool which you can get from the porting center, however that is more of a network troubleshooter tool than a real-time monitoring software. Now I found a nice perl script which [...]

Advanced scripting – changing the UID of a user

At one of our customer we will have an monstre’ UID-consolidation projekt in the near future. For this purpose I’ve written a script to enlighten our task. Most of you thinks at it a an over-complicated (usermod && find …. chown …) job, but my script has undergone some performance optimisation too: it starts parallel [...]

Comparing two files

There is the well-known diff command, but besides this there are at least two more ways to compare the contents of files.

Loadbalancing VGs manually

Yes, I know that HP-UX 11i v3 is capable of native multipathing by default, but not every customer can afford the expenses and risks to migrating to a newer OS. So here are a few sample scripts just to show how you can automatize the hard work of doing repeatly vgreduce/vgextend to organize the paths [...]