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

Commit 145e218

Browse files
author
ned
committed
Example of saving non-config data (sho version)
1 parent f903fdb commit 145e218

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cisco.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ func (collector Cisco) Collect(device DeviceConfig) (map[string]string, error) {
5454
if err != nil {
5555
return result, fmt.Errorf("Command 'show running-config' failed: %s", err.Error())
5656
}
57+
c.Send <- "show version\n"
58+
result["version"], err = expectSaveTimeout("#", c.Receive, device.CommandTimeout)
59+
if err != nil {
60+
return result, fmt.Errorf("Command 'show version' failed: %s", err.Error())
61+
}
5762

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

0 commit comments

Comments
 (0)