From a4b9bf203609bd765af9c5f3c07851b123aefdde Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 7 Oct 2017 13:58:52 +0100 Subject: [PATCH] netdisco-do show takes a param for method in -p --- bin/netdisco-do | 4 ++++ lib/App/Netdisco/Worker/Plugin/Show.pm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/netdisco-do b/bin/netdisco-do index a82e3ff6..1c5b0b43 100755 --- a/bin/netdisco-do +++ b/bin/netdisco-do @@ -276,6 +276,10 @@ leaf with the class short name, for example "C" or ~netdisco/bin/netdisco-do show -d 192.0.2.1 -e interfaces ~netdisco/bin/netdisco-do show -d 192.0.2.1 -e Layer2::HP::interfaces +A paramter may be passed to the C method in the C<-p> parameter: + + ~netdisco/bin/netdisco-do show -d 192.0.2.1 -e has_layer -p 3 + =head2 psql Start an interactive terminal with the Netdisco PostgreSQL database. If you diff --git a/lib/App/Netdisco/Worker/Plugin/Show.pm b/lib/App/Netdisco/Worker/Plugin/Show.pm index 5c73c969..c6f93b40 100644 --- a/lib/App/Netdisco/Worker/Plugin/Show.pm +++ b/lib/App/Netdisco/Worker/Plugin/Show.pm @@ -28,7 +28,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub { } my $i = App::Netdisco::Transport::SNMP->reader_for($device, $class); - Data::Printer::p($i->$extra); + Data::Printer::p($i->$extra($port)); return Status->done( sprintf "Showed %s response from %s", $extra, $device->ip);