Skip to content

Commit

Permalink
Merge pull request #2856 from johannaengland/docs/remove-warnings
Browse files Browse the repository at this point in the history
Remove warnings when building docs
  • Loading branch information
johannaengland authored Mar 5, 2024
2 parents 91f71e1 + 00a96e9 commit adae194
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 49 deletions.
4 changes: 2 additions & 2 deletions NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ Daemon startup privileges

By accident, some of NAV's daemons have been running as the privileged ``root``
user since NAV 4.9.0, due to changes in the process control system. NAV 5.0.4
introduces the :option:`privileged` option in the :file:`daemons.yml` configuration
introduces the ``privileged`` option in the :file:`daemons.yml` configuration
file, to signal which daemons actually need to be started with root privileges.

Only :program:`snmptrapd` and :program:`pping` need root privileges on startup,
Expand All @@ -573,7 +573,7 @@ Please ensure your :file:`daemon.yml` configuration file is updated. Also, be
aware that after upgrading to NAV 5.0.4 from any version from 4.9.0 and up, you
may have some NAV log files that are owned by ``root``, which will cause some
of the daemons to fail on startup. Please ensure all NAV log files are writable
for the user defined as :option:`NAV_USER` in :file:`nav.conf`.
for the user defined as ``NAV_USER`` in :file:`nav.conf`.


New features
Expand Down
5 changes: 5 additions & 0 deletions doc/faq/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,8 @@ example::
* 6 * * * navclean --force --arp --cam --interval '6 months'

See the output of ``navclean --help`` for usage details.

.. toctree::
:hidden:

/faq/graph_gaps
8 changes: 7 additions & 1 deletion doc/hacking/adding-environment-probe-support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ temperature sensors of this device into NAV's database. The
:program:`ipdevpoll` ``1minstats`` job will retrieve the sensor readings once
every minute and send them to Graphite.

.. _sensorProbe8: http://www.akcpinc.com/products/base-units/sensorProbe-Series/sensorProbe8/
.. toctree::
:hidden:

/api/sensor
/api/mibretriever

.. _sensorProbe8: https://www.akcp.com/akcp-products/sensorprobe-series/sensorprobe8/
.. _Twisted: https://twistedmatrix.com/
.. _Deferred: http://twistedmatrix.com/documents/current/api/twisted.internet.defer.Deferred.html
193 changes: 190 additions & 3 deletions doc/reference/alerttypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ Tells us whether a link is up or down.

* - Alert type name
- Description
* - ``linkUp``
- Link active
* - ``linkDown``
- Link inactive



Expand Down Expand Up @@ -196,13 +200,13 @@ Registers the state of a device
* - Alert type name
- Description
* - ``deviceInIPOperation``
- The device is now in operation with an active IP address.
- The device is now in operation with an active IP address
* - ``deviceInStack``
- The device is now in operation as a chassis module.
- The device is now in operation as a chassis module
* - ``deviceRMA``
- RMA event for device.
* - ``deviceNewModule``
- The device has been found as a module.
- The device has been found as a module.
* - ``deviceNewChassis``
- The device has been found as a chassis.
* - ``deviceNewPsu``
Expand All @@ -212,6 +216,7 @@ Registers the state of a device




*deviceNotice* events
---------------------
Registers a notice on a device
Expand Down Expand Up @@ -380,3 +385,185 @@ The state of this BGP peering session changed



*juniperYellowAlarmState* events
--------------------------------
Tells us if a Juniper device has any open yellow alarms.

.. list-table:: Alerts associated with juniperYellowAlarmState events
:widths: 25 75
:header-rows: 1

* - Alert type name
- Description
* - ``juniperYellowAlarmOn``
- The Juniper device has some yellow alarms.
* - ``juniperYellowAlarmOff``
- The Juniper device has no yellow alarms.




*juniperRedAlarmState* events
-----------------------------
Tells us if a Juniper device has any open red alarms.

.. list-table:: Alerts associated with juniperRedAlarmState events
:widths: 25 75
:header-rows: 1

* - Alert type name
- Description
* - ``juniperRedAlarmOn``
- The Juniper device has some red alarms.
* - ``juniperRedAlarmOff``
- The Juniper device has no red alarms.




*weathergoose_temperature* events
---------------------------------


.. list-table:: Alerts associated with weathergoose_temperature events
:widths: 25 75
:header-rows: 1

* - Alert type name
- Description
* - ``cmClimateTempCTRAP``
- Climate Temperature Sensor Trap
* - ``cmClimateTempCCLEAR``
- Climate Temperature Sensor Clear Trap
* - ``cmClimateTempCNOTIFY``
- Climate Temperature Sensor Trap
* - ``cmTempSensorTempCNOTIFY``
- Remote Temp Sensor - Temperature Trap
* - ``cmTempSensorTempCCLEAR``
- Remote Temp Sensor - Temperature Clear Trap
* - ``gstClimateTempCNOTIFY``
- Climate Temperature Sensor Trap
* - ``gstTempSensorTempCNOTIFY``
- Remote Temp Sensor - Temperature Trap
* - ``gstClimateTempCCLEAR``
- Climate Temperature Sensor Clear Trap
* - ``gstTempSensorTempCCLEAR``
- Remote Temp Sensor - Temperature Clear Trap




*weathergoose_humidity* events
------------------------------


.. list-table:: Alerts associated with weathergoose_humidity events
:widths: 25 75
:header-rows: 1

* - Alert type name
- Description
* - ``cmClimateHumidityTRAP``
- Climate Humidity Sensor Trap
* - ``cmClimateHumidityCLEAR``
- Climate Humidity Sensor Clear Trap
* - ``cmClimateHumidityNOTIFY``
- Climate Humidity Sensor Trap
* - ``gstClimateHumidityNOTIFY``
- Climate Humidity Sensor Trap
* - ``gstClimateHumidityCLEAR``
- Climate Humidity Sensor Clear Trap




*weathergoose_airflow* events
-----------------------------


.. list-table:: Alerts associated with weathergoose_airflow events
:widths: 25 75
:header-rows: 1

* - Alert type name
- Description
* - ``cmClimateAirflowTRAP``
- Climate Air Flow Sensor Trap
* - ``cmClimateAirflowCLEAR``
- Climate Air Flow Sensor Clear Trap
* - ``cmClimateAirflowNOTIFY``
- Climate Air Flow Sensor Trap
* - ``gstClimateAirflowNOTIFY``
- Climate Air Flow Sensor Trap
* - ``gstClimateAirflowCLEAR``
- Climate Air Flow Sensor Clear Trap




*weathergoose_light* events
---------------------------


.. list-table:: Alerts associated with weathergoose_light events
:widths: 25 75
:header-rows: 1

* - Alert type name
- Description
* - ``cmClimateLightTRAP``
- Climate Light Sensor Trap
* - ``cmClimateLightCLEAR``
- Climate Light Sensor Clear Trap
* - ``cmClimateLightNOTIFY``
- Climate Light Sensor Trap
* - ``gstClimateLightNOTIFY``
- Climate Light Sensor Trap
* - ``gstClimateLightCLEAR``
- Climate Light Sensor Clear Trap




*weathergoose_sound* events
---------------------------


.. list-table:: Alerts associated with weathergoose_sound events
:widths: 25 75
:header-rows: 1

* - Alert type name
- Description
* - ``cmClimateSoundTRAP``
- Climate Sound Sensor Trap
* - ``cmClimateSoundCLEAR``
- Climate Sound Sensor Clear Trap
* - ``cmClimateSoundNOTIFY``
- Climate Sound Sensor Trap
* - ``gstClimateSoundNOTIFY``
- Climate Sound Sensor Trap
* - ``gstClimateSoundCLEAR``
- Climate Sound Sensor Clear Trap




*upsPowerState* events
----------------------
UPS running on battery or utility power

.. list-table:: Alerts associated with upsPowerState events
:widths: 25 75
:header-rows: 1

* - Alert type name
- Description
* - ``upsOnBatteryPower``
- Ups running on battery power
* - ``upsOnUtilityPower``
- Ups running on utility power




2 changes: 2 additions & 0 deletions doc/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ This section contains reference material for end-users.
ipdevpoll
external_authentication
mailin
models-event
models-manage
navstats
portadmin
radius
Expand Down
44 changes: 5 additions & 39 deletions doc/reference/ipdevpoll.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,7 @@ intervals. These jobs are fully user-configurable.
Usage
=====

::

usage: ipdevpolld [-h] [--version] [-f] [-s] [-j] [-p] [-J JOBNAME]
[-n NETBOX] [-m [WORKERS]] [-M JOBS] [-P] [--capture-vars]
[-c] [--threadpoolsize COUNT] [--worker]

optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
-f, --foreground run in foreground instead of daemonizing
-s, --log-stderr log to stderr instead of log file
-j, --list-jobs print a list of configured jobs and exit
-p, --list-plugins load and print a list of configured plugins
-J JOBNAME run only JOBNAME jobs in this process
-n NETBOX, --netbox NETBOX
Run JOBNAME once for NETBOX. Also implies -f and -s
options.
-m [WORKERS], --multiprocess [WORKERS]
Run ipdevpoll in a multiprocess setup. If WORKERS is
not set it will default to number of cpus in the
system
-M JOBS, --max-jobs-per-worker JOBS
Restart worker processes after completing JOBS jobs.
(Default: Don't restart)
-P, --pidlog Include process ID in every log line
--capture-vars Capture and print locals and globals in tracebacks
when debug logging
-c, --clean cleans/purges old job log entries from the database
and then exits
--threadpoolsize COUNT
the number of database worker threads, and thus db
connections, to use in this process
--worker Used internally when lauching worker processes

This program runs SNMP polling jobs for IP devices monitored by NAV
.. program-output:: ipdevpolld --help

Manually running a job for a given netbox
-----------------------------------------
Expand Down Expand Up @@ -169,7 +135,7 @@ are reserved for synchronous communication with the PostgreSQL database
backend. Even on a multi-core server, this means all of ipdevpoll's work is
limited to a single core. Once ipdevpoll's workload grows beyond what a single
core can handle, ipdevpoll can optionally run in a *multiprocess mode*, using
the :option:`--multiprocess` option.
the ``--multiprocess`` option.

In multiprocess mode, ipdevpoll spawns a number of worker processes, while the
master process becomes a simple job scheduler, distributing the actual jobs to
Expand All @@ -179,7 +145,7 @@ the individual workers.

ipdevpoll's default number of workers processes and threads aren't
necessarily sane for multiprocess usage. Unless a number of workers is
supplied to the :option:`--multiprocess` option, it will spawn a number of
supplied to the ``--multiprocess`` option, it will spawn a number of
workers corresponding to the number of cores it detects on your system. The
default number of database threads in ipdevpoll's threadpool is **10** per process,
which means each worker process will create **10 individual connections to
Expand All @@ -189,13 +155,13 @@ the individual workers.
default pool of 100 available connections, causing other NAV processes to
be unable to connect to the database. When enabling multiprocess mode, you
should really tune down the threadpool size by adding the
:option:`--threadpoolsize` option.
``--threadpoolsize`` option.


Another good thing about the multiprocess mode is that you can limit the
number of jobs any worker process will run before it is killed and respawned.
This may provide additional protection against unintended resource leaks. See
the :option:`--max-jobs-per-worker` option.
the ``--max-jobs-per-worker`` option.

You can make sure ipdevpoll always runs in multiprocess mode by altering the
``command`` option in the ``ipdevpoll`` entry of the configuration file
Expand Down
6 changes: 2 additions & 4 deletions python/nav/mibs/mibretriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,13 @@ class MibTableResultRow(dict):
Acts as a dictionary. The row index is available through the
integer key 0, or as the member attribute 'index'.
"""

def __init__(self, index, columns=None):
"""Initialize with the row index of this row.
index -- index OID
columns -- optional list of column names to pre-allocate with
None values.
:param index: index OID
:param columns: optional list of column names to pre-allocate with None values.
"""
if columns is None:
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ setenv =
LANG=C.UTF-8
VIRTUALENV_PIP=23.1.0
allowlist_externals = sh
commands_pre =
commands =
sphinx-build doc/ doc/_build/
sh -c "cd doc; python -c 'import conf; print(conf.version)' > {toxinidir}/reports/doc_version"
Expand Down

0 comments on commit adae194

Please sign in to comment.