.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "ICLI 1p" .TH ICLI 1p "2014-10-17" "perl v5.20.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" icli \- Icinga Command Line Interface .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBicli\fR [\fB\-v\fR|\fB\-vv\fR|\fB\-vvv\fR] [\fB\-z\fR \fIfilter\fR] [\fB\-h\fR \fIhosts\fR] [\fB\-g\fR \fIhostgroups\fR] [\fB\-s\fR \fIservices\fR] [\fB\-c\fR \fIconfig\fR] [\fB\-C\fR] [\fB\-f\fR \fIstatus-file\fR] [\fB\-F\fR \fIrw-file\fR] [\fB\-lh\fR|\fB\-ls\fR|\fB\-lq\fR|\fB\-ld\fR] [\fB\-a\fR \fIaction\fR[\fB:\fR\fIargs\fR]] [\fIhost\fR/\fIservice\fR \fI...\fR] .SH "VERSION" .IX Header "VERSION" version 0.48 .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBicli\fR is a command line interface to \fBIcinga\fR. By default it lists all services and their states. .PP Note that when supplying custom config and status file paths, \fBicli\fR also works with \fBNagios\fR. 100% compatibility is not guaranteed, however. .PP \&\fBicli\fR only works when executed on the host running the \fBIcinga\fR daemon. To use it on another host, shell aliases (like \f(CW\*(C`alias icli=\*(Aqssh $icingahost icli\*(Aq\*(C'\fR) or similar are recommended. .PP You can narrow down the list of services you want displayed either using \&\fBfilters\fR (like \f(CW\*(C`icli \-z!o\*(C'\fR), the \fB\-h\fR/\fB\-s\fR arguments (\f(CW\*(C`icli \-h aneurysm \-s Libraries,Websites\*(C'\fR) or commandline args (\f(CW\*(C`icli aneurysm/{Libraries,Websites}\*(C'\fR with shell expansion). .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-a\fR|\fB\-\-action\fR \fIaction\fR[:\fIargs\fR]" 4 .IX Item "-a|--action action[:args]" Run \fIaction\fR on all matching hosts or services. \fIargs\fR is a comma-separated list of action arguments and depends on the action in question. \fIaction\fR may also be a one or two letter shortcut. .Sp The following actions are supported: .RS 4 .IP "a|acknowledge \fIcomment\fR" 4 .IX Item "a|acknowledge comment" Acknowledge service problems with string \fIcomment\fR. This creates a sticky acknwoledgment with notification and no expire time. The comment will not be persistent. .Sp Note: Acknowledgement of host problems is not yet supported. .IP "d|downtime \fIstart\fR,\fIstop\fR,\fIduration\fR,\fIcomment\fR[,\fIopts\fR]" 4 .IX Item "d|downtime start,stop,duration,comment[,opts]" Schedule a non-triggered host or service (depending on the filter arguments) downtime. \fIstart\fR and \fIstop\fR are timestamps and must be formatted as \&\s-1YYYY\-MM\-DDTHH:MM:SS,\s0 where the \*(L"T\*(R" is literal. The timestamp is assumed to be in the same time zone as the system running icli. .Sp If \fIduration\fR is 0 (zero), a fixed downtime between \fIstart\fR and \fIstop\fR is scheduled. Otherwise, a flexible downtime which will start between \&\fIstart\fR and \fIstop\fR and last \fIduration\fR is scheduled. In this case, \&\fIduration\fR must be a real number appended with an optional unit (s for seconds, m for minutes, h for hours, d for days, w for weeks). If no unit is specified, seconds are used. .Sp If a host is selected and \fIopts\fR contains \*(L"children\*(R", a downtime for all of its children will be scheduled with the same parameters as the host's. Likewise, if \fIopts\fR contains \*(L"trigger_children\*(R", a triggered downtime for all of the host's children will be scheduled. .Sp \&\fIcomment\fR refers to the downtime's comment field and must not contain the \&\*(L",\*(R" (comma) character. .IP "r|recheck" 4 .IX Item "r|recheck" Schedule an immediate recheck .IP "R|force_recheck" 4 .IX Item "R|force_recheck" Schedule a forced, immediate recheck .RE .RS 4 .RE .IP "\fB\-c\fR|\fB\-\-config\fR \fIconfig\fR" 4 .IX Item "-c|--config config" Read config from \fIfile\fR .IP "\fB\-C\fR|\fB\-\-no\-colours\fR" 4 .IX Item "-C|--no-colours" Disable colours in output .IP "\fB\-f\fR|\fB\-\-status\-file\fR \fIfile\fR" 4 .IX Item "-f|--status-file file" Read the status from \fIfile\fR .IP "\fB\-F\fR|\fB\-\-rw\-file\fR \fIfile\fR" 4 .IX Item "-F|--rw-file file" Use \fIfile\fR as external commands file. .IP "\fB\-g\fR|\fB\-\-hostgroup\fR \fIhostgroup\fR" 4 .IX Item "-g|--hostgroup hostgroup" Limit selection to hosts in \fIhostgroup\fR (comma separated list) .IP "\fB\-h\fR|\fB\-\-host\fR \fIhosts\fR" 4 .IX Item "-h|--host hosts" Limit selection to \fIhosts\fR (comma separated list) .IP "\fB\-l\fR|\fB\-\-list\fR \fBdowntimes\fR|\fBhosts\fR|\fBservices\fR|\fBqueue\fR" 4 .IX Item "-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 \f(CW\*(C`icli \&\-lh\*(C'\fR, \f(CW\*(C`icli \-ls\*(C'\fR etc. are also fine. .IP "\fB\-m\fR|\fB\-\-match\fR \fIregex\fR" 4 .IX Item "-m|--match regex" Limit selection to hosts/services whose plugin output matches \&\fIregex\fR (perl regular expression, case insensitive. see perlre). .IP "\fB\-o\fR|\fB\-\-overview\fR" 4 .IX Item "-o|--overview" Display \*(L"tactical overview\*(R"\-style overview. By default (or when used with \f(CW\*(C`\-ls\*(C'\fR) the number of all hosts and services (both total and divided by their state) is shown. .Sp When used with \f(CW\*(C`\-lh\*(C'\fR, lists all hosts with the number of ok / warning / \&... checks on each host. .IP "\fB\-U\fR|\fB\-\-as\-contact\fR \fIname\fR" 4 .IX Item "-U|--as-contact name" Only operate on service visible to \fIname\fR. Doesn't work for \fB\-lh\fR yet, most useful for \fB\-ls\fR. .Sp \&\s-1NOTE:\s0 This is meant to help find out which services a user has access to. It is \&\s-1NOT\s0 intended as a way to restrict access and should never be used that way. .IP "\fB\-s\fR|\fB\-\-service\fR \fIservices\fR" 4 .IX Item "-s|--service services" Limit selection to \fIservices\fR (comma separated lists). Can be combined with \&\fB\-h\fR/\fB\-g\fR to further narrow down the selection, but may also be used stand-alone. .IP "\fB\-v\fR|\fB\-\-verbose\fR" 4 .IX Item "-v|--verbose" Increase output verbosity. Can be combined up to \fB\-vvv\fR .IP "\fB\-V\fR|\fB\-\-version\fR" 4 .IX Item "-V|--version" Show version information .IP "\fB\-x\fR|\fB\-\-cut\-mode\fR \fImode\fR" 4 .IX Item "-x|--cut-mode mode" What to do with lines which are too long for the terminal: \fBn\fRothing, \fBc\fRut off, line \fBb\fRreak (with proper indentation). The default is line \fBb\fRreaks .IP "\fB\-z\fR|\fB\-\-filter\fR \fIexpression\fR" 4 .IX Item "-z|--filter expression" Limit selection to hosts/services passing the filter. \fIexpression\fR is a comma separated list of filters, only hosts/services to which all filters apply are selected. See also \*(L"\s-1FILTER EXPRESSIONS\*(R"\s0 .SH "OUTPUT" .IX Header "OUTPUT" .SS "\s-1SERVICE LISTING\s0" .IX Subsection "SERVICE LISTING" This is the standard output method. It contains the following: .IP "\(bu" 4 Service description .IP "\(bu" 4 \&\-v: Service Flags (\fBA\fRcknowledged, \fBF\fRlapping, \fBP\fRassive, \fB!\fRno checks) .IP "\(bu" 4 Service state (ok / warning / critical / unknown) .IP "\(bu" 4 \&\-v: Current attempt / Max attempts .IP "\(bu" 4 Plugin output .SS "\s-1HOST LISTING\s0" .IX Subsection "HOST LISTING" Enabled with \-ld .IP "\(bu" 4 Host name .IP "\(bu" 4 Host state (ok / down / unreachable) .IP "\(bu" 4 \&\-v: Current attempt / Max attempts .IP "\(bu" 4 Plugin output .SS "\s-1QUEUE LISTING\s0" .IX Subsection "QUEUE LISTING" Enabled with \-lq .IP "\(bu" 4 Host name .IP "\(bu" 4 Service name .IP "\(bu" 4 Last check .IP "\(bu" 4 Next check .SH "FILTER EXPRESSIONS" .IX Header "FILTER EXPRESSIONS" Each expression can be negated with an exclamation mark, e.g. \*(L"!A\*(R" for all non-acknowledged services. .IP "\fBA\fR" 4 .IX Item "A" Check state has been acknowledged .IP "\fBD\fR" 4 .IX Item "D" The host this service belongs to is Down or Unreachable .IP "\fBF\fR" 4 .IX Item "F" Service is flapping between states .IP "\fBN\fR" 4 .IX Item "N" Notifications for this service are disabled .IP "\fBP\fR" 4 .IX Item "P" Only passive checks are enabled. Note that \fB!P\fR simply means that active checks are enabled, no matter the status of passive checks .IP "\fBS\fR" 4 .IX Item "S" Check state is soft. For instance, it used to be \s-1OK\s0 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. .IP "\fBo\fR" 4 .IX Item "o" Host/Service state is \s-1OK\s0 .IP "\fBw\fR" 4 .IX Item "w" Service state is Warning .IP "\fBc\fR" 4 .IX Item "c" Service state is Critical .IP "\fBu\fR" 4 .IX Item "u" Service state is Unknown .IP "\fBp\fR" 4 .IX Item "p" Host or service state is Pending .IP "\fBd\fR" 4 .IX Item "d" Host state is Down .IP "\fBx\fR" 4 .IX Item "x" Host state is Unreachable .SH "EXIT STATUS" .IX Header "EXIT STATUS" Zero, unless errors occured. .SH "CONFIGURATION" .IX Header "CONFIGURATION" None. .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" .IP "\(bu" 4 autodie (included with perl >= 5.10.1) .IP "\(bu" 4 DateTime .IP "\(bu" 4 DateTime::Format::Strptime .IP "\(bu" 4 DateTime::TimeZone .IP "\(bu" 4 Term::Size .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" It is probably not clear from the documentation when an action will operate on hosts and when on services. .PP Note that this software is not yet stable. Command line options may be changed / removed and thus break backwards compatibility at any time. .SS "\s-1REPORTING BUGS\s0" .IX Subsection "REPORTING BUGS" Either via mail to or on . .SH "EXAMPLES" .IX Header "EXAMPLES" .ie n .IP """icli \-r \-s \*(AqAPT Updates\*(Aq""" 4 .el .IP "\f(CWicli \-r \-s \*(AqAPT Updates\*(Aq\fR" 4 .IX Item "icli -r -s APT Updates" Schedule a check of the \*(L"\s-1APT\s0 Updates\*(R" service on all hosts having it .ie n .IP """icli \-lq \-h aneurysm \-g chaosdorf\-hosts""" 4 .el .IP "\f(CWicli \-lq \-h aneurysm \-g chaosdorf\-hosts\fR" 4 .IX Item "icli -lq -h aneurysm -g chaosdorf-hosts" List check queue for all hosts in the hostgroup \*(L"chaosdorf-hosts\*(R", plus the host aneurysm .ie n .IP """icli \-z!o,!A,!S,!D""" 4 .el .IP "\f(CWicli \-z!o,!A,!S,!D\fR" 4 .IX Item "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 .SH "AUTHOR" .IX Header "AUTHOR" Copyright (C) 2010 by Daniel Friesel .SH "LICENSE" .IX Header "LICENSE" .Vb 1 \& 0. You just DO WHAT THE FUCK YOU WANT TO. .Ve