diff --git a/Changes b/Changes index 12636f2e..e6338399 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ 2.046000 - 2020-06-29 + [ENHANCEMENTS] + + * #728 store SNMP Engine ID + [BUG FIXES] * #729 Discovery partially fails on invalid indexes diff --git a/lib/App/Netdisco/DB.pm b/lib/App/Netdisco/DB.pm index e75f784a..fa4e6e6f 100644 --- a/lib/App/Netdisco/DB.pm +++ b/lib/App/Netdisco/DB.pm @@ -11,7 +11,7 @@ __PACKAGE__->load_namespaces( ); our # try to hide from kwalitee - $VERSION = 62; # schema version used for upgrades, keep as integer + $VERSION = 63; # schema version used for upgrades, keep as integer use Path::Class; use File::ShareDir 'dist_dir'; diff --git a/lib/App/Netdisco/DB/Result/Device.pm b/lib/App/Netdisco/DB/Result/Device.pm index 78d505fd..a1511f25 100644 --- a/lib/App/Netdisco/DB/Result/Device.pm +++ b/lib/App/Netdisco/DB/Result/Device.pm @@ -69,6 +69,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 1 }, "snmp_class", { data_type => "text", is_nullable => 1 }, + "snmp_engineid", + { data_type => "text", is_nullable => 1 }, "vtp_domain", { data_type => "text", is_nullable => 1 }, "last_discover", diff --git a/lib/App/Netdisco/Worker/Plugin/Discover/Properties.pm b/lib/App/Netdisco/Worker/Plugin/Discover/Properties.pm index 5927147e..4372c258 100644 --- a/lib/App/Netdisco/Worker/Plugin/Discover/Properties.pm +++ b/lib/App/Netdisco/Worker/Plugin/Discover/Properties.pm @@ -53,6 +53,7 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub { $device->set_column( num_ports => $snmp->ports ); $device->set_column( snmp_class => $snmp->class ); + $device->set_column( snmp_engineid => unpack('H*', $snmp->snmpEngineID) ); $device->set_column( last_discover => \'now()' ); diff --git a/share/schema_versions/App-Netdisco-DB-62-63-PostgreSQL.sql b/share/schema_versions/App-Netdisco-DB-62-63-PostgreSQL.sql new file mode 100644 index 00000000..fcf5f16d --- /dev/null +++ b/share/schema_versions/App-Netdisco-DB-62-63-PostgreSQL.sql @@ -0,0 +1,5 @@ +BEGIN; + +ALTER TABLE device ADD snmp_engineid text; + +COMMIT;