View Issue Details

IDProjectCategoryView StatusLast Update
0000553bareos-core[All Projects] apipublic2019-12-18 15:25
ReporterjoergsAssigned Tojoergs 
Status closedResolutionfixed 
Product Version 
Fixed in Version16.1.0 
Summary0000553: Expose additional JobStatus information to external programs
DescriptionThe JobStatus is a character between "a"-"z" and "A"-"Z". 26 (?) characters are used.

Each job is stored in the database Job table and has a JobStatus assigned to it.

Current status:
The interpretation of the JobStatus is done in different places in the bareos-director code.
External programs need to interpret the status in their own code.
This could lead to different interpretations of the JobStatus.

Occurances in the code:

* src/include/jcr.h
#define JS_Canceled 'A' /* Canceled by user */

#define job_terminated_successfully(jcr)
#define job_canceled(jcr)
#define job_waiting(jcr)

In a lot of the SQL commands (src/cats/*.c):
    WHERE JobStatus IN ('T','W')
    WHERE JobStatus IN ('T','W','f','A','E')

src/dird/ua_cmds.c:wait_cmd(UAContext *ua, const char *cmd)
    defines ExitStatus between 0-3
    uses and outputs job_status_to_str(int stat)

database table "Status" defines:
   JobStatus CHAR(1) NOT NULL,
   JobStatusLong BLOB,
   Severity INTEGER,
Only used by bat (?).

void jobstatus_to_ascii(int JobStatus, char *msg, int maxlen)
    called from 8 places
void jobstatus_to_ascii_gui(int JobStatus, char *msg, int maxlen)
    with fallback to jobstatus_to_ascii
    called from 3 places (only from qt-console)
const char *job_status_to_str(int stat)
    (handles only a subset of JobStatus)
    only called from src/dird/ua_cmds.c:wait_cmd(UAContext *ua, const char *cmd)

Have a unified handling of interpreting JobStatus.
* expose JobStatus information to external programs
* devide in JobStatus classes:
    - running (all, otherwise it would not be in the database Job table)
      - running and waiting (is the waiting information relevant for searches? If not, it might be enough to show the long desciption of a JobStatus)
    - terminated
      - ok
      - warnings
      - errors
* get JobStatus description from external programs
* get JobStatus description for deferent language settings
* bcommnd: extend "llist jobs" by option: minjobexitstatus=<Ok|Warning|Error>]

* add bcommand: .jobstatus [=<jobstatus>] [=lang=<languagesettings>]
  * return json structure with:
    * JobStatus
    * JobStatusLong
    * JobStatusLong according language
    * Severity
    * JobStatusExitLevel (NULL, Ok, Warning, Error)
    * JobExitStatusLevel (NULL, 0, 1, 2)
  * this could be done without extending the database table "Status"
* extend bcommand llist jobs output by join with "Status" table with columns:
  * Status.JobStatusLong (?)
  * Status.JobExitStatusLevel (?)
  * JobExitStatus: (NULL, Ok, Warning, Error)
TagsNo tags attached.
bareos-master: impactyes
bareos-master: action
bareos-19.2: impact
bareos-19.2: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impactno
bareos-15.2: action
bareos-14.2: impactno
bareos-14.2: action
bareos-13.2: impactno
bareos-13.2: action
bareos-12.4: impactno
bareos-12.4: action

Issue History

Date Modified Username Field Change
2015-11-06 12:19 joergs New Issue
2015-11-06 12:19 joergs Status new => assigned
2015-11-06 12:19 joergs Assigned To => joergs
2015-11-06 12:20 joergs bareos-master: impact => yes
2015-11-06 12:20 joergs bareos-15.2: impact => no
2015-11-06 12:20 joergs bareos-14.2: impact => no
2015-11-06 12:20 joergs bareos-13.2: impact => no
2015-11-06 12:20 joergs bareos-12.4: impact => no
2016-03-10 15:17 joergs Note Added: 0002208
2016-03-10 15:17 joergs Status assigned => resolved
2016-03-10 15:17 joergs Fixed in Version => 16.1.0
2016-03-10 15:17 joergs Resolution open => fixed
2019-12-18 15:25 arogge Status resolved => closed