]> git.ipfire.org Git - thirdparty/bacula.git/commit
BEE Backport bacula/src/lib/status.h
authorAlain Spineux <alain@baculasystems.com>
Thu, 23 Apr 2020 14:33:12 +0000 (16:33 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 29 Apr 2021 08:44:17 +0000 (10:44 +0200)
commit09e902234a6730a208fc18eff2d0106d2df84edf
treebb97184a2ca4d10156bd937e04c859d52be71895
parentf9e6334943e5e0fda12adf5b6f9f39961bdd19b3
BEE Backport bacula/src/lib/status.h

This commit is the result of the squash of the following main commits:

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Mon Mar 19 11:31:25 2018 +0100

    Fix compilation on Solaris

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Mon Feb 19 09:36:03 2018 +0100

    Fix compiler warning with rlimit display in list_resource_limits

Author: Alain Spineux <alain@baculasystems.com>
Date:   Tue Mar 21 15:10:06 2017 +0100

    add list_resource_limits() to daemon status (part1)

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Tue Jan 28 09:15:23 2014 +0100

    Implement .api v2 and use computer friendly output to status commands.

    For example, we can use the following code:

    static void api_list_dir_status_header(UAContext *ua)
    {
       OutputWriter wt;
       ua->send_msg("%s",
        wt.get_output(
         OT_STRING, "name",        my_name,
         OT_STRING, "version",     VERSION " (" BDATE ")",
         OT_STRING, "uname",       HOST_OS " " DISTNAME " " DISTVER,
         OT_UTIME,  "started",     daemon_start_time,
         OT_UTIME,  "reloaded",    last_reload_time,
         OT_INT,    "jobs_run",    num_jobs_run,
         OT_INT,    "jobs_running",job_count(),
         OT_END
           ));
    }

    It will display

    name=bacula-dir
    version=6.6.3 (12Dec13)
    uname=....

    The OutputWriter class can be configured to use a custom
    separator (\t or \n for example), custom date format, and
    will handle basic formating such as time, string, integer,
    list of strings, etc...
bacula/src/lib/status.h