summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 522aa06)
raw | patch | inline | side by side (parent: 522aa06)
author | Florian Forster <octo@noris.net> | |
Wed, 26 Aug 2009 09:31:24 +0000 (11:31 +0200) | ||
committer | Florian Forster <octo@noris.net> | |
Wed, 26 Aug 2009 09:31:24 +0000 (11:31 +0200) |
You can now do
HELP FLUSH
to get information about the FLUSH command.
HELP FLUSH
to get information about the FLUSH command.
contrib/cussh.pl | patch | blob | history |
diff --git a/contrib/cussh.pl b/contrib/cussh.pl
index 7357ad785e327ee71e73bc80e59602d46665dc6e..320bf73b047323e71e56189bb58e67363469aedb 100755 (executable)
--- a/contrib/cussh.pl
+++ b/contrib/cussh.pl
=cut
sub cmd_help {
- print <<HELP;
+ my $sock = shift;
+ my $line = shift || '';
+
+ my @line = tokenize($line);
+ my $cmd = shift (@line);
+
+ my %text = (
+ help => <<HELP,
Available commands:
HELP
PUTVAL
See the embedded Perldoc documentation for details. To do that, run:
perldoc $0
HELP
+ putval => <<HELP,
+PUTVAL <id> <value0> [<value1> ...]
+
+Submits a value to the daemon.
+HELP
+ getval => <<HELP,
+GETVAL <id>
+
+Retrieves the current value or values from the daemon.
+HELP
+ flush => <<HELP,
+FLUSH [plugin=<plugin>] [timeout=<timeout>] [identifier=<id>] [...]
+
+Sends a FLUSH command to the daemon.
+HELP
+ listval => <<HELP,
+LISTVAL
+
+Prints a list of available values.
+HELP
+ putnotif => <<HELP
+PUTNOTIF severity=<severity> [...] message=<message>
+
+Sends a notifications message to the daemon.
+HELP
+ );
+
+ if (!$cmd)
+ {
+ $cmd = 'help';
+ }
+ if (!exists ($text{$cmd}))
+ {
+ print STDOUT "Unknown command: " . uc ($cmd) . "\n\n";
+ $cmd = 'help';
+ }
+
+ print STDOUT $text{$cmd};
+
return 1;
} # cmd_help