Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
brian-polling-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
brian
brian-polling-manager
Commits
0eabd59f
Commit
0eabd59f
authored
4 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
added cli doc
parent
fc6c3150
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
brian_polling_manager/cli.py
+28
-0
28 additions, 0 deletions
brian_polling_manager/cli.py
docs/source/cli.rst
+6
-0
6 additions, 0 deletions
docs/source/cli.rst
docs/source/index.rst
+9
-10
9 additions, 10 deletions
docs/source/index.rst
with
43 additions
and
10 deletions
brian_polling_manager/cli.py
+
28
−
0
View file @
0eabd59f
"""
This script queries Inventory Provider for changes
and configures Sensu with the snmp polling checks
required by BRIAN.
.. code-block:: console
% python brian_polling_manager/cli.py --help
Usage: cli.py [OPTIONS]
Update BRIAN snmp checks based on Inventory Provider data.
Options:
--config TEXT configuration filename
--force / --no-force update even if inventory hasn
'
t been updated
--help Show this message and exit.
The required configuration file must be
formatted according to the following schema:
.. asjson::
brian_polling_manager.cli.CONFIG_SCHEMA
"""
import
json
import
json
import
logging
import
logging
import
os
import
os
...
@@ -194,6 +219,9 @@ def _validate_config(ctx, param, value):
...
@@ -194,6 +219,9 @@ def _validate_config(ctx, param, value):
default
=
False
,
default
=
False
,
help
=
"
update even if inventory hasn
'
t been updated
"
)
help
=
"
update even if inventory hasn
'
t been updated
"
)
def
main
(
config
,
force
):
def
main
(
config
,
force
):
"""
Update BRIAN snmp checks based on Inventory Provider data.
"""
state
=
State
(
config
[
'
statedir
'
])
state
=
State
(
config
[
'
statedir
'
])
last
=
inventory
.
last_update_timestamp
(
config
[
'
inventory
'
])
last
=
inventory
.
last_update_timestamp
(
config
[
'
inventory
'
])
...
...
This diff is collapsed.
Click to expand it.
docs/source/cli.rst
0 → 100644
+
6
−
0
View file @
0eabd59f
cli
===================================================
.. automodule:: brian_polling_manager.cli
This diff is collapsed.
Click to expand it.
docs/source/index.rst
+
9
−
10
View file @
0eabd59f
...
@@ -3,18 +3,17 @@
...
@@ -3,18 +3,17 @@
You can adapt this file completely to your liking, but it should at least
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
contain the root `toctree` directive.
Welcome to BRIAN Polling Manager's documentation!
=================================================
.. toctree::
BRIAN Polling Manager
:maxdepth: 2
======================
:caption: Contents:
Documentation for BRIAN Polling Manager.
This application queries Inventory Provider and configures
Sensu checks for polling the data required by BRIAN.
Indices and tables
.. toctree::
==================
:maxdepth: 2
:caption: Contents:
* :ref:`genindex`
cli
* :ref:`modindex`
* :ref:`search`
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment