summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-11-08 19:30:21 +0100
committerDaniel Friesel <derf@finalrewind.org>2010-11-08 19:30:21 +0100
commit0a50281e824d77e77fa7257645e6874909a6f078 (patch)
tree2b6fcb7a349e9d5490bfa9492b2d14c8f3cc69c0 /bin
parent874aefc424b9af300965e1a518c3f0765d295d2c (diff)
Add option to change rw-file
Diffstat (limited to 'bin')
-rwxr-xr-xbin/icli11
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/icli b/bin/icli
index 15393c4..c516e1b 100755
--- a/bin/icli
+++ b/bin/icli
@@ -16,6 +16,7 @@ my $VERSION = '0.1';
my ($cache, $config, $data, $extra);
my $config_file = '/var/cache/icinga/objects.cache';
my $status_file = '/var/lib/icinga/status.dat';
+my $rw_file = '/var/lib/icinga/rw/icinga.cmd';
my $context;
my $colours = 1;
my $short = 0;
@@ -316,13 +317,13 @@ sub display_host {
sub dispatch_command {
my $str = join(';', @_);
- open(my $cmd_fh, '>', '/var/lib/icinga/rw/icinga.cmd') or die("Can't open: $!");
+ open(my $cmd_fh, '>', $rw_file);
printf $cmd_fh (
"[%d] %s",
time(),
$str,
);
- close($cmd_fh) or die("Can't close: $!");
+ close($cmd_fh);
}
@@ -347,6 +348,7 @@ GetOptions(
'c|config=s' => \$config_file,
'C|no-colours' => sub { $colours = 0 },
'f|status-file=s' => \$status_file,
+ 'F|rw-file=s' => \$rw_file,
'g|hostgroup=s' => sub { push(@for_groups, split(/,/, $_[1])) },
'h|host=s' => sub { push(@for_hosts, split(/,/, $_[1])) },
'l|list=s' => sub { $list_type = substr($_[1], 0, 1) },
@@ -456,6 +458,11 @@ Disable colours in output
Read the status from I<file> instead of the default
F</var/lib/icinga/status.dat>
+=item B<-F>|B<--rw-file> I<file>
+
+Use I<file> as external commands file. Default:
+F</var/lib/icinga/rw/icinga.cmd>
+
=item B<-g>|B<--hostgroup> I<hostgroup>
Limit selection to hosts in I<hostgroup>