-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathmodel_cisco.go
35 lines (30 loc) · 1004 Bytes
/
model_cisco.go
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
package dev
import (
"time"
"github.com/udhos/jazigo/conf"
)
func registerModelCiscoIOS(logger hasPrintf, t *DeviceTable) {
a := conf.NewDevAttr()
a.NeedLoginChat = true
a.NeedEnabledMode = true
a.NeedPagingOff = true
a.EnableCommand = "enable"
a.UsernamePromptPattern = `Username:\s*$`
a.PasswordPromptPattern = `Password:\s*$`
a.EnablePasswordPromptPattern = `Password:\s*$`
a.DisabledPromptPattern = `\S+>\s*$`
a.EnabledPromptPattern = `\S+#\s*$`
a.CommandList = []string{"show ver", "show run"}
a.DisablePagerCommand = "term len 0"
a.ReadTimeout = 10 * time.Second
a.MatchTimeout = 20 * time.Second
a.SendTimeout = 5 * time.Second
a.CommandReadTimeout = 20 * time.Second // larger timeout for slow 'sh run'
a.CommandMatchTimeout = 30 * time.Second // larger timeout for slow 'sh run'
a.QuoteSentCommandsFormat = `!![%s]`
m := &Model{name: "cisco-ios"}
m.defaultAttr = a
if err := t.SetModel(m, logger); err != nil {
logger.Printf("registerModelCiscoIOS: %v", err)
}
}