forked from napalm-automation/napalm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement nxos_ssh get_environment (napalm-automation#973)
- Loading branch information
1 parent
c9fb54d
commit 90fffc2
Showing
8 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Value CPU_ID (\d+) | ||
Value CPU_IDLE ([0-9]+\.[0-9]+) | ||
|
||
Start | ||
^\s+CPU${CPU_ID} states :.*kernel,\s+${CPU_IDLE}% idle -> Record |
54 changes: 54 additions & 0 deletions
54
test/nxos_ssh/mocked_data/test_get_environment/normal/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"power": { | ||
"invalid": { | ||
"status": true, | ||
"output": -1.0, | ||
"capacity": -1.0 | ||
} | ||
}, | ||
"fans": { | ||
"invalid": { | ||
"status": true | ||
} | ||
}, | ||
"cpu": { | ||
"0": { | ||
"%usage": 1.04 | ||
}, | ||
"1": { | ||
"%usage": 8.43 | ||
}, | ||
"2": { | ||
"%usage": 1.05 | ||
}, | ||
"3": { | ||
"%usage": 1.04 | ||
} | ||
}, | ||
"temperature": { | ||
"Exhaust-1": { | ||
"is_alert": false, | ||
"temperature": 33.0, | ||
"is_critical": false | ||
}, | ||
"Intake-1": { | ||
"is_alert": false, | ||
"temperature": 28.0, | ||
"is_critical": false | ||
}, | ||
"Davos-1": { | ||
"is_alert": false, | ||
"temperature": 49.0, | ||
"is_critical": false | ||
}, | ||
"CPU-1": { | ||
"is_alert": false, | ||
"temperature": 44.0, | ||
"is_critical": false | ||
} | ||
}, | ||
"memory": { | ||
"available_ram": 16401224, | ||
"used_ram": 4798280 | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
test/nxos_ssh/mocked_data/test_get_environment/normal/show_environment_temperature.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Temperature: | ||
-------------------------------------------------------------------- | ||
Module Sensor MajorThresh MinorThres CurTemp Status | ||
(Celsius) (Celsius) (Celsius) | ||
-------------------------------------------------------------------- | ||
1 Intake 70 42 28 Ok | ||
1 Exhaust 90 80 33 Ok | ||
1 CPU 100 90 44 Ok | ||
1 Davos 110 90 49 Ok |
9 changes: 9 additions & 0 deletions
9
test/nxos_ssh/mocked_data/test_get_environment/normal/show_system_resources.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Load average: 1 minute: 0.05 5 minutes: 0.07 15 minutes: 0.14 | ||
Processes : 627 total, 1 running | ||
CPU states : 2.31% user, 1.28% kernel, 96.39% idle | ||
CPU0 states : 0.00% user, 1.03% kernel, 98.96% idle | ||
CPU1 states : 6.31% user, 2.10% kernel, 91.57% idle | ||
CPU2 states : 1.04% user, 0.00% kernel, 98.95% idle | ||
CPU3 states : 0.00% user, 1.03% kernel, 98.96% idle | ||
Memory usage: 16401224K total, 4798280K used, 11602944K free | ||
Current memory status: OK |
27 changes: 27 additions & 0 deletions
27
test/nxos_ssh/mocked_data/test_get_environment/nxosv_9k/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"cpu": { | ||
"0": { | ||
"%usage": 15.91 | ||
}, | ||
"1": { | ||
"%usage": 4.31 | ||
} | ||
}, | ||
"memory": { | ||
"used_ram": 4176656, | ||
"available_ram": 6096260 | ||
}, | ||
"temperature": {}, | ||
"power": { | ||
"invalid": { | ||
"status": true, | ||
"output": -1.0, | ||
"capacity": -1.0 | ||
} | ||
}, | ||
"fans": { | ||
"invalid": { | ||
"status": true | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
test/nxos_ssh/mocked_data/test_get_environment/nxosv_9k/show_environment_temperature.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Temperature: | ||
-------------------------------------------------------------------- | ||
Module Sensor MajorThresh MinorThres CurTemp Status | ||
(Celsius) (Celsius) (Celsius) | ||
-------------------------------------------------------------------- |
7 changes: 7 additions & 0 deletions
7
test/nxos_ssh/mocked_data/test_get_environment/nxosv_9k/show_system_resources.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Load average: 1 minute: 1.13 5 minutes: 1.22 15 minutes: 1.34 | ||
Processes : 635 total, 1 running | ||
CPU states : 1.65% user, 7.73% kernel, 90.60% idle | ||
CPU0 states : 2.27% user, 13.63% kernel, 84.09% idle | ||
CPU1 states : 2.15% user, 2.15% kernel, 95.69% idle | ||
Memory usage: 6096260K total, 4176656K used, 1919604K free | ||
Current memory status: OK |