oxidized 0.21.0 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/no-response.yml +13 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +37 -0
- data/.rubocop_todo.yml +714 -0
- data/.travis.yml +7 -1
- data/CHANGELOG.md +341 -243
- data/Dockerfile +44 -16
- data/LICENSE +201 -0
- data/README.md +114 -82
- data/Rakefile +19 -0
- data/TODO.md +29 -23
- data/bin/oxidized +1 -2
- data/docs/Configuration.md +71 -31
- data/docs/Creating-Models.md +78 -0
- data/docs/Hooks.md +145 -41
- data/docs/Model-Notes/AireOS.md +12 -0
- data/docs/Model-Notes/ArbOS.md +12 -0
- data/docs/Model-Notes/Comware.md +14 -0
- data/docs/Model-Notes/EOS.md +9 -0
- data/docs/Model-Notes/JunOS.md +34 -0
- data/docs/Model-Notes/Netgear.md +68 -0
- data/docs/Model-Notes/README.md +19 -0
- data/docs/{VRP-Huawei.md → Model-Notes/VRP-Huawei.md} +10 -2
- data/docs/Model-Notes/XGS4600-Zyxel.md +39 -0
- data/docs/Outputs.md +27 -28
- data/docs/Ruby-API.md +38 -18
- data/docs/Sources.md +78 -16
- data/docs/Supported-OS-Types.md +171 -148
- data/extra/oxidized.logrotate +7 -0
- data/extra/oxidized.service +1 -1
- data/extra/rest_client.rb +4 -5
- data/extra/syslog.rb +16 -16
- data/lib/oxidized/cli.rb +3 -3
- data/lib/oxidized/config.rb +7 -4
- data/lib/oxidized/core.rb +3 -3
- data/lib/oxidized/hook.rb +64 -65
- data/lib/oxidized/hook/awssns.rb +2 -3
- data/lib/oxidized/hook/ciscosparkdiff.rb +49 -0
- data/lib/oxidized/hook/exec.rb +5 -5
- data/lib/oxidized/hook/githubrepo.rb +20 -14
- data/lib/oxidized/hook/slackdiff.rb +38 -19
- data/lib/oxidized/hook/xmppdiff.rb +58 -0
- data/lib/oxidized/input/cli.rb +5 -6
- data/lib/oxidized/input/ftp.rb +8 -7
- data/lib/oxidized/input/http.rb +39 -0
- data/lib/oxidized/input/ssh.rb +24 -22
- data/lib/oxidized/input/telnet.rb +38 -32
- data/lib/oxidized/jobs.rb +3 -4
- data/lib/oxidized/manager.rb +9 -4
- data/lib/oxidized/model/acos.rb +15 -16
- data/lib/oxidized/model/acsw.rb +3 -8
- data/lib/oxidized/model/aen.rb +1 -2
- data/lib/oxidized/model/aireos.rb +3 -5
- data/lib/oxidized/model/alteonos.rb +16 -18
- data/lib/oxidized/model/alvarion.rb +0 -4
- data/lib/oxidized/model/aos.rb +2 -4
- data/lib/oxidized/model/aos7.rb +2 -3
- data/lib/oxidized/model/aosw.rb +13 -15
- data/lib/oxidized/model/apc_aos.rb +0 -3
- data/lib/oxidized/model/arbos.rb +26 -0
- data/lib/oxidized/model/aricentiss.rb +51 -0
- data/lib/oxidized/model/asa.rb +33 -35
- data/lib/oxidized/model/asyncos.rb +41 -44
- data/lib/oxidized/model/audiocodes.rb +4 -8
- data/lib/oxidized/model/awplus.rb +84 -0
- data/lib/oxidized/model/boss.rb +6 -5
- data/lib/oxidized/model/br6910.rb +43 -45
- data/lib/oxidized/model/c4cmts.rb +3 -5
- data/lib/oxidized/model/cambium.rb +22 -0
- data/lib/oxidized/model/catos.rb +0 -2
- data/lib/oxidized/model/cisconga.rb +1 -3
- data/lib/oxidized/model/ciscosma.rb +37 -40
- data/lib/oxidized/model/ciscosmb.rb +7 -4
- data/lib/oxidized/model/comnetms.rb +43 -0
- data/lib/oxidized/model/comware.rb +9 -9
- data/lib/oxidized/model/coriant8600.rb +3 -5
- data/lib/oxidized/model/coriantgroove.rb +3 -5
- data/lib/oxidized/model/corianttmos.rb +1 -3
- data/lib/oxidized/model/cumulus.rb +26 -32
- data/lib/oxidized/model/datacom.rb +0 -2
- data/lib/oxidized/model/dcnos.rb +46 -0
- data/lib/oxidized/model/dlink.rb +1 -1
- data/lib/oxidized/model/dnos.rb +9 -5
- data/lib/oxidized/model/edgecos.rb +45 -0
- data/lib/oxidized/model/edgeos.rb +5 -3
- data/lib/oxidized/model/edgeswitch.rb +1 -3
- data/lib/oxidized/model/enterasys.rb +1 -3
- data/lib/oxidized/model/eos.rb +6 -8
- data/lib/oxidized/model/fabricos.rb +3 -5
- data/lib/oxidized/model/firewareos.rb +2 -5
- data/lib/oxidized/model/fortios.rb +21 -17
- data/lib/oxidized/model/ftos.rb +2 -4
- data/lib/oxidized/model/fujitsupy.rb +2 -4
- data/lib/oxidized/model/gaiaos.rb +6 -10
- data/lib/oxidized/model/gcombnps.rb +82 -0
- data/lib/oxidized/model/hatteras.rb +8 -5
- data/lib/oxidized/model/hirschmann.rb +8 -10
- data/lib/oxidized/model/hpebladesystem.rb +19 -17
- data/lib/oxidized/model/hpemsa.rb +0 -3
- data/lib/oxidized/model/ios.rb +54 -55
- data/lib/oxidized/model/iosxe.rb +5 -0
- data/lib/oxidized/model/iosxr.rb +1 -3
- data/lib/oxidized/model/ipos.rb +1 -3
- data/lib/oxidized/model/ironware.rb +12 -15
- data/lib/oxidized/model/isam.rb +4 -5
- data/lib/oxidized/model/junos.rb +8 -7
- data/lib/oxidized/model/masteros.rb +1 -3
- data/lib/oxidized/model/mlnxos.rb +3 -4
- data/lib/oxidized/model/model.rb +15 -7
- data/lib/oxidized/model/mtrlrfs.rb +1 -4
- data/lib/oxidized/model/ndms.rb +24 -0
- data/lib/oxidized/model/netgear.rb +3 -4
- data/lib/oxidized/model/netscaler.rb +0 -2
- data/lib/oxidized/model/nos.rb +1 -3
- data/lib/oxidized/model/nxos.rb +13 -3
- data/lib/oxidized/model/oneos.rb +6 -8
- data/lib/oxidized/model/openbsd.rb +76 -0
- data/lib/oxidized/model/opengear.rb +3 -5
- data/lib/oxidized/model/openwrt.rb +77 -0
- data/lib/oxidized/model/opnsense.rb +19 -0
- data/lib/oxidized/model/outputs.rb +1 -3
- data/lib/oxidized/model/panos.rb +1 -2
- data/lib/oxidized/model/pfsense.rb +9 -5
- data/lib/oxidized/model/planet.rb +8 -12
- data/lib/oxidized/model/powerconnect.rb +6 -9
- data/lib/oxidized/model/procurve.rb +18 -4
- data/lib/oxidized/model/quantaos.rb +3 -5
- data/lib/oxidized/model/routeros.rb +3 -2
- data/lib/oxidized/model/saos.rb +0 -1
- data/lib/oxidized/model/screenos.rb +3 -5
- data/lib/oxidized/model/sgos.rb +2 -3
- data/lib/oxidized/model/siklu.rb +0 -2
- data/lib/oxidized/model/slxos.rb +59 -0
- data/lib/oxidized/model/sros.rb +117 -0
- data/lib/oxidized/model/stoneos.rb +32 -0
- data/lib/oxidized/model/supermicro.rb +6 -41
- data/lib/oxidized/model/timos.rb +6 -114
- data/lib/oxidized/model/tmos.rb +1 -3
- data/lib/oxidized/model/tplink.rb +7 -11
- data/lib/oxidized/model/trango.rb +6 -7
- data/lib/oxidized/model/ucs.rb +0 -1
- data/lib/oxidized/model/voltaire.rb +3 -6
- data/lib/oxidized/model/voss.rb +1 -2
- data/lib/oxidized/model/vrp.rb +4 -5
- data/lib/oxidized/model/vyatta.rb +6 -4
- data/lib/oxidized/model/weos.rb +1 -3
- data/lib/oxidized/model/xos.rb +6 -5
- data/lib/oxidized/model/zhoneolt.rb +2 -2
- data/lib/oxidized/model/zynos.rb +1 -3
- data/lib/oxidized/model/zynoscli.rb +36 -0
- data/lib/oxidized/node.rb +11 -11
- data/lib/oxidized/node/stats.rb +15 -2
- data/lib/oxidized/nodes.rb +8 -8
- data/lib/oxidized/output/file.rb +41 -42
- data/lib/oxidized/output/git.rb +113 -115
- data/lib/oxidized/output/gitcrypt.rb +241 -242
- data/lib/oxidized/output/http.rb +23 -27
- data/lib/oxidized/output/output.rb +1 -2
- data/lib/oxidized/source/csv.rb +44 -45
- data/lib/oxidized/source/http.rb +52 -49
- data/lib/oxidized/source/source.rb +6 -7
- data/lib/oxidized/source/sql.rb +55 -51
- data/lib/oxidized/string.rb +3 -4
- data/lib/oxidized/version.rb +17 -1
- data/lib/oxidized/worker.rb +12 -3
- data/oxidized.gemspec +19 -13
- metadata +139 -51
- data/.ruby-version +0 -1
- data/Gemfile.lock +0 -44
data/Dockerfile
CHANGED
@@ -1,30 +1,58 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# -- stage 1: backport libssh2 1.7.0 from zesty for xenial, as githubrepo hook requires it
|
2
|
+
FROM ubuntu:xenial as libssh2-backport
|
3
|
+
|
4
|
+
# set up dependencies for the build process
|
5
|
+
RUN apt-get -yq update && \
|
6
|
+
apt-get -yq install build-essential chrpath debhelper dh-autoreconf libgcrypt20-dev zlib1g-dev
|
7
|
+
|
8
|
+
# build libssh2 1.7.0
|
9
|
+
WORKDIR /tmp/libssh2-build
|
10
|
+
ADD https://launchpad.net/ubuntu/+archive/primary/+files/libssh2_1.7.0-1ubuntu1.debian.tar.xz .
|
11
|
+
ADD https://launchpad.net/ubuntu/+archive/primary/+files/libssh2_1.7.0.orig.tar.gz .
|
12
|
+
RUN tar xvf libssh2_1.7.0.orig.tar.gz
|
13
|
+
WORKDIR /tmp/libssh2-build/libssh2-1.7.0
|
14
|
+
RUN tar xvf ../libssh2_1.7.0-1ubuntu1.debian.tar.xz
|
15
|
+
|
16
|
+
WORKDIR /tmp/libssh2-build/libssh2-1.7.0
|
17
|
+
ENV DEB_BUILD_OPTIONS nocheck
|
18
|
+
RUN dpkg-buildpackage -b
|
19
|
+
|
20
|
+
# -- stage 2: build the actual oxidized container
|
21
|
+
FROM phusion/baseimage:0.10.0
|
22
|
+
LABEL maintainer="Samer Abdel-Hafez <sam@arahant.net>"
|
23
|
+
|
24
|
+
# set up dependencies for the build process
|
25
|
+
RUN apt-get -yq update && \
|
26
|
+
apt-get -yq install ruby2.3 ruby2.3-dev libsqlite3-dev libssl-dev pkg-config make cmake libssh2-1-dev git g++ libffi-dev ruby-bundler
|
27
|
+
|
28
|
+
# upgrade libssh2 to self-built backport from stage 1
|
29
|
+
COPY --from=libssh2-backport \
|
30
|
+
/tmp/libssh2-build/libssh2-1_1.7.0-1ubuntu1_amd64.deb \
|
31
|
+
/tmp/libssh2-build/libssh2-1-dev_1.7.0-1ubuntu1_amd64.deb \
|
32
|
+
/tmp/
|
33
|
+
RUN dpkg -i /tmp/*.deb
|
3
34
|
|
4
|
-
|
5
|
-
|
6
|
-
apt-get install -y ruby2.3 ruby2.3-dev libsqlite3-dev libssl-dev pkg-config make cmake libssh2-1-dev git g++
|
35
|
+
# dependencies for hooks
|
36
|
+
RUN gem install aws-sdk slack-api xmpp4r cisco_spark
|
7
37
|
|
8
|
-
|
38
|
+
# build and install oxidized
|
9
39
|
COPY . /tmp/oxidized/
|
10
40
|
WORKDIR /tmp/oxidized
|
11
41
|
|
12
|
-
|
13
|
-
RUN
|
42
|
+
# docker automated build gets shallow copy, but non-shallow copy cannot be unshallowed
|
43
|
+
RUN git fetch --unshallow || true
|
44
|
+
RUN rake install
|
14
45
|
|
15
46
|
# web interface
|
16
47
|
RUN gem install oxidized-web --no-ri --no-rdoc
|
17
48
|
|
18
|
-
#
|
19
|
-
|
20
|
-
RUN gem install slack-api
|
21
|
-
|
49
|
+
# clean up
|
50
|
+
WORKDIR /
|
22
51
|
RUN rm -rf /tmp/oxidized
|
52
|
+
RUN rm /tmp/*.deb
|
53
|
+
RUN apt-get -yq --purge autoremove ruby-dev pkg-config make cmake ruby-bundler
|
23
54
|
|
24
|
-
|
25
|
-
|
26
|
-
RUN apt-get -y autoremove
|
27
|
-
|
55
|
+
# add runit services
|
28
56
|
ADD extra/oxidized.runit /etc/service/oxidized/run
|
29
57
|
ADD extra/auto-reload-config.runit /etc/service/auto-reload-config/run
|
30
58
|
ADD extra/update-ca-certificates.runit /etc/service/update-ca-certificates/run
|
data/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/README.md
CHANGED
@@ -1,24 +1,34 @@
|
|
1
|
-
# Oxidized
|
1
|
+
# Oxidized
|
2
|
+
[![Build Status](https://api.travis-ci.com/ytti/oxidized.svg)](https://travis-ci.com/ytti/oxidized)
|
3
|
+
[![codecov.io](https://codecov.io/gh/ytti/oxidized/coverage.svg?branch=master)](https://codecov.io/gh/ytti/oxidized?branch=master)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/ytti/oxidized/badges/gpa.svg)](https://codeclimate.com/github/ytti/oxidized)
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/oxidized.svg)](http://badge.fury.io/rb/oxidized)
|
6
|
+
[![Join the chat at https://gitter.im/oxidized/Lobby](https://badges.gitter.im/oxidized/Lobby.svg)](https://gitter.im/oxidized/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
2
7
|
|
3
|
-
|
8
|
+
Oxidized is a network device configuration backup tool. It's a RANCID replacement!
|
4
9
|
|
5
|
-
|
10
|
+
Light and extensible, Oxidized supports over 90 operating system types.
|
6
11
|
|
7
|
-
|
12
|
+
Feature highlights:
|
8
13
|
|
9
14
|
* Automatically adds/removes threads to meet configured retrieval interval
|
10
|
-
* Restful API to move node immediately to head-of-queue (GET/POST /node/next/[NODE])
|
11
|
-
* Syslog udp+file example to catch config change
|
12
|
-
* Will signal
|
13
|
-
* The git output module uses this info - 'git blame' will
|
15
|
+
* Restful API to a move node immediately to head-of-queue (GET/POST /node/next/[NODE])
|
16
|
+
* Syslog udp+file example to catch config change events (IOS/JunOS) and trigger a config fetch
|
17
|
+
* Will signal which IOS/JunOS user made the change, can then be used by output modules (via POST)
|
18
|
+
* The `git` output module uses this info - 'git blame' will show who changed each line, and when
|
14
19
|
* Restful API to reload list of nodes (GET /reload)
|
15
20
|
* Restful API to fetch configurations (/node/fetch/[NODE] or /node/fetch/group/[NODE])
|
16
21
|
* Restful API to show list of nodes (GET /nodes)
|
17
22
|
* Restful API to show list of version for a node (/node/version[NODE]) and diffs
|
18
23
|
|
19
|
-
|
24
|
+
Check out the [Oxidized TREX 2014 presentation](http://youtu.be/kBQ_CTUuqeU#t=3h) video on YouTube!
|
25
|
+
|
26
|
+
> :warning: [Maintainer Wanted!](#help-needed) :warning:
|
27
|
+
>
|
28
|
+
> Is your company using Oxidized and has Ruby developers on staff? I'd love help from an extra maintainer!
|
29
|
+
|
30
|
+
## Index
|
20
31
|
|
21
|
-
#### Index
|
22
32
|
1. [Supported OS Types](docs/Supported-OS-Types.md)
|
23
33
|
2. [Installation](#installation)
|
24
34
|
* [Debian](#debian)
|
@@ -32,31 +42,39 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
|
|
32
42
|
* [Debugging](docs/Configuration.md#debugging)
|
33
43
|
* [Privileged mode](docs/Configuration.md#privileged-mode)
|
34
44
|
* [Disabling SSH exec channels](docs/Configuration.md#disabling-ssh-exec-channels)
|
35
|
-
* [Sources
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
* [Outputs
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
45
|
+
* [Sources](docs/Sources.md)
|
46
|
+
* [Source: CSV](docs/Sources.md#source-csv)
|
47
|
+
* [Source: SQL](docs/Sources.md#source-sql)
|
48
|
+
* [Source: SQLite](docs/Sources.md#source-sqlite)
|
49
|
+
* [Source: Mysql](docs/Sources.md#source-mysql)
|
50
|
+
* [Source: HTTP](docs/Sources.md#source-http)
|
51
|
+
* [Outputs](docs/Outputs.md)
|
52
|
+
* [Output: GIT](docs/Outputs.md#output-git)
|
53
|
+
* [Output: GIT-Crypt](docs/Outputs.md#output-git-crypt)
|
54
|
+
* [Output: HTTP](docs/Outputs.md#output-http)
|
55
|
+
* [Output: File](docs/Outputs.md#output-file)
|
56
|
+
* [Output types](docs/Outputs.md#output-types)
|
47
57
|
* [Advanced Configuration](docs/Configuration.md#advanced-configuration)
|
48
58
|
* [Advanced Group Configuration](docs/Configuration.md#advanced-group-configuration)
|
49
59
|
* [Hooks](docs/Hooks.md)
|
50
|
-
|
51
|
-
|
60
|
+
* [Hook: exec](docs/Hooks.md#hook-type-exec)
|
61
|
+
* [Hook: githubrepo](docs/Hooks.md#hook-type-githubrepo)
|
62
|
+
* [Hook: awssns](docs/Hooks.md#hook-type-awssns)
|
63
|
+
* [Hook: slackdiff](docs/Hooks.md#hook-type-slackdiff)
|
64
|
+
* [Hook: xmppdiff](docs/Hooks.md#hook-type-xmppdiff)
|
65
|
+
* [Hook: ciscosparkdiff](docs/Hooks.md#hook-type-ciscosparkdiff)
|
66
|
+
5. [Creating and Extending Models](docs/Creating-Models.md)
|
67
|
+
6. [Help](#help)
|
68
|
+
7. [Ruby API](docs/Ruby-API.md#ruby-api)
|
52
69
|
* [Input](docs/Ruby-API.md#input)
|
53
70
|
* [Output](docs/Ruby-API.md#output)
|
54
71
|
* [Source](docs/Ruby-API.md#source)
|
55
72
|
* [Model](docs/Ruby-API.md#model)
|
56
73
|
|
57
|
-
|
74
|
+
## Installation
|
75
|
+
|
76
|
+
### Debian
|
58
77
|
|
59
|
-
## Debian
|
60
78
|
Install all required packages and gems.
|
61
79
|
|
62
80
|
```shell
|
@@ -65,8 +83,9 @@ gem install oxidized
|
|
65
83
|
gem install oxidized-script oxidized-web # if you don't install oxidized-web, make sure you remove "rest" from your config
|
66
84
|
```
|
67
85
|
|
68
|
-
|
69
|
-
|
86
|
+
### CentOS, Oracle Linux, Red Hat Linux
|
87
|
+
|
88
|
+
On CentOS 6 / RHEL 6, install Ruby 2.0 or greater (for Ruby 2.1.2 installation instructions see [Installing Ruby 2.1.2 using RVM](#installing-ruby-212-using-rvm)), then install Oxidized dependencies
|
70
89
|
|
71
90
|
```shell
|
72
91
|
yum install cmake sqlite-devel openssl-devel libssh2-devel
|
@@ -85,10 +104,9 @@ gem install oxidized
|
|
85
104
|
gem install oxidized-script oxidized-web
|
86
105
|
```
|
87
106
|
|
88
|
-
|
89
|
-
[Use RVM to install Ruby v2.1.2](#installing-ruby-2.1.2-using-rvm)
|
107
|
+
### FreeBSD
|
90
108
|
|
91
|
-
|
109
|
+
[Use RVM to install Ruby v2.1.2](#installing-ruby-212-using-rvm), then install all required packages and gems:
|
92
110
|
|
93
111
|
```shell
|
94
112
|
pkg install cmake pkgconf
|
@@ -96,46 +114,59 @@ gem install oxidized
|
|
96
114
|
gem install oxidized-script oxidized-web
|
97
115
|
```
|
98
116
|
|
99
|
-
|
117
|
+
Oxidized is also available via [FreeBSD ports](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203374):
|
118
|
+
|
119
|
+
```shell
|
120
|
+
pkg install rubygem-oxidized rubygem-oxidized-script rubygem-oxidized-web
|
121
|
+
```
|
122
|
+
|
123
|
+
### Build from Git
|
124
|
+
|
100
125
|
```shell
|
101
126
|
git clone https://github.com/ytti/oxidized.git
|
102
127
|
cd oxidized/
|
103
|
-
gem
|
104
|
-
|
128
|
+
gem install bundler
|
129
|
+
rake install
|
105
130
|
```
|
106
131
|
|
107
|
-
|
132
|
+
### Running with Docker
|
108
133
|
|
109
|
-
|
134
|
+
Currently, Docker Hub automatically builds the master branch as [oxidized/oxidized](https://hub.docker.com/r/oxidized/oxidized/), you can make use of this container or build your own.
|
110
135
|
|
111
|
-
|
136
|
+
To build your own, clone git repo:
|
137
|
+
|
138
|
+
```shell
|
112
139
|
git clone https://github.com/ytti/oxidized
|
113
140
|
```
|
114
141
|
|
115
|
-
build container locally:
|
142
|
+
Then, build the container locally (requires docker 17.05.0-ce or higher):
|
116
143
|
|
117
|
-
```
|
144
|
+
```shell
|
118
145
|
docker build -q -t oxidized/oxidized:latest oxidized/
|
119
146
|
```
|
120
147
|
|
121
|
-
|
148
|
+
Once you've built the container (or chosen to make use of the automatically built container in Docker Hub, which will be downloaded for you by docker on the first `run` command had you not built it), proceed as follows:
|
122
149
|
|
123
|
-
|
150
|
+
Create a configuration directory in the host system:
|
151
|
+
|
152
|
+
```shell
|
124
153
|
mkdir /etc/oxidized
|
125
154
|
```
|
126
155
|
|
127
|
-
|
128
|
-
_Note: this step in only needed for creating Oxidized's configuration file and can be skipped if you already have it
|
156
|
+
Run the container for the first time to initialize the config:
|
129
157
|
|
130
|
-
|
158
|
+
_Note: this step in only required for creating the Oxidized configuration file and can be skipped if you already have one._
|
159
|
+
|
160
|
+
```shell
|
131
161
|
docker run --rm -v /etc/oxidized:/root/.config/oxidized -p 8888:8888/tcp -t oxidized/oxidized:latest oxidized
|
132
162
|
```
|
163
|
+
|
133
164
|
If the RESTful API and Web Interface are enabled, on the docker host running the container
|
134
|
-
edit
|
135
|
-
this will bind port 8888 to all interfaces then expose port out. [Issue #445](https://github.com/ytti/oxidized/issues/445)
|
165
|
+
edit `/etc/oxidized/config` and modify `rest: 127.0.0.1:8888` to `rest: 0.0.0.0:8888`. This will bind port 8888 to all interfaces, and expose the port so that it could be accessed externally. [(Issue #445)](https://github.com/ytti/oxidized/issues/445)
|
136
166
|
|
137
|
-
|
138
|
-
|
167
|
+
Alternatively, you can use docker-compose to launch the oxidized container:
|
168
|
+
|
169
|
+
```yaml
|
139
170
|
# docker-compose.yml
|
140
171
|
# docker-compose file example for oxidized that will start along with docker daemon
|
141
172
|
oxidized:
|
@@ -149,15 +180,15 @@ oxidized:
|
|
149
180
|
- /etc/oxidized:/root/.config/oxidized
|
150
181
|
```
|
151
182
|
|
152
|
-
|
183
|
+
Create the `/etc/oxidized/router.db` (see [CSV Source](docs/Sources.md#source-csv) for further info):
|
153
184
|
|
154
|
-
```
|
185
|
+
```shell
|
155
186
|
vim /etc/oxidized/router.db
|
156
187
|
```
|
157
188
|
|
158
|
-
|
189
|
+
Run container again to start oxidized with your configuration:
|
159
190
|
|
160
|
-
```
|
191
|
+
```shell
|
161
192
|
docker run -v /etc/oxidized:/root/.config/oxidized -p 8888:8888/tcp -t oxidized/oxidized:latest
|
162
193
|
oxidized[1]: Oxidized starting, running as pid 1
|
163
194
|
oxidized[1]: Loaded 1 nodes
|
@@ -167,45 +198,49 @@ Puma 2.13.4 starting...
|
|
167
198
|
* Listening on tcp://0.0.0.0:8888
|
168
199
|
```
|
169
200
|
|
170
|
-
If you want to have the config automatically reloaded (e.g. when using a http source that changes)
|
201
|
+
If you want to have the config automatically reloaded (e.g. when using a http source that changes):
|
171
202
|
|
172
|
-
```
|
203
|
+
```shell
|
173
204
|
docker run -v /etc/oxidized:/root/.config/oxidized -p 8888:8888/tcp -e CONFIG_RELOAD_INTERVAL=3600 -t oxidized/oxidized:latest
|
174
205
|
```
|
175
206
|
|
176
|
-
If you need to use an internal CA (e.g. to connect to an private github instance)
|
207
|
+
If you need to use an internal CA (e.g. to connect to an private github instance):
|
177
208
|
|
178
|
-
```
|
209
|
+
```shell
|
179
210
|
docker run -v /etc/oxidized:/root/.config/oxidized -v /path/to/MY-CA.crt:/usr/local/share/ca-certificates/MY-CA.crt -p 8888:8888/tcp -e UPDATE_CA_CERTIFICATES=true -t oxidized/oxidized:latest
|
180
211
|
```
|
181
212
|
|
182
|
-
|
213
|
+
### Installing Ruby 2.1.2 using RVM
|
183
214
|
|
184
215
|
Install Ruby 2.1.2 build dependencies
|
185
|
-
|
216
|
+
|
217
|
+
```shell
|
186
218
|
yum install curl gcc-c++ patch readline readline-devel zlib zlib-devel
|
187
219
|
yum install libyaml-devel libffi-devel openssl-devel make cmake
|
188
220
|
yum install bzip2 autoconf automake libtool bison iconv-devel libssh2-devel
|
189
221
|
```
|
190
222
|
|
191
223
|
Install RVM
|
192
|
-
|
224
|
+
|
225
|
+
```shell
|
193
226
|
curl -L get.rvm.io | bash -s stable
|
194
227
|
```
|
195
228
|
|
196
229
|
Setup RVM environment and compile and install Ruby 2.1.2 and set it as default
|
197
|
-
|
230
|
+
|
231
|
+
```shell
|
198
232
|
source /etc/profile.d/rvm.sh
|
199
233
|
rvm install 2.1.2
|
200
234
|
rvm use --default 2.1.2
|
201
235
|
```
|
202
236
|
|
203
|
-
|
237
|
+
## Configuration
|
238
|
+
|
204
239
|
Oxidized configuration is in YAML format. Configuration files are subsequently sourced from `/etc/oxidized/config` then `~/.config/oxidized/config`. The hashes will be merged, this might be useful for storing source information in a system wide file and user specific configuration in the home directory (to only include a staff specific username and password). Eg. if many users are using `oxs`, see [Oxidized::Script](https://github.com/ytti/oxidized-script).
|
205
240
|
|
206
241
|
It is recommended practice to run Oxidized using its own username. This username can be added using standard command-line tools:
|
207
242
|
|
208
|
-
```
|
243
|
+
```shell
|
209
244
|
useradd oxidized
|
210
245
|
```
|
211
246
|
|
@@ -215,7 +250,7 @@ To initialize a default configuration in your home directory `~/.config/oxidized
|
|
215
250
|
|
216
251
|
You can set the env variable `OXIDIZED_HOME` to change its home directory.
|
217
252
|
|
218
|
-
```
|
253
|
+
```shell
|
219
254
|
OXIDIZED_HOME=/etc/oxidized
|
220
255
|
|
221
256
|
$ tree -L 1 /etc/oxidized
|
@@ -234,27 +269,25 @@ Oxidized supports [CSV](docs/Configuration.md#source-csv), [SQLite](docs/Config
|
|
234
269
|
|
235
270
|
## Outputs
|
236
271
|
|
237
|
-
Possible outputs are either [File](docs/Configuration.md#output-file), [GIT](docs/Configuration.md#output-git), [GIT-Crypt](docs/Configuration.md#output-git-crypt) and [
|
272
|
+
Possible outputs are either [File](docs/Configuration.md#output-file), [GIT](docs/Configuration.md#output-git), [GIT-Crypt](docs/Configuration.md#output-git-crypt) and [HTTP](docs/Configuration.md#output-http). The file backend takes a destination directory as argument and will keep a file per device, with most recent running version of a device. The GIT backend (recommended) will initialize an empty GIT repository in the specified path and create a new commit on every configuration change. The GIT-Crypt backend will also initialize a GIT repository but every configuration push to it will be encrypted on the fly by using `git-crypt` tool. Take a look at the [Configuration](docs/Configuration.md) for more details.
|
238
273
|
|
239
274
|
Maps define how to map a model's fields to model [model fields](https://github.com/ytti/oxidized/tree/master/lib/oxidized/model). Most of the settings should be self explanatory, log is ignored if `use_syslog`(requires Ruby >= 2.0) is set to `true`.
|
240
275
|
|
241
276
|
First create the directory where the CSV `output` is going to store device configs and start Oxidized once.
|
242
|
-
|
277
|
+
|
278
|
+
```shell
|
243
279
|
mkdir -p ~/.config/oxidized/configs
|
244
280
|
oxidized
|
245
281
|
```
|
246
282
|
|
247
283
|
Now tell Oxidized where it finds a list of network devices to backup configuration from. You can either use CSV or SQLite as source. To create a CSV source add the following snippet:
|
248
284
|
|
249
|
-
|
250
|
-
```
|
285
|
+
```yaml
|
251
286
|
source:
|
252
287
|
default: csv
|
253
288
|
csv:
|
254
289
|
file: ~/.config/oxidized/router.db
|
255
290
|
delimiter: !ruby/regexp /:/
|
256
|
-
gpg: false
|
257
|
-
gpg_password: 'password'
|
258
291
|
map:
|
259
292
|
name: 0
|
260
293
|
model: 1
|
@@ -262,7 +295,7 @@ source:
|
|
262
295
|
|
263
296
|
Now lets create a file based device database (you might want to switch to SQLite later on). Put your routers in `~/.config/oxidized/router.db` (file format is compatible with rancid). Simply add an item per line:
|
264
297
|
|
265
|
-
```
|
298
|
+
```text
|
266
299
|
router01.example.com:ios
|
267
300
|
switch01.example.com:procurve
|
268
301
|
router02.example.com:ios
|
@@ -270,13 +303,13 @@ router02.example.com:ios
|
|
270
303
|
|
271
304
|
Run `oxidized` again to take the first backups.
|
272
305
|
|
273
|
-
|
306
|
+
## Extra
|
274
307
|
|
275
|
-
|
308
|
+
### Ubuntu SystemV init setup
|
276
309
|
|
277
310
|
The init script assumes that you have a used named 'oxidized' and that oxidized is in one of the following paths:
|
278
311
|
|
279
|
-
```
|
312
|
+
```text
|
280
313
|
/sbin
|
281
314
|
/bin
|
282
315
|
/usr/sbin
|
@@ -287,26 +320,26 @@ The init script assumes that you have a used named 'oxidized' and that oxidized
|
|
287
320
|
1. Copy init script from extra/ folder to /etc/init.d/oxidized
|
288
321
|
2. Setup /var/run/
|
289
322
|
|
290
|
-
```
|
323
|
+
```shell
|
291
324
|
mkdir /var/run/oxidized
|
292
325
|
chown oxidized:oxidized /var/run/oxidized
|
293
326
|
```
|
294
327
|
|
295
328
|
3. Make oxidized start on boot
|
296
329
|
|
297
|
-
```
|
330
|
+
```shell
|
298
331
|
update-rc.d oxidized defaults
|
299
332
|
```
|
300
333
|
|
301
|
-
|
334
|
+
## Help
|
302
335
|
|
303
336
|
If you need help with Oxidized then we have a few methods you can use to get in touch.
|
304
337
|
|
305
|
-
|
306
|
-
|
307
|
-
|
338
|
+
* [Gitter](https://gitter.im/oxidized/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - You can join the Lobby on gitter to chat to other Oxidized users.
|
339
|
+
* [GitHub](https://github.com/ytti/oxidized/) - For help and requests for code changes / updates.
|
340
|
+
* [Forum](https://community.librenms.org/c/help/oxidized) - A user forum run by [LibreNMS](https://github.com/librenms/librenms) where you can ask for help and support.
|
308
341
|
|
309
|
-
|
342
|
+
## Help Needed
|
310
343
|
|
311
344
|
As things stand right now, `oxidized` is maintained by a single person. A great
|
312
345
|
many [contributors](https://github.com/ytti/oxidized/graphs/contributors) have
|
@@ -341,13 +374,12 @@ Brian Anderson (from Rust fame) wrote an [excellent
|
|
341
374
|
post](http://brson.github.io/2017/04/05/minimally-nice-maintainer) on what it
|
342
375
|
means to be a maintainer.
|
343
376
|
|
344
|
-
|
377
|
+
## License and Copyright
|
345
378
|
|
346
379
|
Copyright
|
347
380
|
2013-2015 Saku Ytti <saku@ytti.fi>
|
348
381
|
2013-2015 Samer Abdel-Hafez <sam@arahant.net>
|
349
382
|
|
350
|
-
|
351
383
|
Licensed under the Apache License, Version 2.0 (the "License");
|
352
384
|
you may not use this file except in compliance with the License.
|
353
385
|
You may obtain a copy of the License at
|