Central data models of NAV’s management subsystems

Netbox

From NAV Wiki: The netbox table is the heart of the heart so to speak, the most central table of them all. The netbox tables contains information on all IP devices that NAV manages with adhering information and relations.

Parameters:

Relationship fields:

Parameters:

Reverse relationships:

Parameters:
  • events (Reverse ForeignKey from EventQueue) – All events of this IP Device (related name of netbox)

  • alerts (Reverse ForeignKey from AlertQueue) – All alerts of this IP Device (related name of netbox)

  • alert_history_set (Reverse ForeignKey from AlertHistory) – All alert history set of this IP Device (related name of netbox)

  • netboxprofile (Reverse ForeignKey from NetboxProfile) – All netbox profiles of this IP Device (related name of netbox)

  • instances (Reverse ForeignKey from Netbox) – All instances of this IP Device (related name of master)

  • info_set (Reverse ForeignKey from NetboxInfo) – All info set of this IP Device (related name of netbox)

  • entities (Reverse ForeignKey from NetboxEntity) – All entities of this IP Device (related name of netbox)

  • netboxprefix (Reverse OneToOneField from NetboxPrefix) – The netbox prefix of this IP Device (related name of netbox)

  • modules (Reverse ForeignKey from Module) – All modules of this IP Device (related name of netbox)

  • memory_set (Reverse ForeignKey from Memory) – All memory set of this IP Device (related name of netbox)

  • netboxcategory (Reverse ForeignKey from NetboxCategory) – All netbox categorys of this IP Device (related name of netbox)

  • vlans (Reverse ForeignKey from Vlan) – All vlans of this IP Device (related name of netbox)

  • arp_set (Reverse ForeignKey from Arp) – All arp set of this IP Device (related name of netbox)

  • from_adjancency_candidates (Reverse ForeignKey from AdjacencyCandidate) – All from adjancency candidates of this IP Device (related name of netbox)

  • to_adjacency_candidates (Reverse ForeignKey from AdjacencyCandidate) – All to adjacency candidates of this IP Device (related name of to_netbox)

  • netbox_vtp_vlans (Reverse ForeignKey from NetboxVtpVlan) – All netbox vtp vlans of this IP Device (related name of netbox)

  • cam_set (Reverse ForeignKey from Cam) – All cam set of this IP Device (related name of netbox)

  • interfaces (Reverse ForeignKey from Interface) – All interfaces of this IP Device (related name of netbox)

  • connected_to_interface (Reverse ForeignKey from Interface) – All connected to interface of this IP Device (related name of to_netbox)

  • gateway_peer_sessions (Reverse ForeignKey from GatewayPeerSession) – All gateway peer sessions of this IP Device (related name of netbox)

  • sensors (Reverse ForeignKey from Sensor) – All sensors of this IP Device (related name of netbox)

  • power_supplies_or_fans (Reverse ForeignKey from PowerSupplyOrFan) – All power supplies or fans of this IP Device (related name of netbox)

  • unrecognized_neighbors (Reverse ForeignKey from UnrecognizedNeighbor) – All unrecognized neighbors of this IP Device (related name of netbox)

  • job_log (Reverse ForeignKey from IpdevpollJobLog) – All job log of this IP Device (related name of netbox)

  • poe_groups (Reverse ForeignKey from POEGroup) – All poe groups of this IP Device (related name of netbox)

  • poe_ports (Reverse ForeignKey from POEPort) – All poe ports of this IP Device (related name of netbox)

  • node_positions (Reverse ForeignKey from NetmapViewNodePosition) – All node positions of this IP Device (related name of netbox)

  • services (Reverse ForeignKey from Service) – All services of this IP Device (related name of netbox)

Type: Reverse ForeignKey from AlertHistory

All alert history set of this IP Device (related name of netbox)

Type: Reverse ForeignKey from AlertQueue

All alerts of this IP Device (related name of netbox)

Type: Reverse ForeignKey from Arp

All arp set of this IP Device (related name of netbox)

Type: Reverse ForeignKey from Cam

All cam set of this IP Device (related name of netbox)

Type: ForeignKey to Category

Category (related name: netboxes)

Internal field, use category instead.

Custom validation

Type: Reverse ForeignKey from Interface

All connected to interface of this IP Device (related name of to_netbox)

Type: HStoreField

Data

Type: DateTimeField

Deleted at

Property to access the former device-field

Returns the first chassis device if any

Type: DateTimeField

Discovered

Type: Reverse ForeignKey from NetboxEntity

All entities of this IP Device (related name of netbox)

Type: Reverse ForeignKey from EventQueue

All events of this IP Device (related name of netbox)

Type: Reverse ForeignKey from AdjacencyCandidate

All from adjancency candidates of this IP Device (related name of netbox)

Type: Reverse ForeignKey from GatewayPeerSession

All gateway peer sessions of this IP Device (related name of netbox)

Calculates and returns an availability data structure.

Returns a QuerySet of chassis devices seen on this netbox

Returns the sensors to be displayed on the Environment Sensor tab

Returns the netbox’ prefix address only when the prefix is not a scope, private or reserved prefix.

Returns the function description of this netbox.

Returns the number of all interfaces that have IP addresses.

Returns all interfaces that have IP addresses.

Returns gwports naturally sorted by interface name

Returns the last log entry for all jobs

Finds next instance based on discovered. See get_next_by_FOO() for more information.

Finds next instance based on up_since. See get_next_by_FOO() for more information.

Return all ports that are present.

Return all ports that are present sorted by interface name.

Returns the snmp management profile with the highest available SNMP version.

Parameters:

require_write – If True, only write-enabled profiles will be considered. If false, read-only profiles will be preferred, unless a write-enabled profile is the only available alternative.

Returns the prefix address for this netbox’ IP address.

Finds previous instance based on discovered. See get_previous_by_FOO() for more information.

Finds previous instance based on up_since. See get_previous_by_FOO() for more information.

Returns sensors associated with this netbox

Returns sysname without the domain suffix if specified in the DOMAIN_SUFFIX setting in nav.conf

Returns the number of all interfaces that are switch ports.

Returns all interfaces that are switch ports.

Returns swports naturally sorted by interface name

Gets a list of available Graphite metrics related to this Netbox, except for ports and sensors, which are seen as separate.

Returns:

A list of dicts describing the metrics, e.g.: {id:”nav.devices.some-gw.cpu.cpu1.loadavg1min”,

group=”cpu”, suffix=”cpu1.loadavg1min”}

Returns a queryset of unresolved alert states

Shows the label of the up. See get_FOO_display() for more information.

Returns a list of uplinks on this netbox. Requires valid vlan.

Gets the availability for this netbox for the last week

Type: ManyToManyField to NetboxGroup

Groups (related name: netboxes)

Returns true if this netbox has unignored unrecognized neighbors

Type: AutoField

Primary key: Id

Type: Reverse ForeignKey from NetboxInfo

All info set of this IP Device (related name of netbox)

Type: Reverse ForeignKey from Netbox

All instances of this IP Device (related name of master)

Type: Reverse ForeignKey from Interface

All interfaces of this IP Device (related name of netbox)

Type: GenericIPAddressField

Ip

Returns True if this netbox is currently on maintenance

Returns True if this netbox has any unresolved snmp agent state alerts

Returns True if the Netbox isn’t known to be down or in shadow

Type: Reverse ForeignKey from IpdevpollJobLog

All job log of this IP Device (related name of netbox)

Returns the end_time of the last known boxState alert.

Returns:

A datetime object if a serviceState alert was found, otherwise None

Returns the last updated timestamp of a particular job as a datetime object.

Returns a set of collected chassis MAC addresses for this Netbox

Type: ForeignKey to Netbox

Master (related name: instances)

Internal field, use master instead.

Type: Reverse ForeignKey from Memory

All memory set of this IP Device (related name of netbox)

Type: Reverse ForeignKey from Module

All modules of this IP Device (related name of netbox)

Type: Reverse ForeignKey from NetboxVtpVlan

All netbox vtp vlans of this IP Device (related name of netbox)

Type: Reverse ForeignKey from NetboxCategory

All netbox categorys of this IP Device (related name of netbox)

Type: Reverse OneToOneField from NetboxPrefix

The netbox prefix of this IP Device (related name of netbox)

Type: Reverse ForeignKey from NetboxProfile

All netbox profiles of this IP Device (related name of netbox)

Type: Reverse ForeignKey from NetmapViewNodePosition

All node positions of this IP Device (related name of netbox)

Type: ForeignKey to Organization

Organization (related name: netboxes)

Internal field, use organization instead.

Type: Reverse ForeignKey from POEGroup

All poe groups of this IP Device (related name of netbox)

Type: Reverse ForeignKey from POEPort

All poe ports of this IP Device (related name of netbox)

Type: Reverse ForeignKey from PowerSupplyOrFan

All power supplies or fans of this IP Device (related name of netbox)

Type: ManyToManyField to ManagementProfile

Profiles (related name: netboxes)

Type: ForeignKey to Room

Room (related name: netboxes)

Internal field, use room instead.

Type: Reverse ForeignKey from Sensor

All sensors of this IP Device (related name of netbox)

Type: Reverse ForeignKey from Service

All services of this IP Device (related name of netbox)

Type: VarcharField

Sysname

Type: Reverse ForeignKey from AdjacencyCandidate

All to adjacency candidates of this IP Device (related name of to_netbox)

Type: ForeignKey to NetboxType

Type (related name: netboxes)

Internal field, use type instead.

Type: Reverse ForeignKey from UnrecognizedNeighbor

All unrecognized neighbors of this IP Device (related name of netbox)

Type: CharField

Up

Choices:

  • y

  • n

  • s

Type: DateTimeField

Up since

Type: BooleanField

Up to date

Type: Reverse ForeignKey from Vlan

All vlans of this IP Device (related name of netbox)

NetboxType

From NAV Wiki: The type table defines the type of a netbox, the sysobjectid being the unique identifier.

Parameters:
  • id (AutoField) – Primary key: Id

  • name (VarcharField) – Type name

  • sysobjectid (VarcharField) – Sysobjectid

  • description (VarcharField) – Description

Relationship fields:

Parameters:

vendor (ForeignKey to Vendor) – Vendor (related name: netbox_types)

Reverse relationships:

Parameters:

netboxes (Reverse ForeignKey from Netbox) – All netboxes of this netbox type (related name of type)

Type: VarcharField

Description

Returns the type’s enterprise ID as an integer.

The type’s sysobjectid should always start with SNMPv2-SMI::enterprises (1.3.6.1.4.1). The next OID element will be an enterprise ID, while the remaining elements will describe the type specific to the vendor.

Type: AutoField

Primary key: Id

Type: VarcharField

Type name

Type: Reverse ForeignKey from Netbox

All netboxes of this netbox type (related name of type)

Type: VarcharField

Sysobjectid

Type: ForeignKey to Vendor

Vendor (related name: netbox_types)

Internal field, use vendor instead.

Category

From NAV Wiki: The cat table defines the categories of a netbox (GW,GSW,SW,EDGE,WLAN,SRV,OTHER).

Parameters:
  • id (CharField) – Primary key: Id

  • description (VarcharField) – Description

  • req_mgmt (BooleanField) – Req mgmt

Reverse relationships:

Parameters:
  • netboxes (Reverse ForeignKey from Netbox) – All netboxes of this category (related name of category)

  • netmap_views (Reverse ManyToManyField from NetmapView) – All netmap views of this category (related name of categories)

  • netmap_view_categories (Reverse ForeignKey from NetmapViewCategories) – All netmap view categories of this category (related name of category)

Type: VarcharField

Description

Type: CharField

Primary key: Id

Is this an edge switch?

Is this a routing switch?

Is this a router?

Is this an uncategorized device?

Is this a server?

Is this a core switch?

Type: Reverse ForeignKey from Netbox

All netboxes of this category (related name of category)

Type: Reverse ForeignKey from NetmapViewCategories

All netmap view categories of this category (related name of category)

Type: Reverse ManyToManyField from NetmapView

All netmap views of this category (related name of categories)

Type: BooleanField

Req mgmt

Interface

The network interfaces, both physical and virtual, of a Netbox.

Parameters:

Relationship fields:

Parameters:

Reverse relationships:

Parameters:
  • gwport_prefixes (Reverse ForeignKey from GwPortPrefix) – All gwport prefixes of this interface (related name of interface)

  • swport_vlans (Reverse ForeignKey from SwPortVlan) – All swport vlans of this interface (related name of interface)

  • swport_allowed_vlan (Reverse OneToOneField from SwPortAllowedVlan) – The swport allowed vlan of this interface (related name of interface)

  • blocked_swports (Reverse ForeignKey from SwPortBlocked) – All blocked swports of this interface (related name of interface)

  • from_adjancency_candidates (Reverse ForeignKey from AdjacencyCandidate) – All from adjancency candidates of this interface (related name of interface)

  • to_adjacency_candidates (Reverse ForeignKey from AdjacencyCandidate) – All to adjacency candidates of this interface (related name of to_interface)

  • connected_to_interface (Reverse ForeignKey from Interface) – All connected to interface of this interface (related name of to_interface)

  • higher_layer (Reverse ForeignKey from InterfaceStack) – All higher layer of this interface (related name of higher)

  • lower_layer (Reverse ForeignKey from InterfaceStack) – All lower layer of this interface (related name of lower)

  • aggregators (Reverse ForeignKey from InterfaceAggregate) – All aggregators of this interface (related name of aggregator)

  • bundled (Reverse ForeignKey from InterfaceAggregate) – All bundled of this interface (related name of interface)

  • routing_protocol_attributes (Reverse ForeignKey from RoutingProtocolAttribute) – All routing protocol attributes of this interface (related name of interface)

  • sensors (Reverse ForeignKey from Sensor) – All sensors of this interface (related name of interface)

  • unrecognized_neighbors (Reverse ForeignKey from UnrecognizedNeighbor) – All unrecognized neighbors of this interface (related name of interface)

  • poe_ports (Reverse ForeignKey from POEPort) – All poe ports of this interface (related name of interface)

  • arnold_identities (Reverse ForeignKey from Identity) – All arnold identities of this interface (related name of interface)

  • patches (Reverse ForeignKey from Patch) – All patches of this interface (related name of interface)

Returns interfaces stacked with this one on a layer above

Type: Reverse ForeignKey from InterfaceAggregate

All aggregators of this interface (related name of aggregator)

Type: Reverse ForeignKey from Identity

All arnold identities of this interface (related name of interface)

Type: IntegerField

Baseport

Returns interfaces stacked with this one on a layer below

Type: Reverse ForeignKey from SwPortBlocked

All blocked swports of this interface (related name of interface)

Type: Reverse ForeignKey from InterfaceAggregate

All bundled of this interface (related name of interface)

Type: Reverse ForeignKey from Interface

All connected to interface of this interface (related name of to_interface)

Type: CharField

Duplex

Choices:

  • f

  • h

Type: Reverse ForeignKey from AdjacencyCandidate

All from adjancency candidates of this interface (related name of interface)

Time since last CAM activity on port, looking at CAM entries for the last interval days.

Returns None if no activity is found, else number of days since last activity as a datetime.timedelta object.

Returns the interface that is selected as an aggregator for me.

Naively selects the aggregator with the lowest ifIndex in cases where there are multiple aggregators (may happen on e.g. Juniper devices, due to stacking of logical units)

Returns the set of allowed vlans as a list of ranges

Return type:

nav.util.NumberRange

Returns the interfaces that are bundled on this interface

Shows the label of the duplex. See get_FOO_display() for more information.

Shows the label of the ifadminstatus. See get_FOO_display() for more information.

Shows the label of the ifoperstatus. See get_FOO_display() for more information.

Returns the newest cam record gotten from this switch port.

Returns a display value for this interface’s link status.

Finds next instance based on gone_since. See get_next_by_FOO() for more information.

Gets a list of available Graphite metrics related to this Interface.

Returns:

A list of dicts describing the metrics, e.g.: {id:”nav.devices.some-gw.ports.gi1_1.ifInOctets”,

suffix:”ifInOctets”}

Finds previous instance based on gone_since. See get_previous_by_FOO() for more information.

Returns a queryset of sorted swportvlans

Converts the list of allowed vlans on trunk to a string of ranges. Ex: [1, 2, 3, 4, 7, 8, 10] -> “1-4,7-8,10”

List of VLAN numbers related to the port

Type: DateTimeField

Gone since

Type: Reverse ForeignKey from GwPortPrefix

All gwport prefixes of this interface (related name of interface)

Returns True if this interface has unrecognized neighbors that are not ignored

Type: Reverse ForeignKey from InterfaceStack

All higher layer of this interface (related name of higher)

Type: AutoField

Primary key: Id

Type: IntegerField

Ifadminstatus

Choices:

  • 1

  • 2

  • 3

Type: VarcharField

Ifalias

Type: BooleanField

Ifconnectorpresent

Type: VarcharField

Ifdescr

Type: IntegerField

Ifindex

Type: IntegerField

Iflastchange

Type: VarcharField

Ifname

Type: IntegerField

Ifoperstatus

Choices:

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

Type: CharField

Ifphysaddress

Type: BooleanField

Ifpromiscuousmode

Type: IntegerField

Iftype

Returns True if interface is administratively up

Returns True if this aggregator has been degraded, False if it has not, None if this interface is not a known aggregator.

Returns True if the interface has an IP address.

NOTE: This doesn’t necessarily mean the port forwards packets for other hosts.

Returns True if the owning Netbox is on maintenance

Returns True if interface is operationally up

Returns true if this interface has a physical connector present

Returns True if the interface is configured as a switch-port

Type: Reverse ForeignKey from InterfaceStack

All lower layer of this interface (related name of lower)

Type: VarcharField

Media

Type: ForeignKey to Module

Module (related name: interfaces)

Internal field, use module instead.

Type: ForeignKey to Netbox

Netbox (related name: interfaces)

Internal field, use netbox instead.

Type: Reverse ForeignKey from Patch

All patches of this interface (related name of interface)

Type: Reverse ForeignKey from POEPort

All poe ports of this interface (related name of interface)

Type: Reverse ForeignKey from RoutingProtocolAttribute

All routing protocol attributes of this interface (related name of interface)

Type: Reverse ForeignKey from Sensor

All sensors of this interface (related name of interface)

Type: FloatField

Speed

Type: Reverse OneToOneField from SwPortAllowedVlan

The swport allowed vlan of this interface (related name of interface)

Type: Reverse ForeignKey from SwPortVlan

All swport vlans of this interface (related name of interface)

Type: Reverse ForeignKey from AdjacencyCandidate

All to adjacency candidates of this interface (related name of to_interface)

Type: ForeignKey to Interface

To interface (related name: connected_to_interface)

Internal field, use to_interface instead.

Type: ForeignKey to Netbox

To netbox (related name: connected_to_interface)

Internal field, use to_netbox instead.

Type: BooleanField

Trunk

Type: Reverse ForeignKey from UnrecognizedNeighbor

All unrecognized neighbors of this interface (related name of interface)

Type: IntegerField

Vlan

Room

From NAV Wiki: The room table defines a wiring closes / network room / server room.

Parameters:
  • id (CharField) – Primary key: Id

  • description (VarcharField) – Description

  • position (PointField) – Position

  • data (HStoreField) – Data

Relationship fields:

Parameters:

location (ForeignKey to Location) – Location (related name: rooms)

Reverse relationships:

Parameters:
  • netboxes (Reverse ForeignKey from Netbox) – All netboxes of this room (related name of room)

  • cabling_set (Reverse ForeignKey from Cabling) – All cabling set of this room (related name of room)

  • images (Reverse ForeignKey from Image) – All images of this room (related name of room)

Type: Reverse ForeignKey from Cabling

All cabling set of this room (related name of room)

Type: HStoreField

Data

Type: VarcharField

Description

Type: CharField

Primary key: Id

Type: Reverse ForeignKey from Image

All images of this room (related name of room)

Type: ForeignKey to Location

Location (related name: rooms)

Internal field, use location instead.

Type: Reverse ForeignKey from Netbox

All netboxes of this room (related name of room)

Type: PointField

Position

Location

The location table defines a group of rooms; i.e. a campus.

Parameters:
  • id (CharField) – Primary key: Id

  • description (VarcharField) – Description

  • data (HStoreField) – Data

Relationship fields:

Parameters:

parent (ForeignKey to Location) – Parent (related name: child_locations)

Reverse relationships:

Parameters:
  • rooms (Reverse ForeignKey from Room) – All rooms of this location (related name of location)

  • child_locations (Reverse ForeignKey from Location) – All child locations of this location (related name of parent)

  • images (Reverse ForeignKey from Image) – All images of this location (related name of location)

Type: Reverse ForeignKey from Location

All child locations of this location (related name of parent)

Type: HStoreField

Data

Type: VarcharField

Description

Return a queryset returning all rooms in this location and sublocations

Type: CharField

Primary key: Id

Type: Reverse ForeignKey from Image

All images of this location (related name of location)

Type: ForeignKey to Location

Parent (related name: child_locations)

Internal field, use parent instead.

Type: Reverse ForeignKey from Room

All rooms of this location (related name of location)

Organization

From NAV Wiki: The org table defines an organization which is in charge of a given netbox and is the user of a given prefix.

Parameters:
  • id (CharField) – Primary key: Id

  • description (VarcharField) – Description

  • contact (VarcharField) – Contact

  • data (HStoreField) – Data

Relationship fields:

Parameters:

parent (ForeignKey to Organization) – Parent (related name: child_organizations)

Reverse relationships:

Parameters:
  • netboxes (Reverse ForeignKey from Netbox) – All netboxes of this organization (related name of organization)

  • child_organizations (Reverse ForeignKey from Organization) – All child organizations of this organization (related name of parent)

  • vlans (Reverse ForeignKey from Vlan) – All vlans of this organization (related name of organization)

  • accounts (Reverse ManyToManyField from Account) – All accounts of this organization (related name of organizations)

  • arnold_identities (Reverse ForeignKey from Identity) – All arnold identities of this organization (related name of organization)

Type: Reverse ManyToManyField from Account

All accounts of this organization (related name of organizations)

Type: Reverse ForeignKey from Identity

All arnold identities of this organization (related name of organization)

Type: Reverse ForeignKey from Organization

All child organizations of this organization (related name of parent)

Type: VarcharField

Contact

Type: HStoreField

Data

Type: VarcharField

Description

Naively extract email addresses from the contact string

Type: CharField

Primary key: Id

Type: Reverse ForeignKey from Netbox

All netboxes of this organization (related name of organization)

Type: ForeignKey to Organization

Parent (related name: child_organizations)

Internal field, use parent instead.

Type: Reverse ForeignKey from Vlan

All vlans of this organization (related name of organization)