derf / icli Goto Github PK
View Code? Open in Web Editor NEWIcinga command line interface
Home Page: http://finalrewind.org/projects/App-Icli/
License: Other
Icinga command line interface
Home Page: http://finalrewind.org/projects/App-Icli/
License: Other
icli - Icinga Command Line Interface Requires: * A local icinga daemon + access to some of its files * perl v5.10 or newer with the following modules: * DateTime * DateTime::Format::Strptime * DateTime::TimeZone * List::MoreUtils * Term::Size Installation: > perl Build.PL > ./Build > sudo ./Build install You can then run 'man icli' for more information. Extra modules required for testing: * Test::More * Test::Compile * Test::Pod * Test::Command Note: To work with an Icinga installation, icli needs to know the path to three files: * objects.cache (icinga.cfg object_cache_file) * status.dat (icinga.cfg status_file) * icinga.cmd (icinga.cfg command_file) If you are building interactively and the default values for these paths do not exist, you will be asked for them -- hit return to keep the default. In a non-interactive build, the defaults will be used (unless changed using an option, see below). If you need to set them regardless of the build host, do not wish to be promited at all, or are using a non-interactive build process (perhaps even for a whole distribution), you can set them using the following options: > perl Build.PL --icli-object-file=.../objects.cache \ --icli-status-file=.../status.dat \ --icli-command-file=.../icinga.cmd http://finalrewind.org/projects/icli
Example:
icli -lq pvdevauth02
Host Service Last Check Next Check
pvdevauth02 Check app status mig 2014-05-12 11:20:16 2014-05-12 11:21:16
pvdevauth02 Check app status red 2014-05-12 11:20:27 2014-05-12 11:21:27
pvdevauth02 Check app status aut 2014-05-12 11:21:05 2014-05-12 11:22:05
pvdevauth02 2014-05-12 11:21:04 2014-05-12 11:22:14
pvdevauth02 SSH 2014-05-12 11:18:38 2014-05-12 11:23:38
pvdevauth02 Check app status det never 2014-05-12 11:30:16
pvdevauth02 Check app status pos never 2014-05-12 11:30:27
pvdevauth02 Check disk via ssh never 2014-05-12 11:30:38
icli -u -r pvdevauth02
Scheduled check of * on 'pvdevauth02'
icli -lq pvdevauth02
Host Service Last Check Next Check
pvdevauth02 Check app status aut 2014-05-12 11:21:05 2014-05-12 11:22:05
pvdevauth02 2014-05-12 11:21:04 2014-05-12 11:22:14
pvdevauth02 Check app status mig 2014-05-12 11:21:16 2014-05-12 11:22:16
pvdevauth02 Check app status red 2014-05-12 11:21:27 2014-05-12 11:22:27
pvdevauth02 SSH 2014-05-12 11:18:38 2014-05-12 11:23:38
pvdevauth02 Check app status det never 2014-05-12 11:30:16
pvdevauth02 Check app status pos never 2014-05-12 11:30:27
pvdevauth02 Check disk via ssh never 2014-05-12 11:30:38
Hi, starting to learn how to use icli.
Tried this two commands:
$ icli -h servername # I can get what I want
$ icli -z!o,!A,!S,!D
-bash: !o,!A,!S,!D: event not found
this is copied from the man file, but failed...I think the bash should be the reason.
then I tried copy the command to a script, then run it, got an error:
Use of uninitialized value in numeric ne (!=) at /usr/local/bin/icli line 242.
Know little about perl, can you help...
At the moment icli has hardcoded paths to Icinga datafiles. These can be overwritten by for example:
icli -f /var/cache/icinga2/status.dat -c /var/cache/icinga2/objects.cache
It would be nice if either these defaults would be configurable, be dynamically extracted from the Icinga configuration.
An alterative would be to fork every release of icli to not only hold (in it's package) not only an icli executable which defaults to /var/cache/cinga/* but also an icli2 which defaults to /var/cache/icinga2/*
Support multiple users just like the icinga cgi interface
List/Edit/Delete downtimes, notes about flapping et cetera
I'd like to see a parameter which allows to cut lines to the terminal width.
Another possibility would be to do accurate line breaks which are formatted well.
The line breaks should not occur in the middle of a word - the line break has to be before a word (where usually a whitespace is located) so that it is still human readable ;)
By service state, acknowledge/not acknowledged, maybe service groups, flags (active/passive), etc.
Regards,
I get these lines on every icli invocation on my system:
Use of uninitialized value in split at /usr/bin/icli line 372, <$_[...]> line 1099.
Use of uninitialized value in split at /usr/bin/icli line 372, <$_[...]> line 1121.
Use of uninitialized value in split at /usr/bin/icli line 372, <$_[...]> line 1126.
My icli is installed in a squeeze + backports amd64 system (accessing an icinga 1.7.1-5~bpo60-1 install). The package is a backport, uupdated to 0.46 from the debian base package (http://packages.debian.org/sid/icli ), without any additional patches.
Besides, acknowledging a service doesn't seem to work (I don't know whether it is related or not). Running icli -h localhost -a "we know" 'RAID'
does not make it appear as "acknowledged" in the web interface (but it exits with 0); service name is RAID, of course.
printf-style.
Also, add an output format for -vvv or such, like the CGI's detail view.
icli -l hosts
only shows hosts which do have at least 1 service check.
when none are specified, the host is checked but doesn't get listed by icli
Thanks for fixing :-)
for the rest it's a great program
Thanks in advance,
Pieter van Voorst Vader
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.