Sensor database model

Bases: django.db.models.base.Model

This table contains meta-data about available sensors in network equipment.

Information from this table is used to poll metrics and display graphs for sensor data.

Bases: django.core.exceptions.ObjectDoesNotExist

Bases: django.core.exceptions.MultipleObjectsReturned

Try to normalize the unit

The unit_of_measurement is the value reported by the device, and is all sorts of stuff like percentRH, Celcius. Here we try to normalize those units (in a very basic way).

ipdevpoll sensor plugin

ipdevpoll plugin to collect sensor data.

This plugin can use any MibRetriever class that provides the get_all_sensors() method to discover and store information about physical environmental sensors available for readout on a device.

Which MibRetriever classes to use for each type of device is configured in the [sensors] and [sensors:vendormibs] sections of ipdevpoll.conf.

Bases: nav.ipdevpoll.Plugin

Plugin to detect environmental sensors in netboxes

Collects sensors and feed them in to persistent store.

Returns a list of MibRetriever instances, as configured in ipdevpoll.conf, to use for retrieving sensors from this netbox.

Called as the plugin class is loaded in the plugin registry.

Can be used to perform any kind of initialization task that doesn’t fit into module-level initialization.

Tries to safely decode strings retrieved using SNMP.

SNMP does not really define encodings, and will not normally allow non-ASCII strings to be written (though binary data is fine). Sometimes, administrators have been able to enter descriptions containing non-ASCII characters using CLI’s or web interfaces. The encoding of these are undefined and unknown. To ensure they can be safely stored in the database (which only accepts UTF-8), we make various attempts at decoding strings to unicode objects before the database becomes involved.