Dear, Tdanner.
thank you very much for interesting my thread,
the python script included in the Orion SDK 1.8. understood basic SWIS operations over REST endpoint, such as create the custom properties, and delete it etc.
i need to build a script for working with NCM operations
i don't know how to make it with python script, so to fullfill the requirement making it with powershell script now.
testing on the Nexus 3048 switches(at least hundreds of devices). to fullfill following requirements now.
1. input the Vpc Config.
2. input the VLAN Config.
3. export the result on the 'show env power |grep fail'
4. export the result only RX, TX between -4 dbm to -30 dbm on the 'show interface transceiver detail'
How can i change below powershell script working with python script??
======IOS Version Check Sample script with powershell script=======
# Nexus3048 IOS Version Check v1.0
# Last Modified : 2014.05.13
# Author : David, Shin
# Email : david.shin@hostingglobal.co.kr
if (! (Get-PSSnapin | where {$_.Name -eq "SwisSnapin"})) {
Add-PSSnapin "SwisSnapin"
}
$date=Get-Date -format "yyMMddhh"
$File = "C:\$date-OS_CHECK.txt"
$hostname = "127.0.0.1"
$username = "admin"
$password = New-Object System.Security.SecureString
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$swis = Connect-Swis -v2 -host $hostname -cred $cred
$group=read-host "Location"
$IOS=read-host "IOS version: "
$nodeId = get-swisdata $swis "SELECT NodeID FROM Cirrus.Nodes WHERE NodeGroup='$group'"
$count = 0
foreach ($node in $nodeId) {
$Caption = get-swisdata $swis "SELECT NodeCaption FROM Cirrus.Nodes WHERE NodeId='$node'"
$IOS_Ver = get-swisdata $swis "SELECT OSVersion FROM Cirrus.Nodes WHERE NodeId='$node'"
If ($IOS_Ver -match $IOS)
{
$output = "$Caption $IOS_Ver OK"
write-host $output
$output | Out-File $File -append
}
Else
{
$output = "$Caption $IOS_Ver FAIL"
write-host $output
$output | Out-File $File -append
}
$count = $count + 1
}
$count = "Total : $count Devices"
$count | Out-File $File -append
Write-Host "$count Completed."