From 77e5c874896e8f17aa32fa40b96196a8d2932ff5 Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Sat, 18 Nov 2017 03:57:16 -0600 Subject: docs: Misc Doc updates (#1107) * Move VRP-Huawei.md to new Model-Notes subdir * Update Sources.md with a few improvements: 1. Sync the example table name between the MySQL and SQLite example configs for consistency. 2. Document the very useful custom SQL query parameter (query:) including a couple of examples. * Basic README.md for Model-Notes directory with a simple table for notes/caveats * Markdown quote the Huawei config blocks and link back to README.md * Update Sources.md --- docs/Model-Notes/README.md | 17 +++++++++++++++++ docs/Model-Notes/VRP-Huawei.md | 34 ++++++++++++++++++++++++++++++++++ docs/Sources.md | 36 +++++++++++++++++++++++++++++++++--- docs/VRP-Huawei.md | 27 --------------------------- 4 files changed, 84 insertions(+), 30 deletions(-) create mode 100644 docs/Model-Notes/README.md create mode 100644 docs/Model-Notes/VRP-Huawei.md delete mode 100644 docs/VRP-Huawei.md diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md new file mode 100644 index 0000000..15ab445 --- /dev/null +++ b/docs/Model-Notes/README.md @@ -0,0 +1,17 @@ + + +Model Notes +======================== + + +This directory contains implemention notes and caveats to assist you in your oxidized deployment. + +Use the table below for more information on the Vendor/Model caveats. + + +Vendor | Model |Updated +----------------|-----------------|---------------- +Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 + + +If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues. diff --git a/docs/Model-Notes/VRP-Huawei.md b/docs/Model-Notes/VRP-Huawei.md new file mode 100644 index 0000000..d03c752 --- /dev/null +++ b/docs/Model-Notes/VRP-Huawei.md @@ -0,0 +1,34 @@ +Huawei VRP Configuration +======================== + +Create a user with no privileges + +``` + system-view + [~HUAWEI] aaa + [~HUAWEI-aaa] local-user oxidized password irreversible-cipher verysecret + [*HUAWEI-aaa] local-user oxidized level 1 + [*HUAWEI-aaa] local-user oxidized service-type terminal ssh + [*HUAWEI-aaa] commit +``` + +The commands Oxidized executes are: + +1. screen-length 0 temporary +2. display version +3. display device +4. display current-configuration all + +Command 2 and 3 can be executed without issues, but 1 and 4 are only available for higher level users. Instead of making Oxidized a read/write user on your device, lower the priviledge-level for commands 1 and 4: + +``` + system-view + [~HUAWEI] command-privilege level 1 view global display current-configuration all + [*HUAWEI] command-privilege level 1 view shell screen-length + [*HUAWEI] commit +``` + +Oxidized can now retrieve your configuration! + + +Back to [Model-Notes](README.md) diff --git a/docs/Sources.md b/docs/Sources.md index 4121c89..0a6d1d7 100644 --- a/docs/Sources.md +++ b/docs/Sources.md @@ -61,8 +61,8 @@ source: default: sql sql: adapter: sqlite - database: "/var/lib/oxidized/devices.db" - table: devices + database: "/var/lib/oxidized/nodes.db" + table: nodes map: name: fqdn model: model @@ -72,6 +72,36 @@ source: enable: enable ``` +### Custom SQL Query Support + +You may also implement a custom SQL query to retreive the nodelist using SQL syntax with the `query:` configuration parameter under the `sql:` stanza. + + +#### Custom SQL Query Examples + +You may have a table named `nodes` which contains a boolean to indicate if the nodes should be enabled (fetched via oxidized). This can be used in the custom SQL query to avoid fetching from known impacted nodes. + +In your configuration, you would add the `query:` parameter and specify the SQL query. Make sure to put this within the `sql:` configuration section. + +```sql +query: "SELECT * FROM nodes WHERE enabled = True" +``` + +Since this is an SQL query, you can also provide a more advanced query to assist in more complicated oxidized deployments. The exact deployment is up to you on how you design your database and oxidized fetchers. + +In this example we limit the nodes to two "POPs" of `mypop1` and `mypop2`. We also require the nodes to have the `enabled` boolean set to `True`. + +```sql +query: "SELECT * FROM nodes WHERE pop IN ('mypop1','mypop2') AND enabled = True" +``` +The order of the nodes returned will influence the order that nodes are fetched by oxidized. You can use standard SQL `ORDER BY` clauses to influence the node order. + +You should always test your SQL query before using it in the oxidized configuration as there is no syntax or error checking performed before sending it to the database engine. + +Consult your database documentation for more information on query language and table optimization. + + + ### Source: HTTP One object per device. @@ -107,4 +137,4 @@ source: url: https://url/api scheme: https secure: false -``` \ No newline at end of file +``` diff --git a/docs/VRP-Huawei.md b/docs/VRP-Huawei.md deleted file mode 100644 index 9e97b7d..0000000 --- a/docs/VRP-Huawei.md +++ /dev/null @@ -1,27 +0,0 @@ -Huawei VRP Configuration -======================== - -Create a user with no privileges - - system-view - [~HUAWEI] aaa - [~HUAWEI-aaa] local-user oxidized password irreversible-cipher verysecret - [*HUAWEI-aaa] local-user oxidized level 1 - [*HUAWEI-aaa] local-user oxidized service-type terminal ssh - [*HUAWEI-aaa] commit - -The commands Oxidized executes are: - -1. screen-length 0 temporary -2. display version -3. display device -4. display current-configuration all - -Command 2 and 3 can be executed without issues, but 1 and 4 are only available for higher level users. Instead of making Oxidized a read/write user on your device, lower the priviledge-level for commands 1 and 4: - - system-view - [~HUAWEI] command-privilege level 1 view global display current-configuration all - [*HUAWEI] command-privilege level 1 view shell screen-length - [*HUAWEI] commit - -Oxidized can now retrieve your configuration! \ No newline at end of file -- cgit v1.2.1