<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get 'show flogi database' output of Fabric Interconnect from Python ucsmsdk in Unified Computing System (UCS)</title>
    <link>https://community.cisco.com/t5/unified-computing-system-ucs/how-to-get-show-flogi-database-output-of-fabric-interconnect/m-p/4067205#M21</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/281250"&gt;@Guru Prasad&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ucsmsdk only access the managed objects, the ones configurable through UCS Manager GUI, so you cannot get "show flogi database" or "show mac address-table". However you can alternatively you can use use netmiko:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;netmiko &lt;SPAN&gt;import &lt;/SPAN&gt;ConnectHandler&lt;BR /&gt;&lt;BR /&gt;fi = {&lt;BR /&gt;    &lt;SPAN&gt;'device_type'&lt;/SPAN&gt;: &lt;SPAN&gt;'cisco_nxos'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;'ip'&lt;/SPAN&gt;: &lt;SPAN&gt;'ip'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;'username'&lt;/SPAN&gt;: &lt;SPAN&gt;'u'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;'password'&lt;/SPAN&gt;: &lt;SPAN&gt;'p'&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;connect = ConnectHandler(**fi)&lt;BR /&gt;connect.send_command(&lt;SPAN&gt;'connect nxos a'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;expect_string&lt;/SPAN&gt;=&lt;SPAN&gt;r"#"&lt;/SPAN&gt;)&lt;BR /&gt;output = connect.send_command(&lt;SPAN&gt;'show mac address'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(output)&lt;BR /&gt;output = connect.send_command(&lt;SPAN&gt;'show npv flogi'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(output)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;You will need to parse the output, but is a beginning. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; because the output is having a static structure, you can try using TextFSM for parsing. &lt;A href="https://codingnetworker.com/2015/08/parse-cli-outputs-textfsm/" target="_self"&gt;https://codingnetworker.com/2015/08/parse-cli-outputs-textfsm/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;Sergiu&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2020 13:42:54 GMT</pubDate>
    <dc:creator>Sergiu.Daniluk</dc:creator>
    <dc:date>2020-04-16T13:42:54Z</dc:date>
    <item>
      <title>How to get 'show flogi database' output of Fabric Interconnect from Python ucsmsdk</title>
      <link>https://community.cisco.com/t5/unified-computing-system-ucs/how-to-get-show-flogi-database-output-of-fabric-interconnect/m-p/4048630#M13</link>
      <description>&lt;DIV class="lia-message-subject lia-component-message-view-widget-subject"&gt;&lt;DIV class="MessageSubject"&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;DIV class="lia-message-subject lia-component-message-view-widget-subject"&gt;&lt;DIV class="MessageSubject"&gt;&lt;P&gt;I have been using Python sdk of UCS, ucsmsdk for managing fi operations.&lt;/P&gt;&lt;P&gt;But i could not find the appropriate one for the 'show flogi database' output.&lt;/P&gt;&lt;P&gt;Looked at all mometa classes. But could not find it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if the same is available under any name.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Mar 2020 12:42:01 GMT</pubDate>
      <guid>https://community.cisco.com/t5/unified-computing-system-ucs/how-to-get-show-flogi-database-output-of-fabric-interconnect/m-p/4048630#M13</guid>
      <dc:creator>Guru Prasad</dc:creator>
      <dc:date>2020-03-19T12:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 'show flogi database' output of Fabric Interconnect from Python ucsmsdk</title>
      <link>https://community.cisco.com/t5/unified-computing-system-ucs/how-to-get-show-flogi-database-output-of-fabric-interconnect/m-p/4067205#M21</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/281250"&gt;@Guru Prasad&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ucsmsdk only access the managed objects, the ones configurable through UCS Manager GUI, so you cannot get "show flogi database" or "show mac address-table". However you can alternatively you can use use netmiko:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;netmiko &lt;SPAN&gt;import &lt;/SPAN&gt;ConnectHandler&lt;BR /&gt;&lt;BR /&gt;fi = {&lt;BR /&gt;    &lt;SPAN&gt;'device_type'&lt;/SPAN&gt;: &lt;SPAN&gt;'cisco_nxos'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;'ip'&lt;/SPAN&gt;: &lt;SPAN&gt;'ip'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;'username'&lt;/SPAN&gt;: &lt;SPAN&gt;'u'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;'password'&lt;/SPAN&gt;: &lt;SPAN&gt;'p'&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;connect = ConnectHandler(**fi)&lt;BR /&gt;connect.send_command(&lt;SPAN&gt;'connect nxos a'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;expect_string&lt;/SPAN&gt;=&lt;SPAN&gt;r"#"&lt;/SPAN&gt;)&lt;BR /&gt;output = connect.send_command(&lt;SPAN&gt;'show mac address'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(output)&lt;BR /&gt;output = connect.send_command(&lt;SPAN&gt;'show npv flogi'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(output)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;You will need to parse the output, but is a beginning. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; because the output is having a static structure, you can try using TextFSM for parsing. &lt;A href="https://codingnetworker.com/2015/08/parse-cli-outputs-textfsm/" target="_self"&gt;https://codingnetworker.com/2015/08/parse-cli-outputs-textfsm/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;Sergiu&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 13:42:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/unified-computing-system-ucs/how-to-get-show-flogi-database-output-of-fabric-interconnect/m-p/4067205#M21</guid>
      <dc:creator>Sergiu.Daniluk</dc:creator>
      <dc:date>2020-04-16T13:42:54Z</dc:date>
    </item>
  </channel>
</rss>

