Sie befinden sich in den Archiven der Kategorie net.
| M | D | M | D | F | S | S |
|---|---|---|---|---|---|---|
| « Feb | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 | |||
- Allgemein (14)
- BI/DWH/DB (3)
- Deutsch/German (2)
- economics (3)
- graphic (2)
- ITSM (1)
- mobile (5)
- net (13)
- performance (11)
- programming (16)
- science (7)
- security (5)
- storage (3)
- unix (11)
- web (21)
- 27.2.2011: ARM interrupt processing
- 18.2.2011: doubango
- 4.2.2011: html parser comparison
- 31.1.2011: ssh tunneling trick
- 30.1.2011: Bash scripting guide
- 30.1.2011: programmin socket and ipc
- 30.1.2011: EDM Ollydbg for Linux
- 9.10.2009: Linux kernel report
- 9.10.2009: 60 GHZ ECMA-387 demonstrated
- 30.9.2009: File system
Archiv der Kategorie net
Fiber Topology comparison
16.5.2008 von pit.
cedmagazine has a nice one sheet overview of the different Fiber Topologies in use in the US.
Geschrieben in net | Keine Kommentare »
tcp_echo
16.7.2007 von pit.
even the echo service is disabled on Linux machines, it’s nevertheless an easy way to figure out spurios network delays. TIn perl the basics are already written in the NET::PING module. I only added some timing to it. If you don’t have the perl modules installed, a workaround is creating a script containing the line
echo $2 | /usr/bin/netcat -v $1 7
which you could than invoke with time scriptname host.domain.dmn string_to_use
here ist the other way
#!/usr/bin/perl
# simple tcp echo programm
# sample usage (verbose mode)
# /xxx/bin/tcp_echo.pl -v 1 -h host.domain.dmn
# /xxx/bin/tcp_echo.pl: host.domain.dmn 2
# res = 1 host host.domain.dmn time: 0.012088
# sample usage (normal mode)
# /root/bin/tcp_echo.pl -h host.domain.dmn
# res = 1 host host.domain.dmn time: 0.010903
#
use strict;
use Getopt::Long;
use Net::Ping;
use Time::HiRes;
use Time::HiRes qw(gettimeofday tv_interval);
my $program_name = $0;
my $timeout = 2;
my $hostname = “localhost”;
my $debug = 0;
sub helpMessage()
{
print “$program_name [-h|-?] [-v #] [-t #] [-h FQDM] [\n”;
print “-help|? this message\n”;
print “-v[erbose] enables debug messages \n”;
print “-t[imeout] timeout (default: 2)\n”;
print “-h[ost] hostname FQDN (default: localhost) \n”;
exit 1;
}
sub run()
{
my $t0 = [gettimeofday];
my $res = pingecho( $hostname, $timeout );
my $t1 = [gettimeofday];
my $elapsed = tv_interval $t0, $t1;
print “res = $res host $hostname time: $elapsed\n”;
}
Getopt::Long::Configure (”bundling”);
my $l_result = GetOptions (
‘help|?’ => sub { helpMessage() },
‘verbose|v=n’ => \$debug,,
‘host|h=s’ => \$hostname,
‘timeout|t=n’ => \$timeout);
print “$program_name: $hostname $timeout \n” if $debug;
&run();
Geschrieben in net, programming | Keine Kommentare »
proc/net/netstat monitor
3.7.2007 von pit.
I recently grabbed a little tcl script which you can use for process monitoring. Can’t remember the actual URL where I took it from, and it had no comments in it. Nevertheless, even it’s about a decade ago i worked with tcl, i changed it to print out which TCPext: fields of the netstat command changed. perhaps somebody can use it
#!/usr/bin/tclsh
#
# small utility to print the tcpext. flags that changed.
# Free to use, no warranty etc….
#
# ./mon_linux_netstat
# CTRL-C to stop
#
# Pit 03.07.07
cd /proc/net
set tcp_arr {
TCPEXTFAKE
SyncookiesSent
SyncookiesRecv
SyncookiesFailed
EmbryonicRsts
PruneCalled
RcvPruned
OfoPruned
OutOfWindowIcmps
LockDroppedIcmps
ArpFilter
TW
TWRecycled
TWKilled
PAWSPassive
PAWSActive
PAWSEstab
DelayedACKs
DelayedACKLocked
DelayedACKLost
ListenOverflows
ListenDrops
TCPPrequeued
TCPDirectCopyFromBacklog
TCPDirectCopyFromPrequeue
TCPPrequeueDropped
TCPHPHits
TCPHPHitsToUser
TCPPureAcks
TCPHPAcks
TCPRenoRecovery
TCPSackRecovery
TCPSACKReneging
TCPFACKReorder
TCPSACKReorder
TCPRenoReorder
TCPTSReorder
TCPFullUndo
TCPPartialUndo
TCPDSACKUndo
TCPLossUndo
TCPLoss
TCPLostRetransmit
TCPRenoFailures
TCPSackFailures
TCPLossFailures
TCPFastRetrans
TCPForwardRetrans
TCPSlowStartRetrans
TCPTimeouts
TCPRenoRecoveryFail
TCPSackRecoveryFail
TCPSchedulerFailed
TCPRcvCollapsed
TCPDSACKOldSent
TCPDSACKOfoSent
TCPDSACKRecv
TCPDSACKOfoRecv
TCPAbortOnSyn
TCPAbortOnData
TCPAbortOnClose
TCPAbortOnMemory
TCPAbortOnTimeout
TCPAbortOnLinger
TCPAbortFailed
TCPMemoryPressures
}
#
# read in the values from the netstat file
proc scan_net { _dat} {
upvar $_dat dat
global tcp_arr
set in [open “netstat” “r”]
set l [gets $in]
set l [gets $in]
close $in
set a [split $l ” “]
foreach x $a n $tcp_arr {
if {[string match “TcpExt:” $x]} {
continue
}
set dat($n) $x
#puts “dat von n($n) = $dat($n) ”
}
}
#
# set inital data array and fill it
array set dat {}
scan_net dat
# forever
# sleep 1 second, read in second array
# loop and compare values, if different print the sum
# reset the initial array and copy new to old
while {1} {
after 1000
array set new_dat {}
scan_net new_dat
set somechange 0
foreach a $tcp_arr {
if {[string match “TCPEXTFAKE” $a]} {
continue
}
if {$new_dat($a) != $dat($a)} {
set res [expr {$new_dat($a) - $dat($a)}]
#puts “attribute ‘$a’ from $dat($a) to $new_dat($a) $res”
puts “‘$a’ $res”
set somechange 1
}
}
if {$somechange} {
puts “”
}
array set dat {}
array set dat [array get new_dat]
}
Geschrieben in net, programming, unix | 1 Kommentar »