rc9000 / nd2-worker-plugin-aci Goto Github PK
View Code? Open in Web Editor NEWNetdisco plugin to fetch mac and arp tables from APIC (Cisco SDN Controller)
License: BSD 3-Clause "New" or "Revised" License
Netdisco plugin to fetch mac and arp tables from APIC (Cisco SDN Controller)
License: BSD 3-Clause "New" or "Revised" License
Hello,
Getting this when trying to macsuck now
Unsure if a recent netdisco upgrade broke it as it was previously working Any ideas?
ACI Version 5.2(7g) - Was previously working with this
Netdisco version - 2.072003
[3668107] 2024-02-16 18:00:27 info App::Netdisco version 2.072003 loaded.
[3668107] 2024-02-16 18:00:27 info macsuck: [172.27.129.2] started at Fri Feb 16 18:00:27 2024
[3668107] 2024-02-16 18:00:27 info [172.27.129.2] cisco aci macsuck - fetching data from https://172.27.129.2:443/api
Redundant argument in sprintf at /home/netdisco/nd2-worker-plugin-aci/lib/App/NetdiscoX/Worker/Plugin/Macsuck/Nodes.pm line 64.
[3668107] 2024-02-16 18:00:30 info [172.27.129.2] cisco aci macsuck - updating epg participation in device_port
[3668107] 2024-02-16 18:00:30 info macsuck: finished at Fri Feb 16 18:00:30 2024
[3668107] 2024-02-16 18:00:30 info macsuck: status error: Can't call method "make_column_dirty" on an undefined value at /home/netdisco/nd2-worker-plugin-aci/lib/App/NetdiscoX/Worker/Plugin/Macsuck/Nodes.pm line 24.
Hey,
upon use, this error is thrown. The device is snmp reachable, netdisco has the correct snmp credentials.
[516674] 2022-10-25 06:33:48 info App::Netdisco version 2.057008 loaded.
[516674] 2022-10-25 06:33:49 info discover: [10.10.10.10] started at Tue Oct 25 08:33:49 2022
Use of uninitialized value in string eq at /data/netdisco/nd2-worker-plugin-aci/lib/App/NetdiscoX/Worker/Plugin/Discover/Properties.pm line 14.
[516674] 2022-10-25 06:33:49 info [10.10.10.10] NetdiscoX::Properties - not an ACIController, ignored
[516674] 2022-10-25 06:33:49 info discover: finished at Tue Oct 25 08:33:49 2022
[516674] 2022-10-25 06:33:49 info discover: status info: skip: driver or action not applicable
Hi,
great plugin but in our infrastructure it is is not working ok as I get these messages (-D option used on macsuck):
...
cisco aci macsuck - F8:72:EA:66:F2:8D fabric switch 0.0.0.0 port Ethernet1/2 is unknown to netdisco, skipped
...
I can also see that this is due to plugin/netdisco¿? not getting devips of the fabric switches:
...
NetdiscoX::Util::ACI mac_arp_info - pod 1 node 123 port eth1/2 mac F8:72:EA:66:F2:8D vlan 41 arpip 10.105.240.8 devname LRF-B-R03-1 devip 0.0.0.0
...
Maybe we miss some configuration or something has changed in Version 4.2(7f)???
If you need more detailed debugging information or us doing some specific tests just ask.
Congrats for the plugin again.
Hi :)
I noticed something after providing our APICs with corret certificates and setting the correct HTTPS_CA_FILE ENV Variable to use the correct CA. The macsuck/arpnip would STILL fail, because we do not include IP Addresses in the certificates, and the current code will always build the "URL" using the IP address of the APIC node. see:
I have rewritten this a litttle bit for our purpose, to use rDNS to resolve the hostname to that IP and use THAT to connect, to avoid the otherwise unavoidable certificate error:
diff --git a/lib/App/NetdiscoX/Util/ACI.pm b/lib/App/NetdiscoX/Util/ACI.pm
index 15bf3cd..a743f86 100644
--- a/lib/App/NetdiscoX/Util/ACI.pm
+++ b/lib/App/NetdiscoX/Util/ACI.pm
@@ -12,7 +12,7 @@ use URL::Encode ':all';
use Hash::Merge qw(merge);
use Moo;
use namespace::clean;
-
+use Socket;
has port => (
is => 'rw',
@@ -31,7 +31,7 @@ has [qw(host user password)] => (
sub url {
my $self = shift;
- return "https://" . $self->{host} . ":" . $self->{port} . "/api";
+ return "https://" . gethostbyaddr(inet_aton($self->{host}), 2) . ":" . $self->{port} . "/api";
}
sub nodeinfo {
This of course required that the IP have a correct PTR in the DNS, but fixes the other issue.
I wrote this instead of a direct pull request to try and explain my reasoning first :)
Maybe someone comes up with a better Idea.
Additional Suggestion: Mention HTTPS_CA_FILE Env variable (maybe even default it to /etc/ssl/certs/ca-certificates.crt) as correct way to add certificate in README.md. Other methods (at least under Ubuntu) seem to be entirely useless.
Good afternoon, thank you for writing this Netdisco plugin, I have gotten it to work with our newer 5.x deployment somewhat but have run into some roadblocks I was hoping you could give some insight on.
When querying it is looking for a cookie and not finding it so failing on some things.
"text" : "Need a valid webtoken cookie (named APIC-Cookie) or a signed request with signature in the cookie APIC-Request-Signature for all REST AP
I requests",
"code" : "403"
Is there anything I can adjust to make it get and use a cookie?
Thank you
From IRC: having the ACI controller matched in a netconf and snmpv3 stanza potentially causes the netconf credentials not to work:
09:31 <dietmar> Hi, i do not have the config anymore, but that is what i had in use, about the aci user/passwd null values :
09:33 <dietmar> device_auth:
09:33 <dietmar> - tag: aci_prod
09:33 <dietmar> driver: netconf
09:33 <dietmar> only:
09:33 <dietmar> - 1.1.1.11
09:33 <dietmar> user: 'read'
09:33 <dietmar> password: 'read'
09:33 <dietmar> - tag: aci_switches_prod
09:33 <dietmar> user: user
09:33 <dietmar> auth:
09:33 <dietmar> pass: 'xxxxxx'
09:33 <dietmar> proto: SHA
09:33 <dietmar> priv:
09:33 <dietmar> pass: 'xxxxxx'
09:33 <dietmar> proto: AES128
09:33 <dietmar> only:
09:33 <dietmar> - 1.1.1.21-254
09:33 <dietmar> - 1.1.1.11
Thank you so such for this plugin, it really help us integrating the cisco ACI to netdisco.
It seems like the json has changed, the `$d->{fvCEp}->{attributes}->{ip} doesn't exist, and the ip information is now inside @{$d->{fvCEp}->{children}}{fvIp}->{attributes}->{addr}
I made the following changes to the code that seems to work, and also works for nodes with multiple ip (ip alias) too:
diff --git a/lib/App/NetdiscoX/Util/ACI.pm b/lib/App/NetdiscoX/Util/ACI.pm
index fa73dbe..3241bbf 100644
--- a/lib/App/NetdiscoX/Util/ACI.pm
+++ b/lib/App/NetdiscoX/Util/ACI.pm
@@ -71,15 +72,21 @@ sub read_info_from_json {
my $ts = $tsj->{imdata};
my @node_records;
- my @nodeip_records;
+ my @nodeip_records;
foreach my $d (@{$resp->{imdata}}){
my $dn = $d->{fvCEp}->{attributes}->{dn};
my $mac = $d->{fvCEp}->{attributes}->{mac};
- my $ip = $d->{fvCEp}->{attributes}->{ip};
+# my $ip = $d->{fvCEp}->{attributes}->{ip};
my $vlan = $d->{fvCEp}->{attributes}->{encap} ? $d->{fvCEp}->{attributes}->{encap} : 0;
$vlan =~ s/vlan-//;
+
+ foreach my $child_fvCEp ( @{$d->{fvCEp}->{children}} ) {
+ # print Dumper($child_fvCEp->{fvIp}->{attributes}->{addr});
+ my $ip = $child_fvCEp->{fvIp}->{attributes}->{addr};
+ next unless $ip;
+
my @child_tdns = map { $_->{fvRsCEpToPathEp}->{attributes}->{tDn} } @{$d->{fvCEp}->{children}};
foreach my $c (@child_tdns){
@@ -161,7 +168,7 @@ sub read_info_from_json {
}
}
}
-
+ }
return { nodes => \@node_records, node_ips => \@nodeip_records };
}
Hi,
I installed this plugin and I can see ACI Switches and Controller in Netdisco. Also the custom fields are filled with correct information.
But I can't see the MAC-Adresses of connected devices in Netdisco.
I'm facing two problems I think.
First of all, if Unicast-Routing (L3) is inactive for a Bridge Domain, Learned MACs do not appear in any way (not in netdisco, nor in a macsuck-log)
If Unicast Routing is acitve, I can see the MAC in macsuck output:
debug [apic] cisco aci macsuck - xx:xx:xx:24:B8:2E fabric switch xxx.xxx.xxx.xxx port Ethernet1/5 is an uplink, skipped
If I check the database, every connected Leaf-Port is marked as uplink.
In this case, there is the setting aci_ignore_uplink_re
.
Can someone give me an example value for this setting? I would like to mark only remote_types starting with "topology" as uplinks.
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.