Sponsored Content
Top Forums UNIX for Dummies Questions & Answers default time in Solaris 8 for time-wait Post 35187 by hugo_perez on Tuesday 1st of April 2003 08:45:32 AM
Old 04-01-2003
Try with this ...

In order to close shortly your connections you need
to modify several defaults, for example:

ndd -set /dev/tcp tcp_time_wait_interval 60000


ndd -set /dev/arp tcp_time_wait_interval 60000


Note: use man ndd to look one by one the parameters
of the command

ndd -get /dev/tcp \?

Note: Don't looks like a Time Zone Problem.

I give you an example for tracking connections to the port 80 in Solaris:

#!/bin/ksh
wdate=`date +"%Y%m%d"`
LOG=/opt/home/reports/"$wdate"_port80.txt
LOG2=/opt/home/reports/"$wdate"_port80_in_det.txt
whour=`date +"%H:%M"`

netstat -na |grep -v -i listen |tee -a /tmp/"$wdate"_port80.tmp |/usr/xpg4/bin/awk '{ if ( NF == 7 && substr($1,length($1)-1,2) == 80 ){v[$7]++; cont++} }END{ for (i in v) {print i": " v[i]";" } print " Total: "cont " " }' |while read lin
do
wline="$wline"$lin
done

echo "$wdate ; $whour ; $wline" >> $LOG

cat /tmp/"$wdate"_port80.tmp |/usr/xpg4/bin/awk '{ if ( NF == 7 && substr($1,length($1)-1,2) == 80 ){print $1,$2,$7} }' | /usr/xpg4/bin/awk 'BEGIN{FS="."}{print $1"."$2"."$3"."$4"\t"substr($5,length($5)-2,3)"."$6"."$7"."$8"\t" $9}' | /usr/xpg4/bin/awk '{ d[$1]++ ; o[$1" ;"$2]++ ; f[$1" ;"$2" ;"$4]++ }END{ for (i in d){ print i"; All_ips ; Total ; "d[i]} for (j in o){print j " ;Subtotal; " o[j]} for (k in f){print k " ; " f[k]} }' |sort |while read wline
do
echo "$wdate ; $whour ; $wline" >> $LOG2
done
rm /tmp/"$wdate"_port80.tmp


Regards. Hugo.

Last edited by hugo_perez; 04-03-2003 at 09:24 AM..
 

10 More Discussions You Might Find Interesting

1. Solaris

Time Wait interval

What is the time_wait interval for Solaris 8/9??? and is it configurable??? For example sometimes a clients pc will freeze up dropping the connection, closing the port. The problem is on our side our system still thinks their logged in (until it realizes it dropped on the otherside and drops on... (1 Reply)
Discussion started by: eloquent99
1 Replies

2. Solaris

Process wait time

Hi all, I am trying to find out the process wait time on Unix(AIX/SOLARIS) machine( only sh/ksh/csh): Like EXAMPLE 1 : $ vmstat 2 System configuration: lcpu=16 mem=32000MB kthr memory page faults cpu ----- -----------... (1 Reply)
Discussion started by: chandrakala.sg
1 Replies

3. Shell Programming and Scripting

Convert Epoch Time to Standard Date and Time & Vice Versa

Hi guys, I know that this topic has been discuss numerous times, and I have search the net and this forum for it. However, non able to address the problem I faced so far. I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Discussion started by: DrivesMeCrazy
5 Replies

4. Shell Programming and Scripting

Move files one at the time and wait until the previous file is handled

I'm a novice at unix and need it more and more to do my work. I seem running into problems getting this script "attempt" to work: I need to copy all files in a directory, which is containing 22000 files, into a directory one level up. There a tool monitors the content of the dir and processes... (2 Replies)
Discussion started by: compasscard
2 Replies

5. Shell Programming and Scripting

how to convert date time to epoch time in solaris

Hi, Is there any easy way to convert date time(stored in shell variable ) to epoch time in solaris box? As +%s is working on linux but not on solaris, also -d option is not working. Any suggestion please? (6 Replies)
Discussion started by: anshuman0507
6 Replies

6. Shell Programming and Scripting

Wait given time unless key pressed

Hello everyone. I'm trying to create a script that waits a given amount of time unless a given key is pressed. I found a very useful thread here https://www.unix.com/shell-programming-scripting/59605-trap-key-press-script.html however, I cannot figure out a way of avoiding the keypress if the... (2 Replies)
Discussion started by: cue
2 Replies

7. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies

8. AIX

Wait time shows high CPU usage

Hi, I can't seem to make sense of this. My wait time is showing really high but vmstat's and topas are showing normal usage. ps aux USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND root 9961810 5680.7 0.0 448 384 - A Dec 16 6703072:12 wait ... (2 Replies)
Discussion started by: techy1
2 Replies

9. Shell Programming and Scripting

[Solved] Help with shell Script ,wait for some files for some time??

Hi All, I have the requirement that ,i have to write a shell script that job has to wait for a 7 touch files created by another application for 4 hours, if i get all 7 touch files ,i have to send a mail that i jobs are completed, if if it is waiting for more than 4 hours i have to send a mail... (2 Replies)
Discussion started by: Pradeep Shetty
2 Replies

10. UNIX for Dummies Questions & Answers

Script to run another script with wait time

I want to create a script which calls another script with certain interval. Script "A" should call script "B" every 60 seconds. Script "A" should also be able to call other scripts such as "C", "D", etc. at an interval of 60, 120, 180 seconds respectively. Basically script A should take two... (1 Reply)
Discussion started by: Vee
1 Replies
gdm-restart(1m) 						   User Commands						   gdm-restart(1m)

NAME
gdm-restart, gdm-safe-restart, gdm-stop - stop or restart GDM SYNOPSIS
gdm-restart gdm-safe-restart gdm-stop DESCRIPTION
gdm-restart stops and restarts GDM by sending a HUP signal to the GDM daemon. This command immediately terminates all sessions and logs out users currently logged in with GDM. gdm-safe-restart stops and restarts GDM by sending a USR1 signal to the GDM daemon. GDM is restarted as soon as all users log out. gdm-stop stops GDM by sending a TERM signal to the GDM daemon. FILES
The following files are used by this application: /usr/bin/gdm-restart Executable to stop and restart GDM /usr/bin/gdm-safe-restarExecutable to stop and restart GDM safely /usr/bin/stop Executable to stop GDM ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-display-mgr | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
Latest version of the GNOME Desktop User Guide for your platform. gdm(1), gdmXnestchooser(1), gdmflexiserver(1), gdmphotosetup(1), gdmsetup(1), gdmthemetester(1), gdmconfig(1m) NOTES
Written by Brian Cameron, Sun Microsystems Inc., 2004. SunOS 5.10 1 Sep 2004 gdm-restart(1m)
All times are GMT -4. The time now is 12:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy