move nbtstat and nbtwalk to worker plugins
This commit is contained in:
21
lib/App/Netdisco/Worker/Plugin/Nbtstat.pm
Normal file
21
lib/App/Netdisco/Worker/Plugin/Nbtstat.pm
Normal file
@@ -0,0 +1,21 @@
|
||||
package App::Netdisco::Worker::Plugin::Nbtstat;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use App::Netdisco::Worker::Plugin;
|
||||
use aliased 'App::Netdisco::Worker::Status';
|
||||
|
||||
use App::Netdisco::Util::Device 'is_macsuckable';
|
||||
|
||||
register_worker({ primary => true }, sub {
|
||||
my ($job, $workerconf) = @_;
|
||||
|
||||
return Status->error('nbtstat failed: unable to interpret device param')
|
||||
if !defined $job->device;
|
||||
|
||||
return Status->defer(sprintf 'nbtstat deferred: %s is not macsuckable', $job->device->ip)
|
||||
unless is_macsuckable($job->device);
|
||||
|
||||
return Status->done('Nbtstat is able to run.');
|
||||
});
|
||||
|
||||
true;
|
||||
Reference in New Issue
Block a user