projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
postgresql plugin: Define default queries in a configuration file.
[collectd.git]
/
contrib
/
cussh.pl
diff --git
a/contrib/cussh.pl
b/contrib/cussh.pl
index
3fa4105
..
2ec6308
100755
(executable)
--- a/
contrib/cussh.pl
+++ b/
contrib/cussh.pl
@@
-57,6
+57,7
@@
use Collectd::Unixsock();
my $sock = Collectd::Unixsock->new($path);
my $cmds = {
my $sock = Collectd::Unixsock->new($path);
my $cmds = {
+ HELP => \&cmd_help,
PUTVAL => \&putval,
GETVAL => \&getval,
FLUSH => \&flush,
PUTVAL => \&putval,
GETVAL => \&getval,
FLUSH => \&flush,
@@
-150,6
+151,25
@@
sub putid {
=over 4
=over 4
+=item B<HELP>
+
+=cut
+
+sub cmd_help {
+ print <<HELP;
+Available commands:
+ HELP
+ PUTVAL
+ GETVAL
+ FLUSH
+ LISTVAL
+
+See the embedded Perldoc documentation for details. To do that, run:
+ perldoc $0
+HELP
+ return 1;
+} # cmd_help
+
=item B<GETVAL> I<Identifier>
=cut
=item B<GETVAL> I<Identifier>
=cut
@@
-223,6
+243,15
@@
sub flush {
elsif ($option eq "timeout") {
$args{"timeout"} = $value;
}
elsif ($option eq "timeout") {
$args{"timeout"} = $value;
}
+ elsif ($option eq "identifier") {
+ my $id = getid (\$value);
+ if (!$id)
+ {
+ print STDERR "Not a valid identifier: \"$value\"\n";
+ next;
+ }
+ push @{$args{"identifier"}}, $id;
+ }
else {
print STDERR "Invalid option \"$option\".\n";
return;
else {
print STDERR "Invalid option \"$option\".\n";
return;