nav.models.manage.
Sensor
(*args, **kwargs)¶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.
DoesNotExist
¶Bases: django.core.exceptions.ObjectDoesNotExist
MultipleObjectsReturned
¶Bases: django.core.exceptions.MultipleObjectsReturned
normalized_unit
¶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 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.
nav.ipdevpoll.plugins.sensors.
Sensors
(netbox, agent, containers, config=None)¶Bases: nav.ipdevpoll.Plugin
Plugin to detect environmental sensors in netboxes
handle
(**kwargs)¶Collects sensors and feed them in to persistent store.
mibfactory
(**kwargs)¶Returns a list of MibRetriever instances, as configured in ipdevpoll.conf, to use for retrieving sensors from this netbox.
on_plugin_load
()¶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.
nav.ipdevpoll.plugins.sensors.
get_mib_map
(config)¶nav.ipdevpoll.plugins.sensors.
loadmodules
(config)¶nav.ipdevpoll.plugins.sensors.
safestring
(string, encodings_to_try=('utf-8', 'latin-1'))¶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.