Sunday, July 14, 2013

Checkmem for AIX

Checkmem for AIX

is a perl script that will read svmon -G and vmstat -v output and print WARN,CRIT or FATAL message if memory or pg_space over WARN,CRIT or FATAL treshold.


Man page

NAME
checkmem.pl - Check mem for AIX

SYNOPSIS
checkmem.pl [options]

Options:
-warn|w Sets warning treshold for mem. Default 70.
-crit|c Sets critical treshold for mem. Default 90.
-fatal|f Sets fatal treshold for mem. Default 95.
-pgwarn|pgw Sets warning treshold for pg space. Default 70.
-pgcrit|pgc Sets critical treshold for pg space. Default 90.
-pgfatal|pgf Sets fatal treshold for pg space. Default 95.
-unit|u Sets unit. Possible values are kmg. Default m.
-color Print colored output.
-info|i Print memory infos.
-help brief help message
-man full documentation

OPTIONS
-warn
Sets warning treshold for mem. Default 70.

-crit
Sets critical treshold for mem. Default 90.

-fatal
Sets fatal treshold for mem. Default 95.

-pgwarn
Sets warning treshold for pg space. Default 70.

-pgcrit
Sets critical treshold for pg space. Default 90.

-pgfatal
Sets fatal treshold for pg space. Default 95.

-unit
Sets unit for conversion. Possible values are kmg. Default is m.

-info
Prints out information about memory usage.

-color
The output will be colored.

-help
Print a brief help message and exits.

-man
Prints the manual page and exits.

DESCRIPTION
checkmem.pl will read svmon -G and vmstat -v output and print WARN,CRIT or FATAL message if memory or
pg_space over WARN,CRIT or FATAL treshold.

Author : Miroslav Pilat

VERSION
1.1

Monday, July 13, 2009

Transmission-deamon Fedora init script

I've recently setup a my old PC as bittorent download station. I use Fedora 11 and I needed transmission-daemon statup script. After some diggig o internet I found only debian like scripts so I decided to write it my self. Here is the result. Use is freely and wisely.



#!/bin/bash
#
# /etc/rc.d/init.d/transmission-daemon
#
# Author: Miroslav Pilat
# chkconfig: 2345 13 87
# Description: Bittorrent client Transmission started as daemon
#

# Source function library.
. /etc/init.d/functions

#
# ----- CONFIGURATION -----
#
# For the default location Transmission uses, visit:
# http://trac.transmissionbt.com/wiki/ConfigFiles
# For a guide on how set the preferences, visit:
# http://trac.transmissionbt.com/wiki/EditConfigFiles
# For the available environement variables, visit:
# http://trac.transmissionbt.com/wiki/EnvironmentVariables
#
# The name of the user that should run Transmission.
# It's RECOMENDED to run Transmission in it's own user,
# by default, this is set to 'transmission'.
# For the sake of security you shouldn't set a password
# on this user
USERNAME=transmission

# ----- *ADVANCED* CONFIGURATION -----
# Only change these options if you know what you are doing!
#
# The folder where Transmission stores the config & web files.
# ONLY change this you have it at a non-default location
#TRANSMISSION_HOME="/etc/transmission-daemon"
#TRANSMISSION_WEB_HOME="/usr/share/transmission/web"
#
# The arguments passed on to transmission-daemon.
# ONLY change this you need to, otherwise use the
# settings file as per above.
#TRANSMISSION_ARGS=""


# ----- END OF CONFIGURATION -----
#
# PATH should only include /usr/* if it runs after the mountnfs.sh script.
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DESC="bittorrent client"
NAME=transmission-daemon
DAEMON=$(which $NAME)
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Read configuration variable file if it is present
if [ -f /etc/$NAME/$NAME.conf ]; then
. /etc/$NAME/$NAME.conf
fi

start() {
echo -n "Starting $NAME: "

if [ -n "$TRANSMISSION_HOME" ]; then
export TRANSMISSION_HOME
fi
if [ -n "$TRANSMISSION_WEB_HOME" ]; then
export TRANSMISSION_WEB_HOME
fi

if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
echo $NAME already running: $PID
exit 2;
else
daemon $DAEMON $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/${NAME}
return $RETVAL
fi

touch /var/lock/subsys/${NAME}
return
}

stop() {
echo -n "Shutting down $NAME: "

killproc $NAME
rm -f /var/lock/subsys/${NAME}
return 0
}

case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $NAME
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|status}"
exit 1
;;
esac
exit $?

Monday, March 9, 2009

Definitely, Maybe

Seeing this movie and think about Othelo brought me to a thought about "Why we want to see happy ending stories?". I guess it's our life. We think we are having tough times. But that's not true. I believe most of us is having good times. Maybe our expectations are not full-filled but still we are living in times of sufficiency. We have wifes and husbands we love. Adorable, funny, amazing kids. Great parent, family. Social country :D and much more.

And that's why we need to read/watch tragedies. So we can realize how good life we are living. And we should take advice from these unhappy endigs and value what we have.

Friday, October 10, 2008

Thoughts about Apple computers

What I like most about Apple is Mac OS X.
The design of their computers is also important for me but not so much.

We own a Mac Mini G4 and we like it but time has come and some parts became defective. The Superdrive and the ethernet port.

So I started to look around for this parts and their prices. During this I looked also to prices of other computers. What a surprise. Most of the PCs are half the price. That's very disappointing. I've also discovered gOS which looks fabulous.

All this makes me think. Are Apple Computers overpriced? Do I really want to pay extra for Apple logo and OSX?

May be if my renter would pay me as he should I would simply buy those faulty parts as external devices + USB Hub and all would be OK.

Money, Money, Money, must be funny in a rich man's world.

Monday, September 15, 2008

Onehundredpushups

I done it after 3 months. I had to do week 6 couple of times more because we were traveling a lot during August and beginning of September and I was not able to follow the plane precisely.

Saturday, July 26, 2008

I bought an iPod

it's been almost three weeks after I've finaly received iPod Touch. I wished to buy an iPod since we moved to Brno. Primary to listen music when going to work. After three years I've finally found enough courage and funds to buy it. It wasn't so easy. I not good at decisions. I thnk long, comparing all versions, looking where to buy it for best value. Petruska, my wife, almost got crazy from my inability to decide. After all it was her who helped me to decide. I would like to thank her now encouragement.

Thank you my dear.

It's a really nice device. Although it's highly under Apple's contoll. People have to hack it to fully unveil it's potential. I still like it. I don't have to fight for some computer time with Petruska. Which was main reason why I decided for Touch. Maybe I will try to develop some app for it also.

But right now I'm going to devote my time to Peruska.

Tuesday, June 10, 2008

Thursday, January 24, 2008

How-to get absolute path of currently executing script

I googled this:

On 2006-06-15, Seb wrote:
> Hello,

> In a script shell (sh, bash, ksh, csh etc), how to get the absolute path
> of the script file's enclosing directory ?

Usually, if you want this, you are doing something wrong, or trying
to solve the wrong problem.

In a POSIX shell (ksh, bash, most recent versions of sh):

progdir=${0%/*}

In a Bourne shell:

progdir=`dirname $0`


Csh is not recommended for scripting.

Saturday, November 10, 2007

Synclvodm feeling

Magic AIX command to synchronize informations in VGDA and ODM. I've already use it once but with help of experienced. That was a long time ago so I had to search on web to find out this. It was a very nice feeling. Finally I had the possbility to use some knowledge I gained during education. Finally I felt satisfied that I was on it and it was not just wasted time.

Later I will try to describe the problem and solution using synclvodm. Got to get some sleep now.

Sunday, November 4, 2007

Radio Survey

I was contacted by some radio survey girl. I’ve answered couple of questions and finally we get to my family.

G: How old are you?
M: 28
G: What radio station you listen most?
M: Český rozhlas Radiožurnál?

G: Your next family member is men/woman?
M: Woman
G: How old is your wife?
M: 27
G: What radio station she listen most?
M: Český rozhlas Radiožurnál?

At this point I started laught in my head.

G: Your next family member is men/woman?
M: Woman
G: How old is she?
M: 3
G: What radio station she listen most?
M: Český rozhlas Radiožurnál?

Here it seemed to me almost absurd that the girl countinues in the interview.

G: Your next family member is men/woman?
M: Man
G: How old is he?
M: 1
G: What radio station he listen most?
M: Český rozhlas Radiožurnál?

Here I was laughting aloud. I could not bear it. And shw continued.

G: Your next family member is men/woman?
M: Woman
G: How old is she?
M: 0
G: What radio station she listen most?
M: Český rozhlas Radiožurnál?

Absurd. Why did she continued asking those question about my kids? It must have been obvious that they don't choose their radio station, yet.

Saturday, November 3, 2007

Back to Tiger

I would love to use Leopard but I can not afford it. I do not wat to steal so I returned to Tiger. Hopefully next year. :( :(

Wednesday, October 31, 2007

Leopard

I was provided with a copy of Leopard (thanks Sjon) so that I can try what it can do.

Installation - really smooth. no more that 3 next clicks. I did not watch for installation time. But I guess it took around an hour on my Mac Mini G4 1.42MHz

Desktop - really nice. Eyez candy all around. But it seems more dark to me than Tiger.

Spaces - really appreciate this feature. I've missed it since I switched from Linux to OS X

Stacks - looks nice. Did not have much time to use it so far

Quick look - that's something. Really love it.

Finder - looks better, improved. did not test it much yet.

Time Machine - don't have spare external HDD to be able to try it.

Performance - it's more memory hungry. I suppose because of all these eye candy stuff. But it's quite speedy. So far I did not experienced any big performance issue.

It's really nice unfortunatelly I don't have money for it in our budget. I'll have to stick with Tiger because I don't want to steal software. May be someday next year.

Monday, October 29, 2007

Late Shift Action Plan

1.Get up when Borik get's up
2.Dress him, feed him, play with him
3.Apply the steps in point 2. to your self concurrently
4.Think up morning actions
5.Prepare kids to go with you out
6.Morning action
7.Lunch time
8.Go to work
9.Get back from work and go to bed - Borivoj wakes up early ;-)

Wednesday, October 17, 2007

AIX: Add UDF FS on DVD-RAM

How to create it

udfcreate -d /dev/cd0 #create a UDF file system
udflabel -d /dev/cd0 -l testdvd #Change the label on UDF fs
udfcheck -d /dev/cd0 #Check a UDF fs


And how to use it

mkdir /dvddisk
mount -V udfs -o rw /dev/cd0 /dvddisk

Disable OSX Startup sound

mac osx hint 1.
mac osx hint 2.

AIX: HW SW invenory


prtconf #prints some basic info about your machine
lsdev -CH #lists all customized devices
lsvg #lists all volume groups
lsvg rootvg #lists info about rootvg
lsps -a #lists all paging spaces
lspv #lists all physical volumes
bootlist -om normal #lists bootlist for normal mode of booting
lslpp -a all #lists all installed sw


Can be useful to store before some big change on your AIX server (TL ML upgrade, etc.)

Tuesday, October 16, 2007

AIX: odmget examples


odmget -q"name=hdisk0" CuDv # get ODM object in the CuDv that describes hdisk0 disk device

odmget -q"name=hdisk0 and attribute=pvid" CuAt # get ODM object that stores the PVID

odmget -q"value3=hdisk0" CuDvDr # get major,minor number of special file for hdisk0

odmget -q"name=rootvg" CuDep # query ODM class to identify all LVs that belong to rootvg

odmget -q"parent=rootvg" CuDv # the same as previous command

Can be usefull when troubleshooting LVM related problems

Monday, October 15, 2007

To reach autumn beauty

To reach autumn beauty
To reach autumn beauty, originally uploaded by miromir.

We have had to pass this little stream because of autumn beauty waiting for un on the other side.

It was not that hard after all but I was not very happy when I was asked to do it.

So when we passed we had to climb the hill to reach the meadows on the next shots.