summaryrefslogtreecommitdiff
path: root/docs/Sources.md
diff options
context:
space:
mode:
authorKodApa85 <parsons151185@gmail.com>2018-04-13 20:30:43 +0100
committerGitHub <noreply@github.com>2018-04-13 20:30:43 +0100
commitdbbe6af563072b62e373a9824c6a23482d20896e (patch)
treeab5341e8b1cd37aa0abf54662714f272cd8f9633 /docs/Sources.md
parent97aa0535a0c8c237c1ccb7a1683d5f6faa1f0339 (diff)
parent56ec279b2e9e2735ed88405fd177e77f9e376801 (diff)
Merge branch 'master' into xgs4600-cli
Diffstat (limited to 'docs/Sources.md')
-rw-r--r--docs/Sources.md52
1 files changed, 28 insertions, 24 deletions
diff --git a/docs/Sources.md b/docs/Sources.md
index 7029b72..6d8e19e 100644
--- a/docs/Sources.md
+++ b/docs/Sources.md
@@ -1,10 +1,10 @@
-## Source
+# Sources
-### Source: CSV
+## Source: CSV
-One line per device, colon seperated. If `ip` isn't present, a DNS lookup will be done against `name`. For large installations, setting `ip` will dramatically reduce startup time.
+One line per device, colon separated. If `ip` isn't present, a DNS lookup will be done against `name`. For large installations, setting `ip` will dramatically reduce startup time.
-```
+```yaml
source:
default: csv
csv:
@@ -22,7 +22,7 @@ source:
Example csv `/var/lib/oxidized/router.db`:
-```
+```text
rtr01.local:192.168.1.1:ios:oxidized:5uP3R53cR3T:T0p53cR3t
```
@@ -41,25 +41,31 @@ source:
model: 1
```
-> Please note, if you are running GPG v2 then you will be prompted for your gpg password on start up, if you use GPG >= 2.1 then you can add the following config to stop that behaviour:
+Please note, if you are running GPG v2 then you will be prompted for your gpg password on start up, if you use GPG >= 2.1 then you can add the following config to stop that behaviour:
-> Within `~/.gnupg/gpg-agent.conf`
+Within `~/.gnupg/gpg-agent.conf`
+
+```text
+allow-loopback-pinentry
+```
-> `allow-loopback-pinentry`
+and within: `~/.gnupg/gpg.conf`
-> and within: `~/.gnupg/gpg.conf`
+```text
+pinentry-mode loopback
+```
-> `pinentry-mode loopback`
+## Source: SQL
-### Source: SQL
Oxidized uses the `sequel` ruby gem. You can use a variety of databases that aren't explicitly listed. For more information visit https://github.com/jeremyevans/sequel Make sure you have the correct adapter!
-### Source: MYSQL
+
+## Source: MYSQL
`sudo apt-get install libmysqlclient-dev`
The values correspond to your fields in the DB such that ip, model, etc are field names in the DB
-```
+```yaml
source:
default: sql
sql:
@@ -77,11 +83,11 @@ source:
enable: enable
```
-### Source: SQLite
+## Source: SQLite
One row per device, filtered by hostname.
-```
+```yaml
source:
default: sql
sql:
@@ -97,12 +103,11 @@ 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 Support
+You may also implement a custom SQL query to retrieve the nodelist using SQL syntax with the `query:` configuration parameter under the `sql:` stanza.
-#### Custom SQL Query Examples
+### 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.
@@ -119,21 +124,20 @@ In this example we limit the nodes to two "POPs" of `mypop1` and `mypop2`. We al
```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
+## Source: HTTP
One object per device.
HTTP Supports basic auth, configure the user and pass you want to use under the http: section.
-```
+```yaml
source:
default: http
http:
@@ -155,7 +159,7 @@ source:
You can also pass `secure: false` if you want to disable ssl certificate verification:
-```
+```yaml
source:
default: http
http: