Skip to content
This repository has been archived by the owner on Apr 10, 2020. It is now read-only.

Commit

Permalink
Example of saving non-config data (sho version)
Browse files Browse the repository at this point in the history
  • Loading branch information
ned committed Dec 15, 2014
1 parent f903fdb commit 145e218
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cisco.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ func (collector Cisco) Collect(device DeviceConfig) (map[string]string, error) {
if err != nil {
return result, fmt.Errorf("Command 'show running-config' failed: %s", err.Error())
}
c.Send <- "show version\n"
result["version"], err = expectSaveTimeout("#", c.Receive, device.CommandTimeout)
if err != nil {
return result, fmt.Errorf("Command 'show version' failed: %s", err.Error())
}

// cleanup config results
result["config"] = strings.TrimSpace(strings.TrimPrefix(result["config"], "show running-config"))
Expand Down

0 comments on commit 145e218

Please sign in to comment.