Dell FORCE10 Open Automation Open Automation Guide - Page 26

Running a PERL API Script, Table 3-3., Supported FTOS API Functions in PERL Scripts continued

Page 26 highlights

www.dell.com | support.dell.com Table 3-3. Supported FTOS API Functions in PERL Scripts (continued) F10ShowLagIntVlanMember (lagId) s F10ShowLog None F10ShowMacAddrTbl None F10ShowMem (lagId) F10ShowOSPFNeighbors None F10ShowOSPFRoute None F10ShowPhyIntBand (stackUnitNum, portId) F10ShowPhyIntStatus (stackUnitNum, portId) F10ShowPhyIntVlanMember (stackUnitNum, portId) s F10ShowProcCpu None F10ShowRun None F10ShowVer None F10ShowVlan None F10ShowVlanId (vlanId) F10ShowVlanIntStatus (vlanId) F10ShowVrrp None F10ShowVrrpBrief None F10Traceroute (ipAddress, timeout) F10WriteMem None Returns information on VLAN membership for a specified port-channel interface. Returns the switch log buffer. Returns the table of learned MAC addresses. Returns switch memory usage. Returns list of OSPF neighbors. Returns the table of OSPF-learned routes. Returns in/out bandwidth average for a specified port. Returns the detailed status of a specified physical interface. Returns information on VLAN membership for a specified physical interface. Returns switch CPU usage and running processes. Returns the running configuration (in memory). Returns software version information. Returns the show vlan output for all VLANs. Returns the show vlan output for a specific vlan. Returns the detailed status of a specified VLAN interface. Returns the full VRRP status output. Returns a brief VRRP session summary. Performs a traceroute operation to an IP address from the switch. Write the running configuration to the startup configuration file. Running a PERL API Script When you run a PERL script that invokes the API functions in Table 3-2, logon credentials are read from the smartutils.cfg file, and a telnet session is opened on the switch in which function calls are executed in the FTOS CLI. The script closes the telnet session after running all the CLI commands. The smartutils.cfg file is the configuration file used by the Programmatic Management package. It contains the user name and passwords required to log on to a switch via telnet and access the CLI to execute the function calls in a PERL API script. The smartutils.cfg file is downloaded with the Programmatic Management package and is stored at /usr/pkg/scripts/smartutils. Note: The user name and passwords contained in the smartutils.cfg file are used to log in and run only the scripts created using the PERL, Python, and UNIX APIs described in this chapter. A username used to run scripts cannot contain special characters. 26 | Smart Scripting

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98

26
|
Smart Scripting
www.dell.com
|
support.dell.com
Running a PERL API Script
When you run a PERL script that invokes the API functions in
Table 3-2
, logon
credentials are read from the smartutils.cfg file, and a telnet session is opened on the
switch in which function calls are executed in the FTOS CLI. The script closes the
telnet session after running all the CLI commands.
The smartutils.cfg file is the configuration file used by the Programmatic
Management package. It contains the user name and passwords required to log on to
a switch via telnet and access the CLI to execute the function calls in a PERL API
script. The smartutils.cfg file is downloaded with the Programmatic Management
package and is stored at /usr/pkg/scripts/smartutils.
F10ShowLagIntVlanMember
s
(lagId)
Returns information on VLAN membership for a specified
port-channel interface.
F10ShowLog
None
Returns the switch log buffer.
F10ShowMacAddrTbl
None
Returns the table of learned MAC addresses.
F10ShowMem
(lagId)
Returns switch memory usage.
F10ShowOSPFNeighbors
None
Returns list of OSPF neighbors.
F10ShowOSPFRoute
None
Returns the table of OSPF-learned routes.
F10ShowPhyIntBand
(stackUnitNum, portId)
Returns in/out bandwidth average for a specified port.
F10ShowPhyIntStatus
(stackUnitNum, portId)
Returns the detailed status of a specified physical interface.
F10ShowPhyIntVlanMember
s
(stackUnitNum, portId)
Returns information on VLAN membership for a specified
physical interface.
F10ShowProcCpu
None
Returns switch CPU usage and running processes.
F10ShowRun
None
Returns the running configuration (in memory).
F10ShowVer
None
Returns software version information.
F10ShowVlan
None
Returns the
show vlan
output for all VLANs.
F10ShowVlanId
(vlanId)
Returns the
show vlan
output for a specific vlan.
F10ShowVlanIntStatus
(vlanId)
Returns the detailed status of a specified VLAN interface.
F10ShowVrrp
None
Returns the full VRRP status output.
F10ShowVrrpBrief
None
Returns a brief VRRP session summary.
F10Traceroute
(ipAddress, timeout)
Performs a traceroute operation to an IP address from the switch.
F10WriteMem
None
Write the running configuration to the startup configuration file.
Table 3-3.
Supported FTOS API Functions in PERL Scripts (continued)
Note:
The user name and passwords contained in the smartutils.cfg file are used to
log in and run only the scripts created using the PERL, Python, and UNIX APIs
described in this chapter
.
A username used to run scripts cannot contain special
characters.