IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
    
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerworks > My developerWorks >  Dashboard > AIX > ... > nmon > Linux startup
developerWorks
Log In   View a printable version of the current page.
Overview Connect Spaces Forums Wikis
Linux startup
Added by nagger, last edited by mactfines on Feb 17, 2009  (view change) show comment
Labels: 
(None)

This was supplied by nmon user Paul Smith - well done Paul.

Call this file nmon make it executable and it should work out the platform you are on and start the right nmon version automatically.

If you have changed of fixes please make a copy here and add them.

plat=power # not tested
[ `expr \`uname -m\` : ".*\(86\)"` = "86" ] && plat=x86

os=`head -1 /etc/issue`
required=no_nmon_found
case $os in
   *Debian*)    required=nmon_"$plat"_debian3 ;; # not tested
   *Fedora*)    required=nmon_"$plat"_fedora3 ;; # not tested
   *Shrike*)    required=nmon_"$plat"_redhat9 ;;
   *Red\ Hat*release\ 2*)       required=nmon_"$plat"_rhel2 ;;
   *Red\ Hat*release\ 3*)       required=nmon_"$plat"_rhel3 ;;
   *Red\ Hat*release\ 4*)       required=nmon_"$plat"_rhel4 ;;
   *Red\ Hat*release\ 5*)       required=nmon_"$plat"_rhel52 ;;
   *SUSE*8\.*)  required=nmon_"$plat"_sles8 ;; # not tested
   *SUSE*9\.*)  required=nmon_"$plat"_sles9 ;;
   *SUSE*10\.*) required=nmon_"$plat"_sles9 ;;
esac
echo Linux version $os and starting up nmon $required
# Try current directory
if [[ -e $required ]]
then
        echo $required $*
        exec $required $*
fi
# Try current directory with ./
if [[ -e ./$required ]]
then
        echo ./$required $*
        exec ./$required $*
fi
# Try same directory as this script
if [[ -e `dirname $0`/$required ]]
then
        echo `dirname $0`/$required $*
        exec `dirname $0`/$required $*
fi
echo Giving up - where did you put $required ?

Ubuntu users can use the RHEL4 version (at least on my Ubuntu 7.10 x86_64 install).

Add this line to the "case" section:
Ubuntu) required=nmon_"$plat"_rhel4 ;; # Tested - Dan Linder - dan / at / linder / dot / org

Dan

P.S. I don't think the 32bit/64bit detection on the first two lines is working. The $plat variable is "x86" but should be "x86_64"... Add this line right after the "plat=x86" line:
[ `expr \`uname -m\` : ".*(86_64)"` = "86" ] && plat=x86_64

Posted by dan_linder at Mar 16, 2008 23:52 | Permalink

I tested it on Slamd64 and it works beautifully without OS detection.

Linux vboxi 2.6.24.2 #1 SMP Thu Feb 21 12:38:01 GMT 2008 x86_64 x86_64 x86_64 GNU/Linux

Cheers. 

Posted by mbh at Mar 30, 2008 03:42 | Permalink

I had to make two changes to make it run under openSUSE 11.0
os=`head -1 /etc/issue` was changes to os=`head -2 /etc/issue`

Added the following line
SUSE*11\.) required=nmon_"$plat"_opensuse10 ;;

Thanks

Posted by rmcdonal at Mar 27, 2009 12:50 | Permalink

Previous post should have read...
I had to make two changes to make it run under openSUSE 11.0
os=`head -1 /etc/issue` was changed to os=`head -2 /etc/issue`

Added the following line in the case statement block.
SUSE*11\.) required=nmon_"$plat"_opensuse10 ;;

Thanks

Posted by rmcdonal at Mar 27, 2009 12:52 | Permalink

 
    About IBM Privacy Contact