{% 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 all_server_mappings %}
LibreNMS Connections {% if librenms_server_info and not librenms_server_info.is_legacy %} Change Server {% endif %}
{% for mapping in all_server_mappings %} {% endfor %}
{% if mapping.is_active %} {% elif mapping.is_configured %} {% else %} {% endif %} {% if mapping.is_configured %} {{ mapping.display_name }} {% else %} {{ mapping.server_key }} Not configured {% endif %} {% if mapping.device_url %} ID {{ mapping.device_id }} {% else %} ID {{ mapping.device_id }} {% endif %} {% if not mapping.is_configured %} {% if lookup_device_model_name == "device" or lookup_device_model_name == "virtualmachine" %} {% if lookup_device_pk == object.pk %}
{% csrf_token %}
{% else %} Managed by VC sync device {% endif %} {% endif %} {% endif %}
{% elif 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 mismatched_device %} Mismatch found {% endif %}
{% if found_in_librenms %} {% if librenms_device_serial and librenms_device_serial != "-" %} {% endif %} {% 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 }} {% if librenms_id_is_legacy %}
{% csrf_token %} {% if librenms_id_serial_confirmed %} {% else %} {% endif %}
{% endif %}
Hostname {% if librenms_device_hostname and librenms_device_hostname != "-" %} {{ librenms_device_hostname }} {% else %} - {% endif %}
sysName {% if sysName %} {{ sysName }} {% else %} - {% endif %}
Serial {% if object.serial and librenms_device_serial != object.serial %} {% endif %} {{ librenms_device_serial }} {% if object.serial and librenms_device_serial == object.serial %} {% endif %}
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
Name
{{ object.name }}
{% if resolved_name and resolved_name != object.name %}
{% csrf_token %}
{% elif resolved_name %} {% endif %}
{{ sysName|default:"—" }}
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.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' %}
{% if module_sync and object|meta:"model_name" == "device" %}
{% include 'netbox_librenms_plugin/_module_sync.html' %}
{% endif %} {% with model_name=object|meta:"model_name" %} {% if model_name == "device" %}
{% include 'netbox_librenms_plugin/_vlan_sync.html' %}
{% endif %} {% endwith %}
{% 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 mismatched_device %} {% 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 %}