NAME
icli - Icinga Command Line Interface
SYNOPSIS
icli [-v|-vv] [-z filter] [-h hosts] [-g hostgroups] [-s services] [-c config] [-C] [-f status-file] [-F rw-file] [-r|-u|-lh|-ls|-lq|-ld] [host/service ...]
VERSION
version 0.41
DESCRIPTION
icli is a command line interface to Icinga. By default it lists all services and their states.
Note that when supplying custom config and status file paths, icli also works with Nagios. 100% compatibility is not guaranteed, however.
icli only works when executed on the host running the Icinga daemon. To use it on another host, shell aliases (like alias icli='ssh $icingahost icli'
) or similar are recommended.
You can narrow down the list of services you want displayed either using filters (like icli -z!o
), the -h/-s arguments (icli -h aneurysm -s Libraries,Websites
) or commandline args (icli aneurysm/{Libraries,Websites}
with shell expansion).
OPTIONS
- -c|--config config
-
Read config from file instead of the default /var/cache/icinga/objects.cache
- -C|--no-colours
-
Disable colours in output
- -f|--status-file file
-
Read the status from file instead of the default /var/lib/icinga/status.dat
- -F|--rw-file file
-
Use file as external commands file. Default: /var/lib/icinga/rw/icinga.cmd
- -g|--hostgroup hostgroup
-
Limit selection to hosts in hostgroup (comma separated list)
- -h|--host hosts
-
Limit selection to hosts (comma separated list)
- -l|--list downtimes|hosts|services|queue
-
List either services (the default) or hosts. Note that only the first character of the argument is checked, so
icli -lh
,icli -ls
etc. are also fine. - -r|--recheck
-
Schedule an immediate recheck of all selected services
- -u|--force-recheck
-
Schedule a forced, immediate recheck of all selected services
- -s|--service services
-
Limit selection to services (comma separated lists). Can be combined with -h/-g to further narrow down the selection, but may also be used stand-alone.
- -v|--verbose
-
Increase output verbosity. Can be combined up to -vvv
- -V|--version
-
Show version information
- -x|--cut-mode mode
-
What to do with lines which are too long for the terminal: nothing, cut off, line break (with proper indentation). The default is line breaks
- -z|--filter expression
-
Limit selection to hosts/services passing the filter. expression is a comma separated list of filters, only hosts/services to which all filters apply are selected. See also "FILTER EXPRESSIONS"
OUTPUT
SERVICE LISTING
This is the standard output method. It contains the following:
Service description
-v: Service Flags (Acknowledged, Flapping, Passive, !no checks)
Service state (ok / warning / critical / unknown)
-v: Current attempt / Max attempts
Plugin output
HOST LISTING
Enabled with -ld
Host name
Host state (ok / down / unreachable)
-v: Current attempt / Max attempts
Plugin output
QUEUE LISTING
Enabled with -lq
Host name
Service name
Last check
Next check
FILTER EXPRESSIONS
Each expression can be negated with an exclamation mark, e.g. "!A" for all non-acknowledged services.
- A
-
Check state has been acknowledged
- D
-
The host this service belongs to is Down or Unreachable
- F
-
Service is flapping between states
- N
-
Notifications for this service are disabled
- P
-
Only passive checks are enabled. Note that !P simply means that active checks are enabled, no matter the status of passive checks
- S
-
Check state is soft. For instance, it used to be OK and is now critical, but has not reached its maximum number and caused a notification yet. Good to find (or ignore) service problems which might just be temporary, non-critical glitches.
- o
-
Host/Service state is OK
- w
-
Service state is Warning
- c
-
Service state is Critical
- u
-
Service state is Unknown
- d
-
Host state is Down
- x
-
Host state is Unreachable
EXIT STATUS
Zero, unless errors occured.
CONFIGURATION
None.
DEPENDENCIES
autodie (included with perl >= 5.10.1)
Date::Format
Term::Size
BUGS AND LIMITATIONS
This software is in early development stages. So there will probably be quite a lot.
REPORTING BUGS
Either via mail to <derf@finalrewind.org> or on <http://github.com/derf/icinga-cli/issues>.
EXAMPLES
icli -r -s 'APT Updates'
-
Schedule a check of the "APT Updates" service on all hosts having it
icli -lq -h aneurysm -g chaosdorf-hosts
-
List check queue for all hosts in the hostgroup "chaosdorf-hosts", plus the host aneurysm
icli -z!o,!A,!S,!D
-
Show all service problems which are already hard states and have not yet been acknowledged. Also weed out problem services on hosts which are down anyways
AUTHOR
Copyright (C) 2010 by Daniel Friesel <derf@finalrewind.org>
LICENSE
0. You just DO WHAT THE FUCK YOU WANT TO.