If you want to test the automation with Cisco ACI, you can use the following container.
docker pull zednetwork/aci-dev:latest
root@docker1:~/aci-dev# docker images zednetwork/aci-dev
REPOSITORY TAG IMAGE ID CREATED SIZE
zednetwork/aci-dev latest b1c09a7c66f0 About an hour ago 1.31GB
I preinstalled Ansible 2.9.11, the ACI SDK (COBRA) in version 4.2(4) and ARYA.
You can run directly the container with the command:
root@c86d023821ff:~# ansible-playbook ucs_vlan.yml -i inv_ucs
PLAY [ENSURE APPLICATION CONFIGURATION EXISTS] *
TASK [Configure VLAN] **
[WARNING]: Platform linux on host 10.0.100.162 is using the discovered Python interpreter at /usr/bin/python, but
future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
changed: [10.0.100.162]
PLAY RECAP *
10.0.100.162 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Now your vlan ID 11 is available on the UCS Fabric Interconnect.
You can use the module ansible ucs_vlan_find to get all vlans:
You can search all commands ucs and the documentation with the following commands:
PS C:\WINDOWS\system32> Get-Command -noun Ucs | more
CommandType Name Version Source
----------- ---- ------- ------
Alias Acknowledge-UcsBlade 2.5.3.0 Cisco.UcsManager
Alias Acknowledge-UcsChassis 2.5.3.0 Cisco.UcsManager
Alias Acknowledge-UcsFault 2.5.3.0 Cisco.UcsManager
Alias Acknowledge-UcsFex 2.5.3.0 Cisco.UcsManager
Alias Acknowledge-UcsRackUnit 2.5.3.0 Cisco.UcsManager
Alias Acknowledge-UcsServerUnit 2.5.3.0 Cisco.UcsManager
Alias Acknowledge-UcsSlot 2.5.3.0 Cisco.UcsManager
Alias Add-UcsMo 2.5.3.0 Cisco.UcsManager
Alias Associate-UcsServiceProfile 2.5.3.0 Cisco.UcsManager
Alias Compare-UcsMo 2.5.3.0 Cisco.UcsManager
Alias Decommission-UcsBlade 2.5.3.0 Cisco.UcsManager
Alias Decommission-UcsChassis 2.5.3.0 Cisco.UcsManager
Alias Decommission-UcsFex 2.5.3.0 Cisco.UcsManager
Alias Decommission-UcsRackUnit 2.5.3.0 Cisco.UcsManager
Alias Decommission-UcsServerUnit 2.5.3.0 Cisco.UcsManager
Alias Disable-UcsDiskLocatorLed 2.5.3.0 Cisco.UcsManager
Alias Disassociate-UcsServiceProfile 2.5.3.0 Cisco.UcsManager
Alias Enable-UcsDiskLocatorLed 2.5.3.0 Cisco.UcsManager
Alias Get-UcsCentral 2.5.3.0 Cisco.UcsManager
Alias Get-UcsMo 2.5.3.0 Cisco.UcsManager
Alias Get-UcsOs 2.5.3.0 Cisco.Ucs.Core
[..]
PS C:\WINDOWS\system32> Get-help Get-UcsServer
NOM
Get-UcsServer
RÉSUMÉ
Gets Managed Object of type ComputeBlade, ComputeRackUnit and ComputeServerUnit.
SYNTAXE
Get-UcsServer [-Ucs ] []
DESCRIPTION
Gets Managed Object of type ComputeBlade, ComputeRackUnit and ComputeServerUnit.
LIENS CONNEXES
REMARQUES
Pour consulter les exemples, tapez : "get-help Get-UcsServer -examples".
Pour plus d'informations, tapez : "get-help Get-UcsServer -detailed".
Pour obtenir des informations techniques, tapez : "get-help Get-UcsServer -full".
Vlans
Get Vlans
PS C:\WINDOWS\system32> Get-UCsVlan | Select-Object Dn,Name,Id,SwitchId
Dn Name Id SwitchId
-- ---- -- --------
fabric/eth-estc/net-default default 1 dual
fabric/lan/A/net-default default 1 A
fabric/lan/A/net-finance finance 3 A
fabric/lan/A/net-human-resource human-resource 5 A
fabric/lan/B/net-default default 1 B
fabric/lan/B/net-finance finance 3 B
fabric/lan/B/net-human-resource human-resource 5 B
fabric/lan/net-default default 1 dual
Add Vlans
PS C:\WINDOWS\system32> Get-help Add-UcsVlan
PS C:\WINDOWS\system32> Get-UcsLanCloud | Add-UcsVlan -Name NewVlan42 -Id 42
AssocPrimaryVlanState : ok
AssocPrimaryVlanSwitchId : NONE
Cloud : ethlan
CompressionType : included
ConfigIssues :
ConfigOverlap : ok
DefaultNet : no
EpDn :
Global : 0
Id : 42
IfRole : network
IfType : virtual
Local : 0
Locale : external
McastPolicyName :
Name : NewVlan42
OperMcastPolicyName :
OperState : ok
OverlapStateForA : active
OverlapStateForB : active
PeerDn :
PolicyOwner : local
PubNwDn :
PubNwId : 1
PubNwName :
Sacl :
Sharing : none
SwitchId : dual
Transport : ether
Type : lan
Ucs : UCSPE-10-0-100-162
Dn : fabric/lan/net-NewVlan42
Rn : net-NewVlan42
Status : created
XtraProperty : {}
Verify
PS C:\WINDOWS\system32> Get-UCsVlan | Select-Object Dn,Name,Id,SwitchId
Dn Name Id SwitchId
-- ---- -- --------
fabric/eth-estc/net-default default 1 dual
fabric/lan/A/net-default default 1 A
fabric/lan/A/net-finance finance 3 A
fabric/lan/A/net-human-resource human-resource 5 A
fabric/lan/B/net-default default 1 B
fabric/lan/B/net-finance finance 3 B
fabric/lan/B/net-human-resource human-resource 5 B
fabric/lan/net-default default 1 dual
fabric/lan/net-NewVlan42 NewVlan42 42 dual
In addition to Powershell, you can also use the python SDK (Docs).
Example to add a new vlan:
from ucsmsdk.ucshandle import UcsHandle
from ucsmsdk.mometa.fabric.FabricVlan import FabricVlan
Create a connection handle
handle = UcsHandle("10.0.100.162", "ucspe", "ucspe")
Login to the server
handle.login()
fabric_lan_dn = handle.query_dn("fabric/lan")
newvlan = FabricVlan(parent_mo_or_dn=fabric_lan_dn,
name = "vlan10",
id="10")
handle.add_mo(newvlan)
handle.commit()
Logout from the server
handle.logout()
Usually, SNMP is used to pool network devices. SNMP especially the walk function is very CPU intensive and is often unsecured by using SNMPv1 or SNMPv2.
Telemetry can help you to monitor your devices and not only the CPU/Memory or interface (in/out) counter. You can also monitor CRC, Optic budget, etc easily.
We will use Grafana with InfluxDB and Telegraf.
On Cisco Nexus device you need to enable the feature telemetry.
feature telemetry
Then you need to configure three others parts:
A destination group, where is located your NMS tool
A sensor Group, which contains what you want to stream to your NMS tool
A subscription, which associates the destination group and the sensor group.
In the previous example, we can see one destination group to stream the data to the server 10.202.2.100 port 57000/tcp. We use gRPC with GPB to send the flow.
The server 10.202.2.100 is a docker server, which runs Grafana with influxDB and telegraf.
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0ea44fcb6359 telegraf "/entrypoint.sh tele…" 5 days ago Up 5 days 8092/udp, 8125/udp, 8094/tcp, 0.0.0.0:57000->57000/tcp telemetry_telegraf_1
37001630a9aa grafana/grafana:latest "/run.sh" 5 days ago Up 5 days 0.0.0.0:3000->3000/tcp telemetry_grafana_1
db99097a276f influxdb:latest "/entrypoint.sh infl…" 5 days ago Up 5 days 0.0.0.0:8086->8086/tcp telemetry_influxdb_1
You can run this stack with the following docker-compose file.
To start the stack enters the command docker-compose up -d
Now, you should received data to your influxdb via your pipeline telegraf. This is the moment to create a dashboard.
The following example will show how to monitor your optical budget.
Now you need to create you request to get the value. In this example we want to use the stream with the command “show interface transceiver detail” and select one specific interface (Ethernet 1/16). We can use the parameter Where Table_interface to get all interfaces and select the good one. Finally if you have a lot of Nexus devices you can add a source. The latest part is to select which value you want. Here we get rx_pwr.
If you need to have the detail before. You can enter the following command on your Cisco Nexus device.
The following picture will show you two cases. The Ethernet E1/15 which has an issue in Rx and the Ethernet E1/16 where the values are good.
In CLI :
N9K1# show interface e1/15 transceiver details
Ethernet1/15
transceiver is present
type is Fabric Extender Transceiver
name is CISCO-JDSU
part number is PLRXPL-VC-S43-CG
revision is B
serial number is JURxxxxxxxx
nominal bitrate is 10300 MBit/sec
Link length supported for 62.5/125um fiber is 10 m
Link length supported for 50/125um OM3 fiber is 100 m
cisco id is 3
cisco extended id number is 4
cisco part number is 10-2566-02
cisco product id is FET-10G
cisco version id is V02
SFP Detail Diagnostics Information (internal calibration)
----------------------------------------------------------------------------
Current Alarms Warnings
Measurement High Low High Low
----------------------------------------------------------------------------
Temperature 37.33 C 75.00 C 5.00 C 70.00 C 10.00 C
Voltage 3.26 V 3.63 V 2.97 V 3.46 V 3.13 V
Current 4.80 mA 10.00 mA 2.59 mA 8.50 mA 3.00 mA
Tx Power -2.21 dBm 2.69 dBm -11.30 dBm -1.30 dBm -7.30 dBm
Rx Power -26.98 dBm -- 2.99 dBm -13.97 dBm -1.00 dBm -9.91 dBm
Transmit Fault Count = 0
----------------------------------------------------------------------------
Note: ++ high-alarm; + high-warning; -- low-alarm; - low-warning
N9K1# show interface e1/16 transceiver details
Ethernet1/16
transceiver is present
type is Fabric Extender Transceiver
name is CISCO-FINISAR
part number is FTLX8570D3BCL-C2
revision is A
serial number is FNxxxxxxYS
nominal bitrate is 10300 MBit/sec
Link length supported for 62.5/125um fiber is 10 m
Link length supported for 50/125um OM3 fiber is 100 m
cisco id is 3
cisco extended id number is 4
cisco part number is 10-2566-02
cisco product id is FET-10G
cisco version id is V02
SFP Detail Diagnostics Information (internal calibration)
----------------------------------------------------------------------------
Current Alarms Warnings
Measurement High Low High Low
----------------------------------------------------------------------------
Temperature 36.03 C 75.00 C 5.00 C 70.00 C 10.00 C
Voltage 3.27 V 3.63 V 2.97 V 3.46 V 3.13 V
Current 7.89 mA 11.80 mA 4.00 mA 10.80 mA 5.00 mA
Tx Power -2.44 dBm 2.69 dBm -11.30 dBm -1.30 dBm -7.30 dBm
Rx Power -2.41 dBm 2.99 dBm -13.97 dBm -1.00 dBm -9.91 dBm
Transmit Fault Count = 0
----------------------------------------------------------------------------
Note: ++ high-alarm; + high-warning; -- low-alarm; - low-warning
Other example to monitor the CPU with the sensor group: show system resources.