Skip to content

Commit

Permalink
Cisco NGA.
Browse files Browse the repository at this point in the history
  • Loading branch information
udhos committed Mar 16, 2017
1 parent a9fbcd7 commit 2695902
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ Supported Platforms

Please send pull requests for new plataforms.

- [Cisco ACI APIC](https://github.com/udhos/jazigo/blob/master/dev/model_cisco_apic.go)
- [Cisco IOS](https://github.com/udhos/jazigo/blob/master/dev/model_cisco.go)
- [Cisco IOS XR](https://github.com/udhos/jazigo/blob/master/dev/model_cisco_iosxr.go)
- [Cisco ACI APIC](https://github.com/udhos/jazigo/blob/master/dev/model_cisco_apic.go)
- [Cisco NGA](https://github.com/udhos/jazigo/blob/master/dev/model_cisco_nga.go)
- [Fortigate FortiOS](https://github.com/udhos/jazigo/blob/master/dev/model_fortios.go)
- [HTTP](https://github.com/udhos/jazigo/blob/master/dev/model_http.go) (collect output of http GET method)
- [Juniper JunOS](https://github.com/udhos/jazigo/blob/master/dev/model_junos.go)
Expand Down
1 change: 1 addition & 0 deletions dev/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (d *Device) Holdtime(now time.Time, holdtime time.Duration) time.Duration {
// RegisterModels adds known device models.
func RegisterModels(logger hasPrintf, t *DeviceTable) {
registerModelFortiOS(logger, t)
registerModelCiscoNGA(logger, t)
registerModelCiscoAPIC(logger, t)
registerModelCiscoIOS(logger, t)
registerModelCiscoIOSXR(logger, t)
Expand Down
29 changes: 29 additions & 0 deletions dev/model_cisco_nga.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package dev

import (
"time"

"github.com/udhos/jazigo/conf"
)

func registerModelCiscoNGA(logger hasPrintf, t *DeviceTable) {
a := conf.NewDevAttr()

promptPattern := `\S+#\s*$`

a.DisabledPromptPattern = promptPattern
a.EnabledPromptPattern = promptPattern
a.CommandList = []string{"terminal length 0", "show ver", "show conf"}
a.ReadTimeout = 10 * time.Second
a.MatchTimeout = 20 * time.Second
a.SendTimeout = 5 * time.Second
a.CommandReadTimeout = 15 * time.Second // larger timeout for slow 'sh run'
a.CommandMatchTimeout = 25 * time.Second // larger timeout for slow 'sh run'
a.QuoteSentCommandsFormat = `!![%s]`

m := &Model{name: "cisco-nga"}
m.defaultAttr = a
if err := t.SetModel(m, logger); err != nil {
logger.Printf("registerModelCiscoNGA: %v", err)
}
}

0 comments on commit 2695902

Please sign in to comment.