diff --git a/tools/pmmn/bin/pmmn b/tools/pmmn/bin/pmmn index c39ea2dd..a6f0c9f6 100755 --- a/tools/pmmn/bin/pmmn +++ b/tools/pmmn/bin/pmmn @@ -19,6 +19,8 @@ my $port; # Default is stdin/stdout my $verbose; my $host; my $plugin_dir = "plugins"; +my $spoolfetch_dir; + { my $man = 0; my $help = 0; @@ -29,6 +31,8 @@ my $plugin_dir = "plugins"; 'plugin-dir|d=s' => \$plugin_dir, 'host|h=s' => \$host, + 'spoolfetch-dir|s=s' => \$spoolfetch_dir, + 'help|?' => \$help, man => \$man, ) or pod2usage(2); @@ -78,12 +82,19 @@ while(my $line = <>) { system($plugin_filename, $arg_plugin); print "."; next; + } elsif ($cmd eq "cap") { + print "cap "; + print "spool " if $spoolfetch_dir; + next; + } elsif ($cmd eq "spoolfetch" && $spoolfetch_dir) { + system("$spoolfetch_dir/spoolfetch_$host", $arg); + print "."; + next; } # Arriving here is not a good sign print "# Unknown command. Try list, nodes, config, fetch, version, alert or quit"; } continue { - #print " " x 4096; print "\n"; }; @@ -105,6 +116,8 @@ Options: --plugin-dir Plugin directory (default is current dir) --host Host name (default is /bin/hostname) + --spoolfetch-dir Spoolfetch plugin dirs (default is disabled) + --help brief help message --man full documentation