{% extends 'generic/object.html' %} {% load buttons %} {% load helpers %} {% load plugins %} {% load static %} {% load i18n %} {% load render_table from django_tables2 %} {% block javascript %} {{ block.super }} {% endblock %} {% block breadcrumbs %} {{ block.super }} {% with model_name=object|meta:"model_name" %} {% if model_name == "device" %} {% elif model_name == "virtualmachine" %} {% endif %} {% endwith %} {% endblock %} {% block content %} {% if librenms_server_info %}
Active LibreNMS Server: {% if librenms_server_info.is_legacy %} {{ librenms_server_info.url }} {% else %} {{ librenms_server_info.display_name }} ({{ librenms_server_info.url }}) {% endif %}
{% if not librenms_server_info.is_legacy %} Change Server {% endif %}
{% endif %} {% if not is_vc_member or object.pk == librenms_sync_device.pk %}
LibreNMS Status
{% if found_in_librenms %} {% with model_name=object|meta:"model_name" %} {% if model_name == "device" %} {% elif model_name == "virtualmachine" %} {% endif %} {% endwith %} {% else %} {% endif %}
Status {% if found_in_librenms %} Found {% else %} Not found {% endif %}
ID {{ librenms_device_id }}
OS Version {% if platform_info.librenms_version and platform_info.librenms_version != "-" %} {{ platform_info.librenms_version }} {% else %} - {% endif %}
OS {% if platform_info.librenms_os and platform_info.librenms_os != "-" %} {{ platform_info.librenms_os }} {% else %} - {% endif %}
Version {% if platform_info.librenms_version and platform_info.librenms_version != "-" %} {{ platform_info.librenms_version }} {% else %} - {% endif %}
Hardware {% if librenms_device_hardware and librenms_device_hardware != "-" %} {{ librenms_device_hardware }} {% else %} - {% endif %}
Features {% if librenms_device_features and librenms_device_features != "-" %} {{ librenms_device_features }} {% else %} - {% endif %}
LibreNMS Link View
Action
{% if found_in_librenms %} {% with model_name=object|meta:"model_name" %} {% if model_name == "device" %}
Device Information Sync
{% with model_name=object|meta:"model_name" %} {% if model_name == "device" %} {% endif %} {% endwith %}
Field NetBox Value LibreNMS Value
Device Type
{% if object.device_type %} {{ object.device_type }} {% else %} Not set {% endif %}
{% if librenms_device_hardware_match.matched %} {% if not object.device_type or object.device_type.pk != librenms_device_hardware_match.device_type.pk %}
{% csrf_token %}
{% else %} {% endif %} {% endif %}
{{ librenms_device_hardware }} {% if not librenms_device_hardware_match.matched and librenms_device_hardware != "-" %} DeviceTypes {% endif %}
Serial Number {% if object.virtual_chassis and vc_inventory_serials %} {{ vc_inventory_serials|length }} {% endif %}
{% if object.serial %} {{ object.serial }} {% else %} Not set {% endif %}
{% if object.virtual_chassis and vc_inventory_serials %} {% else %} {% if librenms_device_serial != "-" %} {% if object.serial != librenms_device_serial %}
{% csrf_token %}
{% else %} {% endif %} {% endif %} {% endif %}
{{ librenms_device_serial }}
Platform
{% if platform_info.netbox_platform %} {{ platform_info.netbox_platform }} {% else %} Not set {% endif %}
{% if platform_info.librenms_os and platform_info.librenms_os != "-" %} {% if platform_info.platform_exists %} {% if not platform_info.netbox_platform or platform_info.netbox_platform.pk != platform_info.matching_platform.pk %}
{% csrf_token %}
{% else %} {% endif %} {% else %} {% endif %} {% endif %}
{{ platform_info.librenms_os }} {% if not platform_info.platform_exists and platform_info.librenms_os and platform_info.librenms_os != "-" %} Not in NetBox {% endif %}
Location {{ object.site.name }}
{{ librenms_device_location }}
{% if librenms_device_location != object.site.name %}
{% csrf_token %}
{% else %} {% endif %}
{% endif %} {% endwith %} {% endif %}
{% endif %} {% if last_fetched %} Last data updated: {{ last_fetched|date:"Y-m-d H:i" }} {% endif %} {% if is_vc_member and not object.cf.librenms_id %} {% if sync_device_has_librenms_id %}
{% if librenms_sync_device %} LibreNMS sync for this virtual chassis is managed by {{ librenms_sync_device }} {% else %} LibreNMS sync for this virtual chassis is managed by another member {% endif %}
{% elif sync_device_has_primary_ip %}
{% if librenms_sync_device %} LibreNMS sync for this virtual chassis should be configured on {{ librenms_sync_device }} {% else %} LibreNMS sync for this virtual chassis should be configured on the designated sync device {% endif %}
{% else %}
{% if librenms_sync_device %} Virtual chassis sync device {{ librenms_sync_device }} requires either a primary IP or a LibreNMS ID (custom field) for sync operations {% else %} Virtual chassis requires at least one member with a primary IP or LibreNMS ID configured for sync operations {% endif %}
{% endif %} {% elif librenms_device_id %} {% if found_in_librenms %}
{% include 'netbox_librenms_plugin/_interface_sync.html' %}
{% include 'netbox_librenms_plugin/_cable_sync.html' %}
{% include 'netbox_librenms_plugin/_ipaddress_sync.html' %}
{% elif mismatched_device %}
Device Mismatch: The LibreNMS device with ID {{ librenms_device_id }} does not match the NetBox device.
Netbox Device Details:
  • NetBox Name: {{ object.name }}
  • Primary IP: {{ object.primary_ip.address.ip|default:'-' }}
  • Primary IP DNS Name: {{ object.primary_ip.dns_name|default:'-' }}
LibreNMS Device with ID {{ librenms_device_id }}:
  • LibreNMS Name: {{ sysName|default:'-' }}
  • Hardware: {{ librenms_device_hardware }}
  • IP Address: {{ librenms_device_ip }}
Options:
  • Remove custom field value and let LibreNMS plugin try to find it
  • Manually enter the correct LibreNMS device ID
{% else %}
Device not found: Device has custom field librenms_id set to {{ librenms_device_id }} but was not found in LibreNMS.
Options to resolve:
  • Remove the custom field value to enable automatic matching. The plugin will attempt to find the device using:
    • Primary IP address
    • Primary IP DNS name (FQDN)
    • Device name
  • Update the custom field with the correct LibreNMS device ID
  • Verify the device exists in LibreNMS at the configured server
{% endif %} {% else %}
Device not found in LibreNMS. To match a device, use one of these methods:
{% endif %} {% if object.virtual_chassis and vc_inventory_serials %} {% endif %} {% if not platform_info.platform_exists and platform_info.platform_name and found_in_librenms %} {% endif %} {% endblock %}