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
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT ULTRIX
shutdown
shutdown(8) System Manager's Manual shutdown(8)
Name
shutdown - close down the system at a given time
Syntax
/etc/shutdown [ -k ] [ -r ] [ -h ] [ -o ] time [ warning-message ... ]
Description
The command provides an automated shutdown procedure that a superuser can use to notify users when the system is shutting down.
The time is the time at which will bring the system down. It may be the word `now', indicating an immediate shutdown, or specify a future
time in one of two formats: + number or hour : min. The first form brings the system down in number minutes. The second brings the system
down at the time of day indicated, using a 24-hour clock format.
At intervals which get shorter as shutdown nears, warning messages are displayed at the terminals of all users on the system. Warning mes-
sages are also sent to users who are logged in to a remote system that has mounted a file system or directory from the local system using
NFS. Five minutes before shutdown, or immediately if shutdown is timed for less than five minutes, logins are disabled by creating and
writing a message there. If this file exists when a user attempts to log in, prints its contents and exits. The file is removed just
before exits.
At shutdown time, a message is written in the file This message contains the time of shutdown, who ran shutdown, and the reason. Then, a
terminate signal is sent at to bring the system to single-user state.
If the or options are used, then executes or avoids shutting the system down (respectively). The option is for use by only. It indicates
to that it is being called by and not to return to the user.
You should place the time of the shutdown and the warning message in Use the message to inform the users about when the system will be back
up and why it is going down.
Restrictions
You can kill the system only between now and 23:59, if you use the absolute time for shutdown.
Files
Tells login not to let anyone log in
Log file for successful shutdowns
See Also
login(1), wall(1), halt(8), opser(8), reboot(8), rwalld(8c)
shutdown(8)