summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-04-19 21:22:00 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-04-19 21:22:00 +0200
commitcf1c773dff3bc1fe35a6550f2cfffafa2658aa3d (patch)
treeab968031eabdc0af7ebec8ae327fde0ed4861b40 /bin
parent845f5f9b8d03468cc97d9e5d804b45ec20be03fb (diff)
Support "icli host/service" as "icli -h host -s service" shortcut
Diffstat (limited to 'bin')
-rwxr-xr-xbin/icli17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/icli b/bin/icli
index dcf1f4b..42abc34 100755
--- a/bin/icli
+++ b/bin/icli
@@ -789,6 +789,17 @@ read_objects($status_file, \$data);
read_objects($config_file, \$config);
enhance_status();
+for my $arg (@ARGV) {
+ my ($host, $service) = split(qr{/}, $arg);
+
+ if (not grep { $host } @for_hosts) {
+ push(@for_hosts, $host);
+ }
+ if ($service) {
+ push(@for_services, $service);
+ }
+}
+
foreach my $host (@for_hosts) {
if (not exists $data->{services}->{$host}) {
die("Unknown host: ${host}\n");
@@ -869,6 +880,7 @@ B<icli> - Icinga Command Line Interface
B<icli> [B<-v>|B<-vv>] [B<-z> I<filter>] [B<-h> I<hosts>] [B<-g> I<hostgroups>]
[B<-s> I<services>] [B<-c> I<config>] [B<-C>] [B<-f> I<status-file>]
[B<-F> I<rw-file>] [B<-r>|B<-lh>|B<-ls>|B<-lq>|B<-ld>]
+[I<host>/I<service> I<...>]
=head1 DESCRIPTION
@@ -882,6 +894,11 @@ B<icli> only works when executed on the host running the B<Icinga> daemon. To
use it on another host, shell aliases (like C<< alias icli='ssh $icingahost
icli' >>) or similar are recommended.
+You can narrow down the list of services you want displayed either using
+B<filters> (like C<< icli -z!o >>), the B<-h>/B<-s> arguments (C<< icli -h
+aneurysm -s Libraries,Websites >>) or commandline args (C<< icli
+aneurysm/{Libraries,Websites} >> with shell expansion).
+
=head1 OPTIONS
=over