This repository has been archived by the owner on Mar 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcidr.1
201 lines (200 loc) · 5.3 KB
/
cidr.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
.\" Automatically generated by Pandoc 1.19.2.1
.\"
.ad b
.TH "cidr" "1" "2018\-03\-02 13:40:27" "cidr" "User manual"
.hy
.SH NAME
.PP
cidr \- Cidr Is not as Dumb as Rancid
.SH SYNOPSIS
.PP
cidr [OPTIONS] COMMAND [ARGS]...
.SH DESCRIPTION
.PP
\f[I]cidr\f[] aims to be an easy to use router backup and management
tool.
It retrieves router and switches configuration and store them into an
\f[I]git\f[] repository.
Its design allow user to configure what should be backed up and how to
do it.
.SH OPTIONS
.TP
.B \-c, \-\-config \f[I]PATH\f[]
Path to the configuration file.
.RS
.RE
.TP
.B \-v, \-\-verbose
Run in verbose mode.
Use multiple time to increase verbosity level.
.RS
.RE
.TP
.B \-h, \-\-help
Display help screen.
.RS
.RE
.SH COMMANDS
.SS \f[B]backup\-config\f[]
.PP
Perform backup of all devices configuration.
.PP
This command accept following options:
.TP
.B \-t, \-\-threads \f[I]INTEGER\f[]
Maximum number of parallel job to run.
.RS
.RE
.SS \f[B]script\f[]
.PP
cidr [OPTIONS] script HOSTS [HOSTS] SCRIPT
.PP
Run \f[I]SCRIPT\f[] on \f[I]HOSTS\f[].
\f[I]SCRIPT\f[] can be a path to an existing file or \f[I]\-\f[] for
standard input.
\f[I]HOSTS\f[] is an \f[I]fnmatch\f[] pattern to be matched against all
device names.
.SH CONFIGURATION FILE
.PP
The configuration consist of a set of \f[C]YAML\f[] files with following
keys.
.SS \f[B]include\f[]
.PP
A list of extra files to me included.
Each item is a glob pattern.
.IP
.nf
\f[C]
include:
\ \ \-\ cidr.d/*.yml
\f[]
.fi
.SS \f[B]output\-dir\f[]
.PP
The output path where to store the configuration files This is the base
for the \f[I]git\f[] repository.
.SS \f[B]git\f[]
.PP
Handle information about \f[I]git\f[].
.IP \[bu] 2
\f[B]user\-name\f[]: The user name to be used for \f[I]git\f[] commits.
.IP \[bu] 2
\f[B]user\-email\f[]: The user email to be used for \f[I]git\f[]
commits.
.SS \f[B]drivers\f[]
.PP
A dictionary of device drivers where the key is the driver name.
A driver consists of 3 definitions:
.IP \[bu] 2
\f[B]comment\f[]: character to use for comments in the configuration
file (default: \f[I]!\f[]).
.IP \[bu] 2
\f[B]term\-setup\f[]: An optional list of command to be run to setup
terminal.
.IP \[bu] 2
\f[B]commands\f[]: a list of dictionary of commands to be run on device.
Order matters since the commands will be run in the same exact order of
their definition.
A command is defined by:
.RS 2
.IP \[bu] 2
\f[B]cli\f[]: the command to be run
.IP \[bu] 2
\f[B]display\f[]: boolean to determine if the command output should be
backed up.
By default its value is \f[I]yes\f[].
For some commands such as \f[B]terminal length 0\f[] you don\[aq]t care
about their output, you can safely set the \f[B]display\f[] value to
\f[I]no\f[].
.IP \[bu] 2
\f[B]quote\f[]: boolean to determine if the command output should be
prefixed by the \f[B]comment\f[] string or not.
By default it value is \f[I]no\f[].
You probably want to set it to \f[I]yes\f[] for non configuration
commands such as \f[B]show version\f[].
.RE
.IP \[bu] 2
\f[B]filters\f[]: a list of python compatible regular expressions to
filter the command output.
This is useful to remove irrelevant lines.
.PP
Example for the \f[I]cisco\-7600\f[] driver:
.IP
.nf
\f[C]
cisco\-7600:
\ \ commands:
\ \ \ \ \-\ {cli:\ terminal\ length\ 0,\ display:\ no}
\ \ \ \ \-\ {cli:\ terminal\ width\ 0,\ display:\ no}
\ \ \ \ \-\ {cli:\ show\ module,\ quote:\ yes}
\ \ \ \ \-\ {cli:\ \[aq]dir\ /all\ all\-filesystems\[aq],\ quote:\ yes}
\ \ \ \ \-\ {cli:\ show\ vlan,\ quote:\ yes}
\ \ \ \ \-\ {cli:\ show\ configuration}
\ \ filters:
\ \ \ \ \-\ \[aq]Using\ \\d+\ out\ of\ \\d+\ bytes\[aq]
\f[]
.fi
.SS \f[B]devices\f[]
.PP
A list of known devices dictionaries.
The keys are:
.IP \[bu] 2
\f[B]name\f[]: the device DNS name or IP address.
.IP \[bu] 2
\f[B]username\f[]: the user name to log into the device.
.IP \[bu] 2
\f[B]key\f[]: path to a ssh private key.
.IP \[bu] 2
\f[B]key\-password\f[]: the password for encrypted private ssh key.
.IP \[bu] 2
\f[B]key\-type\f[]: type of ssh private key (default to \f[C]rsa\f[]).
.IP \[bu] 2
\f[B]password\f[]: the user password to log into the device.
.IP \[bu] 2
\f[B]enable\f[]: if present, send the \f[I]enable\f[] command to the
device and use this as password.
.IP \[bu] 2
\f[B]force\-IPv4\f[]: force IPv4 usage if a hostname resolves to both
IPv6 and IPv4 and you don\[aq]t want to use IPv6.
.IP \[bu] 2
\f[B]protocol\f[]: protocol to use to connect to the device such as
\f[I]ssh\f[].
.IP \[bu] 2
\f[B]driver\f[]: the defined driver to use for that device.
.IP \[bu] 2
\f[B]same\-as\f[]: List of other devices that has the exact same
configuration.
.PP
Examples:
.IP
.nf
\f[C]
\-\ name:\ c7600.example.com
\ \ username:\ cidr
\ \ password:\ password\-for\-cidr
\ \ enable:\ enable\-password
\ \ protocol:\ ssh
\ \ driver:\ cisco\-7600
\-\ name:\ sw1.example.com
\ \ username:\ cidr
\ \ password:\ password\-for\-cidr
\ \ driver:\ foundry\-fls
\ \ protocol:\ ssh
\ \ same\-as:
\ \ \ \ \-\ sw2.example.com
\ \ \ \ \-\ sw3.example.com
\ \ \ \ \-\ sw4.example.com
\f[]
.fi
.SH SEE ALSO
.IP \[bu] 2
Exscript (https://github.com/knipknap/exscript/): the connection library
used by \f[I]cidr\f[].
.SH COPYRIGHT
.PP
Copyright © 2015\-2018 Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>.
.PP
Released under WTFPL version 2 or
higher (http://sam.zoy.org/wtfpl/COPYING).
.SH AUTHORS
Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org> (\f[B]\@renard_0\f[]).