Posts Tagged ‘Networking’

Fix e1000e: Detected Hardware Unit Hang

Having periodic connectivity issues and seeing this in your dmesg?

e1000e 0000:02:00.0: eth0: Detected Hardware Unit Hang:
  TDH                  <a2>
  TDT                  <8e>
  next_to_use          <8e>
  next_to_clean        <a2>
  time_stamp           <214ed55a5>
  next_to_watch        <a2>
  jiffies              <214ed6d98>
  next_to_watch.status <0>
MAC Status             <80080783>
PHY Status             <796d>
PHY 1000BASE-T Status  <7800>
PHY Extended Status    <3000>
PCI Status             <10>
e1000e 0000:02:00.0: eth0: Reset adapter
e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx

This occurs during normal operation of some 82573-based NICs due to a problematic power saving feature. Fortunately, this can be fixed permanently by altering the NIC’s EEPROM. If your card is affected you will see the value 0xDE in the second-last position of the second line when you run:

# ethtool -e eth0
Offset          Values
------          ------
0x0000          00 00 00 00 00 00 30 0b 46 f7 07 10 ff ff 00 24 
0x0010          ff ff ff ff 6b 22 f9 02 14 10 8c 10 86 80 de ac

This value must be changed to 0xDF to disable the feature, which can be accomplished using this bash script:

# ./ eth0
eth0: is a "82573E Gigabit Ethernet Controller"
This fixup is applicable to your hardware
executing command: ethtool -E eth0 magic 0x108c8086 offset 0x1e value 0xdf
Change made. You *MUST* reboot your machine before changes take effect!

Crossfire Ping Monitoring Part 3: The Presentation

In part one of this series we set up a ping monitoring script on each of our servers. In part two we covered importing the data to a centralized database.
The number of potential different uses for this information is making my head spin, but in this installment we will focus on spitting it out out in a way which we can gain some basic insights.


$sql_host = '';
$sql_user = '';
$sql_pass = '';
$sql_base = '';

$sql_h = mysql_pconnect($sql_host, $sql_user, $sql_pass);
$sql_d = mysql_select_db($sql_base, $sql_h);

$now = empty($_GET['time']) ? time() : mysql_real_escape_string($_GET['time']);
$intervals = 100;
$interval = 300; // 5 minutes
$before = $now - $interval;

<meta http-equiv=\"refresh\" content=\"$interval\">
<title>Crossfire PoC</title>
<style type=\"text/css\">
body{background: white; color: black; margin: 10px; padding: 0px; font-family: Arial, sans; font-size: 9pt;}
td, th{font-family: Arial, sans; font-size: 8pt; white-space: nowrap;}
td{vertical-align: top;}
tr.darkrow{background-color: #dddddd;}
tr.lightrow{background-color: #eeeeee;}
a{text-decoration: none;}
h1{margin: 0px 0px 10px 0px; padding: 0px; border-bottom: 1px solid black;}
h2{margin: 10px 0px 5px 0px; padding: 0px; border-top: 1px solid black;}
<h1>Crossfire Ping Monitoring PoC on <a href=\"\"></a></h1>
This is a proof-of-concept showing how it is possible to use a group of hosts which constantly ping-monitor each other to visualize connectivity problems and general downtime.<br>
Each column is a different host. Each row is a slice of 5 minutes. Each cell contains how that host was seen by every other host in the pool during that time.<br>
The monitoring script pings each host 4 times every 5 minutes. If a host does not respond at all it will show up in <span style=\"color: red; font-weight: bolder;\">red</span>. If a host
responds to one or more pings it will show up in black. An empty cell means no host reported any problems.
<a href=\"?time=".($now - ($interval * $intervals))."\">< back</a>
<a href=\"?time=".($now + ($interval * $intervals))."\"> forward ></a>
<tr class=\"darkrow\">

$hosts = array();
$h_result = mysql_query("select * from `hosts` order by `id` desc");
while($h_array = mysql_fetch_array($h_result))
	$hosts["{$h_array['id']}"] = $h_array;



$counter = 0;
while($counter < $intervals)
	$after = $before + $interval;

	if($counter % 2)
		$class = 'dark';
		$class = 'light';

	print("<tr class=\"{$class}row\"><th>".date("Md/y H:i", $before).' - '.date("H:i", $after).'</th>');

	foreach($hosts as $host)
		$log_result = mysql_query("select * from `logs` where `date` > '$before' and `date` < '$after' and `ip` = '{$host['ip']}'");
		while($log_object = mysql_fetch_object($log_result))
			if($log_object->packets == 0){print("<span style=\"color: red; font-weight: bolder;\">");}
			print('• '.$hosts["{$log_object->host}"]['name']." reports {$log_object->packets} replies.");
			if($log_object->packets == 0){print("</span>");}

	$before = $before - $interval;


<a href=\"?time=".($now - ($interval * $intervals))."\">< back</a>
<a href=\"?time=".($now + ($interval * $intervals))."\"> forward ></a>

<h2>So Can You!</h2>
<a href=\"\">Crossfire Ping Monitoring Part 1: The Setup</a><br>
<a href=\"\">Crossfire Ping Monitoring Part 2: Collecting the Data</a><br>
<a href=\"\">Crossfire Ping Monitoring Part 3: The Presentation</a>



Again, we have a very inefficient (in terms of SQL queries) script and I encourage anyone who is interested to improve upon it.

You can see my live PoC at

Disable NetworkManager on CentOS/RHEL

NetworkManager is an annoying network configurator for home users. It will interfere with custom network-scripts unless disabled.

# chkconfig --level 2345 NetworkManager off
# /etc/init.d/NetworkManager stop
Return top
Online Marketing Toplist
Technology Blogs - Blog Rankings

Internet Blogs - BlogCatalog Blog Directory

Bad Karma Networks

Please Donate!

Made in Canada  •  There's a fox in the Gibson!  •  2010-12