thruk(3)

NAME
thruk - Command Line Utility for Thruk Monitoring Gui

SYNOPSIS
Usage: thruk [options] | url]

Options:
  -h, --help Show this help message and exit
  -v, --verbose Print verbose output
  -V, --version Print version

  -b, --backend=<backend>       Comma seperated list of backends/sites
                                which should be used for querys.
  -l, --list-backends           List available backends/sites.
  -a, --action=<action>         Perform this action:
                                  - url=<url>        output url result
                                  - report=<nr>      generate report
                                  - reportmail=<nr>  send report by mail

  -A, --auth=<auth>             Set username for querys

  -c, --credential=<pw>         Credential when connecting to remote
                                Thruk installations specified by the
                                remote-url.
  -r, --remote-url=<url>        URL to remote installation.
      --local                   Don't try to connect fastcgi daemon first.

DESCRIPTION
This script gives access to various parts of the Thruk gui and allows to generate excel reports, csv exports or any other url by using command line and bypassing the webserver.

OPTIONS
script has the following arguments

-h , --help
        print help and exit

-v , --verbose
        print verbose output too

-V , --version
        print version and exit

-b backend, --backend=backend
        specify backend(s), otherwise the default backends will be
        used. Specify the key of the backend. Use <-l> to get a list
        of backends.

-l , --list-backends
        get list of available backends

-a action, --action=action
        perform selected action:

        - url=<url>     request this url. Url can be shortened and the
                        leading /thruk/cgi-bin/ can be stripped.

        - report=<nr>   generate report by specifying its id.

-A authname, --auth=authname
        use this username for authentication

-c credential, --credential=credential
        use this key for authentication when using remoteurl

-r remote-url, --remote-url=remote-url
        Connect to this remote instance instead of the local one.
        Defaults to http://localhost/thruk/cgi-bin/remote.cgi.
        Retrieving information from the fcgi daemon saves time to
        startup and allows to connect to remote located sites.

--local
        Don't contact remote server. Normally remote-url is tried first for
        faster access.

RETURN VALUE
thruk returns 0 on success and >= 1 otherwise

EXAMPLES
List available backends

  %> thruk -l

Export the event log as excel file:

  %> thruk -A thrukadmin -a 'url=/thruk/cgi-bin/showlog.cgi?view_mode=xls' > eventlog.xls

Urls can be shortened. Export all services into an excel file:

  %> thruk 'status.cgi?view_mode=xls&host=all' > allservices.xls

Export service availability data into a csv file:

  %> thruk -A thrukadmin -a 'url=avail.cgi?host=all&timeperiod=last7days&csvoutput=1' > all_host_availability.csv

Generate pdf report

  %> thruk -a 'report=1' > report.pdf

Generate pdf report and send it by mail

  %> thruk -a 'reportmail=1'

AUTHOR
2012, Sven Nierlein, <sven@nierlein.de>