Bacula-users

[Bacula-users] Wrong locale?

2012-12-04 06:07:00
Subject: [Bacula-users] Wrong locale?
From: Dennis Hoppe <dennis.hoppe AT debian-solutions DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 04 Dec 2012 11:45:07 +0100
Hello,

i am using the following script to get the status of my last backups:

        https://github.com/twpayne/nagios-plugin-bacula

This script is doing nothing else than a "status client=display1-fd" via
"bconsole" and was working fine until three days.

dho@ampere:~$ sudo /usr/local/lib/nagios/plugins/check_bacula.py -H
display1-fd
OK: Incr, 166 files, 47.83MB, 2012-12-04 02:05:00 (9.6 hours ago)

*status client=display1-fd
...
Terminated Jobs:
 JobId  Level    Files      Bytes   Status   Finished        Name
======================================================================
   379  Incr        158    8.260 M  OK       25-Nov-12 02:05 display1-all
   481  Incr        351    128.5 M  OK       26-Nov-12 02:05 display1-all
   598  Incr        158    3.956 M  OK       27-Nov-12 02:05 display1-all
   723  Incr        159    4.807 M  OK       28-Nov-12 02:05 display1-all
   848  Incr        159    5.660 M  OK       29-Nov-12 02:05 display1-all
   958  Incr        200    50.86 M  OK       30-Nov-12 02:06 display1-all
  1059  Full     56,232    1.346 G  OK       01-Dec-12 02:23 display1-all
  1164  Incr        213    52.16 M  OK       02-Dec-12 02:06 display1-all
  1265  Incr        405    171.8 M  OK       03-Dec-12 02:06 display1-all
  1366  Incr        166    47.83 M  OK       04-Dec-12 02:05 display1-all
====

Now i am getting some strange errors regarding the locale of the date,
because "bconsole" is getting the informations from the client instead
of the database.

dho@ampere:~$ sudo  /usr/local/lib/nagios/plugins/check_bacula.py -H
display2-fd
Traceback (most recent call last):
  File "/usr/local/lib/nagios/plugins/check_bacula.py", line 93, in <module>
    main(sys.argv)
  File "/usr/local/lib/nagios/plugins/check_bacula.py", line 68, in main
    finished = datetime(*(time.strptime(m.group(5), '%d-%b-%y %H:%M')[0:6]))
  File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.6/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data '01-Dez-12 02:15' does not match format '%d-%b-%y
%H:%M'

*status client=display2-fd
...
Terminated Jobs:
 JobId  Level    Files      Bytes   Status   Finished        Name
======================================================================
   380  Incr        115    669.6 K  OK       25-Nov-12 02:05 display2-all
   482  Incr        313    86.55 M  OK       26-Nov-12 02:05 display2-all
   599  Incr        115    533.7 K  OK       27-Nov-12 02:05 display2-all
   724  Incr        115    560.8 K  OK       28-Nov-12 02:05 display2-all
   849  Incr        115    588.4 K  OK       29-Nov-12 02:05 display2-all
   959  Incr        144    1.153 M  OK       30-Nov-12 02:05 display2-all
  1060  Full     43,808    617.7 M  OK       01-Dez-12 02:15 display2-all
  1165  Incr        150    823.0 K  OK       02-Dez-12 02:05 display2-all
  1266  Incr        316    84.31 M  OK       03-Dez-12 02:05 display2-all
  1367  Incr        118    648.3 K  OK       04-Dez-12 02:05 display2-all
====

The following workaround is doing fine, but i think the bacula-fd binary
should reset the locale to C.

dho@display2:~$ export LC_ALL=C && sudo /etc/init.d/bacula-fd restart
Stopping Bacula File daemon...:.
Starting Bacula File daemon...:.

Best regards, Dennis

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>
  • [Bacula-users] Wrong locale?, Dennis Hoppe <=