Simple Solaris iptraf like script 
How to monitor interface throughput on Solaris machine? I was looking for some sort of Linux's IPtraf (which is a great ip traffic monitor which can show you more than just interface traffic throuput) for Solaris. Seems no IPtraf port or similar text utility for Solaris so far. The script below should help you a bit and show the interface throughput.

It only prints out througput of the interface in 5 second intervals. If your system's interface is named ce0 instead of hme0, you need to change the script 'hme:0:hme0:*bytes' to 'ce:0:ce0:*bytes'.


#!/usr/bin/bash

WAIT=5

# traffic monitor
# writes total number of bytes (traffic) per interval

I_BYTES_OLD=`kstat -p 'hme:0:hme0:*bytes' | grep rbytes | awk -F" " '{ print $2}'`
O_BYTES_OLD=`kstat -p 'hme:0:hme0:*bytes' | grep obytes | awk -F" " '{ print $2}'`

while true
do
DATE=`date +%m/%d/%y" "%H:%M:%S`

I_BYTES=`kstat -p 'hme:0:hme0:*bytes' | grep rbytes | awk -F" " '{ print $2}'`
O_BYTES=`kstat -p 'hme:0:hme0:*bytes' | grep obytes | awk -F" " '{ print $2}'`

I_BYTES_DIFF=`echo $I_BYTES - $I_BYTES_OLD | bc`
O_BYTES_DIFF=`echo $O_BYTES - $O_BYTES_OLD | bc`

I_BYTES_OLD=$I_BYTES
O_BYTES_OLD=$O_BYTES

T_BYTES=`echo $I_BYTES_DIFF + $O_BYTES_DIFF | bc`

sleep $WAIT
clear
echo "$DATE interface: hme0 input: $I_BYTES_DIFF output: $O_BYTES_DIFF totalBytes: $T
_BYTES"
done


[ add comment ] ( 3 views )   |  [ 0 trackbacks ]   |  permalink
ILOM quick how-to 
ILOM - Sun(TM) Integrated Lights Out Manager. ILOM is designed for managing SUN AMD based servers via network. You can access ILOM text console (via ssh) or WWW based ILOM frontend (via http/https).

What you can do with ILOM text console? Mostly you will use commands such as:


start /SP/console
reset /SYS
start /SYS
stop /SYS
start /SP/console


the commands above are self explanatory. The first command runs the console and the other thre performs reset/start/stop operation on the box.If you need to interact with hosted operating system, you can go to it's console via start /SP/console.

What you can't do with text ILOM console? You cannot change BIOS settings (as for example boot device priority). If you need to do that, launch ILOM WWW frontend (the same IP address as for the ILOM ssh access) and issue JAVA console redirection plug-in.

The ILOM (text) interface itself is some sort of UNIX shell. After you logon to the console you can use the UNIX commands as ls and cd. To begin with ILOM just issue ls on / (root).


-> ls /

/
Targets:
SYS
SP

Properties:


Commands:
cd
show


There are so called TARGETS. You will use them as the ordinary directories. Just go to target (cd) and issue ls. The ls output tells you what you can do in each specific directory/target (or namespace - as the SUN sometime calls it).


-> cd /SYS
/SYS

-> ls

/SYS
Targets:
FP
SP
FT0
FT1
MB
PDB
PS0
PS1
SASBP
FAN_FAULT
LOCATE
POWER
PSU_FAULT
SERVICE
TEMP_FAULT

Properties:
type = Host System
power_state = On

Commands:
cd
reset
set
show
start
stop


We can go to other targets or issue commands available for that directory. In this case, reset, start/stop etc.


-> cd /SP
/SP

-> ls

/SP
Targets:
alert
cli
clients
clock
console
logs
network
serial
services
sessions
users

Properties:


Commands:
cd
load
reset
show
version


We went to /SP and here we can go to console - or change some ILOM settings. Let's say we would like to change the network IP address for ILOM management card.

To change the IP address for the ILOM interface change the pending addresses first, then check and commit them.


cd /SP/network
set pendingipaddress=nnn.nn.nn.nn
set pendingipnetmask=nnn.nn.nn.nn
set pendingipgateway=nnn.nn.nn.nn
set commitpending=true


The rest you can find here:

http://dlc.sun.com/pdf/820-0280-12/820-0280-12.pdf

How to escape from ILOM issued console session? Try [ESC] + [(] .


[ add comment ] ( 4 views )   |  [ 0 trackbacks ]   |  permalink
How about such useful ASCI generator? 
_________                __     __                                         
\_ ___ \_____ _____/ |_ | | __ ____ ____ ______ _____ ___.__.
/ \ \/\__ \ / \ __\ | |/ // __ \_/ __ \\____ \ / < | |
\ \____/ __ \| | \ | | <\ ___/\ ___/| |_> > | Y Y \___ |
\______ (____ /___| /__| |__|_ \\___ >\___ > __/ |__|_| / ____|
\/ \/ \/ \/ \/ \/|__| \/\/
_____
____ ___.__. ____ ______ _/ ____\______ ____ _____
_/ __ < | |/ __ \ / ___/ \ __\\_ __ \/ _ \ / \
\ ___/\___ \ ___/ \___ \ | | | | \( <_> ) Y Y \
\___ > ____|\___ >____ > |__| |__| \____/|__|_| /
\/\/ \/ \/ \/
__ .__ .__ .__ .__
_/ |_| |__ ____ ____ |__|______ ____ | | |__| ____ ____
\ __\ | \_/ __ \ _/ ___\| \_ __ \_/ ___\| | | |/ \ / ___\
| | | Y \ ___/ \ \___| || | \/\ \___| |_| | | \/ /_/ >
|__| |___| /\___ > \___ >__||__| \___ >____/__|___| /\___ /
\/ \/ \/ \/ \//_____/
__ .__
_____| | _|__| ____ ______
/ ___/ |/ / |/ __ \ / ___/
\___ \| <| \ ___/ \___ \
/____ >__|_ \__|\___ >____ >
\/ \/ \/ \/



http://www.network-science.de/ascii/

[ add comment ] ( 5 views )   |  [ 0 trackbacks ]   |  permalink
Simple use of test command 
Check if the file /etc/auditd.conf exists, if not, create empty one


test ! -f /etc/audit.conf && touch /etc/audit.conf


Check if the folder exists:


test ! -d /ora1 && echo "/ora1 doesn't exist" && exit 13


[ add comment ] ( 5 views )   |  [ 0 trackbacks ]   |  permalink
RedHat/CentosOS version 4 or 5 check in bash 

grep -i 'release 4' /etc/redhat-release > /dev/null && DISTRO=RHEL4
grep -i 'release 5' /etc/redhat-release > /dev/null && DISTRO=RHEL5


case $DISTRO in
RHEL4)
echo "verison 4"
;;
RHEL5)
echo "version 5"
;;
*)
echo "this is no CentOS4/CentOS5 or RedHat4/RedHat5"
exit
;;
esac



[ add comment ] ( 3 views )   |  [ 0 trackbacks ]   |  permalink
Weird Al Yankovic - Trapped In The Drive-Thru 


[ add comment ] ( 3 views )   |  [ 0 trackbacks ]   |  permalink
"Ebay" by Weird Al Yankovic 


[ add comment ] ( 4 views )   |  [ 0 trackbacks ]   |  permalink
"Weird Al" Yankovic - White & Nerdy 


[ add comment ] ( 5 views )   |  [ 0 trackbacks ]   |  permalink
I wanna mmm mmm I 


[ add comment ] ( 5 views )   |  [ 0 trackbacks ]   |  permalink
Black Sheep - The Movie 



[ add comment ] ( 4 views )   |  [ 0 trackbacks ]   |  permalink

<<First <Back | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | Next> Last>>