mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Adding basic spoolfetch plugin support
This commit is contained in:
parent
7fc99a3716
commit
8eee012f2c
@ -19,6 +19,8 @@ my $port; # Default is stdin/stdout
|
|||||||
my $verbose;
|
my $verbose;
|
||||||
my $host;
|
my $host;
|
||||||
my $plugin_dir = "plugins";
|
my $plugin_dir = "plugins";
|
||||||
|
my $spoolfetch_dir;
|
||||||
|
|
||||||
{
|
{
|
||||||
my $man = 0;
|
my $man = 0;
|
||||||
my $help = 0;
|
my $help = 0;
|
||||||
@ -29,6 +31,8 @@ my $plugin_dir = "plugins";
|
|||||||
'plugin-dir|d=s' => \$plugin_dir,
|
'plugin-dir|d=s' => \$plugin_dir,
|
||||||
'host|h=s' => \$host,
|
'host|h=s' => \$host,
|
||||||
|
|
||||||
|
'spoolfetch-dir|s=s' => \$spoolfetch_dir,
|
||||||
|
|
||||||
'help|?' => \$help,
|
'help|?' => \$help,
|
||||||
man => \$man,
|
man => \$man,
|
||||||
) or pod2usage(2);
|
) or pod2usage(2);
|
||||||
@ -78,12 +82,19 @@ while(my $line = <>) {
|
|||||||
system($plugin_filename, $arg_plugin);
|
system($plugin_filename, $arg_plugin);
|
||||||
print ".";
|
print ".";
|
||||||
next;
|
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
|
# Arriving here is not a good sign
|
||||||
print "# Unknown command. Try list, nodes, config, fetch, version, alert or quit";
|
print "# Unknown command. Try list, nodes, config, fetch, version, alert or quit";
|
||||||
} continue {
|
} continue {
|
||||||
#print " " x 4096;
|
|
||||||
print "\n";
|
print "\n";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -105,6 +116,8 @@ Options:
|
|||||||
--plugin-dir Plugin directory (default is current dir)
|
--plugin-dir Plugin directory (default is current dir)
|
||||||
--host Host name (default is /bin/hostname)
|
--host Host name (default is /bin/hostname)
|
||||||
|
|
||||||
|
--spoolfetch-dir Spoolfetch plugin dirs (default is disabled)
|
||||||
|
|
||||||
--help brief help message
|
--help brief help message
|
||||||
--man full documentation
|
--man full documentation
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user