Index: html/pages/device.inc.php
===================================================================
--- html/pages/device.inc.php	(revision 10968)
+++ html/pages/device.inc.php	(working copy)
@@ -593,6 +593,19 @@
       $navbar['options']['nfsen'] = array('text' => 'Netflow', 'icon' => $config['icon']['nfsen']);
     }
 
+	// If Netbox is enabled, check for the device url
+	if ($config['netbox_enable'])
+    {
+	  $netbox_device_url = get_netbox_device_url($device['serial']); 
+	}
+	
+	// Print the Netbox tab if we have a netbox url
+	if ($netbox_device_url)
+	{
+      $navbar['options']['netbox'] = array('text' => 'Netbox', 'icon' => $config['icon']['info']);
+	  $navbar['options']['netbox']['url']  = $netbox_device_url;
+    }
+
     $navbar['options']['notes']                              = array('text' => '', 'icon' => $config['icon']['eventlog'], 'right' => TRUE, 'class' => "dropdown-toggle");
     if (isset($attribs['notes']))
     {
Index: html/includes/functions.inc.php
===================================================================
--- html/includes/functions.inc.php	(revision 10968)
+++ html/includes/functions.inc.php	(working copy)
@@ -2044,6 +2044,39 @@
   return FALSE;
 }
 
+/**
+
+ * Calls a Netbox REST API and queries for device serial number
+ *
+ * @param string $device_serial
+ * @return URL to Device in Netbox or false
+
+ */
+function get_netbox_device_url($device_serial)
+{
+  global $config;
+  
+  $netbox_api_url = $config['netbox_api_base_url'] . 'dcim/devices/?serial=' . $device_serial;
+
+  $opts = array('http' =>
+    array(
+        'method'  => 'GET',
+        'header'  => 'Authorization: Token ' . $config['netbox_api_token']
+    ),
+	'ssl' => 
+	array(
+      'verify_peer' => false,
+      'verify_peer_name' => false,
+	)
+  );
+  $response = json_decode(file_get_contents($netbox_api_url, false, stream_context_create($opts)), true);
+  
+  if($response['results'][0]['serial'] == $device_serial && $device_serial != '')
+    return str_replace("/api", "", $response['results'][0]['url']);
+  else
+    return false;
+}
+
 // Note, by default text NOT escaped.
 // TESTME needs unit testing
 // DOCME needs phpdoc block