May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Show information for solaris 10

#!/usr/bin/env ksh export LANG=C export PATH=${PATH}:/sbin:/usr/sbin:/usr/bin ################################################### ## Analysis for SUN by Lee Kwang Hyun ## ( Last Update. 2009.11.13 / Only Solaris 10) ################################################### DD=`date “+%y%m%d%H%M”` TMPVAR=”temp” TEMPVR=”temp” TMPTXT=/tmp/anal4sun.${DD} ROOTFS=”/dev/rdsk/c0t0d0″ ROOTDV=”c0t0d0″ TPMC=`cat /river/SYSINFO/tpmc.txt` #####################( MAIN ) main(){ OPTION=”$1″ ### hostname echo “HOST\t: $(hostname) (`hostid`)” ### model (product) prtdiag | grep “^System Configuration” | awk […]

Viewing file systems that 90% and more using awk & sed

This works with AIX

df -g | egrep -v “Filesystem|proc|tmp” | sed ‘s/\%//’ | awk ‘$4 >= 90 {print $4 “%\t” $7}’

df -k | sed 1d | awk ‘$4>90 {print}’

This works with Solaris and Linux

df -k | egrep -v “proc|fd|cdrom|mnttab|run|tmp|Filesystem” | sed ‘s/\%//’ | awk ‘$5 >= 90 {print $5 “%\t” $6}’

Configure ipfilter on Solaris10 as a host based firewall

1- Start by check ipfilter status if it’s running you can go ahead and configure rules

-bash-3.00$ svcs -a|grep -i ipfil online 10:29:37 svc:/network/ipfilter:default

if it’s disabled enable it

#svcadm enable ipfilter

2- Display rules

#bash-3.00ipfstat -io block out all pass out quick on lo0 all pass out quick on eri0 proto tcp/udp from […]

Clear DNS cache solaris

Clear DNS cache You can clear DNS cache in Solaris by doing the following

#/etc/init.d/nscd stop #/etc/init.d/nscd start

List PID’s for processes listening on ports solaris

List PID’s for processes listening on ports To list PID’s for processes listening on ports

#pfiles `ptree | awk ‘{print $1}’` | egrep ‘^[0-9]|port:’

disable the inetd service

Symptoms

Repeated attempts by unprivileged users to stop the inetd server may transition the inetd service to the “maintenance” state, thereby moving all internet services managed by inetd(1M) to the “offline” state.

To determine the state of the inetd service, the following command can be run:

$ svcs inetd STATE STIME FMRI maintenance 12:00:23 svc:/network/inetd:default […]

Solaris 10 – create an init script

First of all, we need to understand the procedure of the boot in Solaris. Next, follows a description of the boot sequence in Solaris.

Overview of the boot sequence in Solaris When Solaris boots up, it runs “init”. “init” looks in /etc/inittab to find out what runlevel it needs to boot into On Solaris, this […]

Solaris run levels

Solaris system state or init states refer to the level of services provided by the system on that specific run-level.Normally SVR4 systems has 7 run levels and Solaris too has that. (S)tart files, (K)ill files:

In unix ,runlevel will define what are the process need to start in OS startup according to which run level […]

determine the runlevel in solaris

Determining a System’s Run Level

Display run level information by using the who -r command.

$ who -r

Use the who -r command to determine a system’s current run level for any level.

Example 6-1 Determining a System’s Run Level

This example displays information about a system’s current run level and previous run levels.

[…]

Disabling Servies on Solaris 10

SUN has done a equally good things with Solaris 10 as they have done bad with the same. Sometimes I wonder how or why no one takes care of small issues with Solaris 10. It has become very popular since it went open source, but still there are some annoyances which a day to day […]