Menu

#42 Can't form reports

v1.0_(example)
open
nobody
None
5
2021-03-01
2017-03-27
No

Hello!
I installed the last version of SARG.
SARG Version: 2.4.0-pre2 Mar-19-2015
And I have the problem with reports. After my LDAP server returns the user name in Russian language, I get the error

SARG: iconv failed on string "Муратов Дмитрий Владимирович":
SARG: Error: Bad file descriptor.

[root@srv-07 sarg-code]# sarg -x -z
SARG: Init
SARG: Loading configuration file "/etc/sarg/sarg.conf"
SARG: TAG: access_log /var/log/squid/access.log
SARG: TAG: graph_days_bytes_bar_color orange
SARG: TAG: output_dir /var/www/html/sarg/ONE-SHOT
SARG: TAG: resolve_ip yes
SARG: Chaining IP resolving module "dns"
SARG: TAG: user_ip no
SARG: TAG: date_format e
SARG: TAG: overwrite_report yes
SARG: TAG: records_without_userid ignore
SARG: TAG: usertab ldap
SARG: TAG: LDAPHost ****************
SARG: TAG: LDAPPort 389
SARG: TAG: LDAPBindDN ******************
SARG: TAG: LDAPBindPW **************
SARG: TAG: LDAPBaseSearch ****************
SARG: TAG: LDAPFilterSearch (sAMAccountName=%s)
SARG: TAG: LDAPTargetAttr displayName
SARG: TAG: long_url no
SARG: TAG: charset UTF-8
SARG: TAG: show_successful_message no
SARG: TAG: redirector_log /var/log/rejik/redirector.log
SARG: TAG: redirector_log_format #year#-#mon#-#day# #hour# #list#:#tmp# #ip# #user# #tmp#/#tmp#/#url#/#end#
SARG: TAG: show_sarg_info no
SARG: TAG: show_sarg_logo no
SARG: TAG: external_css_file /sarg/sarg.css
SARG: TAG: strip_user_suffix @TRIATSYSTEMS.RU
SARG: TAG: sorttable /sarg/sorttable.js
SARG: Parameters:
SARG:           Hostname or IP address (-a) =
SARG:                     Exclude file (-c) =
SARG:                  Date from-until (-d) =
SARG:    Email address to send reports (-e) =
SARG:                      Config file (-f) = /etc/sarg/sarg.conf
SARG:                      Date format (-g) = Europe (dd/mm/yyyy)
SARG:                        IP report (-i) = No
SARG:             Keep temporary files (-k) = No
SARG:                        Input log (-l) = /var/log/squid/access.log
SARG:                   Redirector log (-L) = /var/log/rejik/redirector.log
SARG:               Resolve IP Address (-n) = Yes
SARG:                       Output dir (-o) = /var/www/html/sarg/ONE-SHOT/
SARG: Use Ip Address instead of userid (-p) = No
SARG:                    Accessed site (-s) =
SARG:                             Time (-t) =
SARG:                             User (-u) =
SARG:                    Temporary dir (-w) = /tmp/sarg
SARG:                   Debug messages (-x) = Yes
SARG:                 Process messages (-z) = 1
SARG:  Previous reports to keep (--lastlog) = 0
SARG:
SARG: sarg version: 2.4.0-pre2 Mar-19-2015
SARG: Reading access log file: /var/log/squid/access.log
SARG: Log format identified as "squid log format" for /var/log/squid/access.log
SARG: Records in file: 1245488
SARG:    Records read: 1245488, written: 1240981, excluded: 0
SARG: Reasons for excluded entries:
SARG:    No user in entry: 4507
SARG: squid log format: 1245488 entries
SARG: Period covered by log files: 03/27/2017-03/27/2017
SARG: Period extracted from log files: 03/27/2017-03/27/2017
SARG: (info) outdirname=/var/www/html/sarg/ONE-SHOT/27Mar2017-27Mar2017
SARG: Loading User table from "ldap"
SARG: Sorting file "/tmp/sarg/d_muratov.user_unsort"
SARG: iconv failed on string "Муратов Дмитрий Владимирович":
SARG: Error: Bad file descriptor.

Discussion

  • Bunin Vladimir

    Bunin Vladimir - 2017-03-27

    I tried to do with another parameter from LDAP which is in English. It doesn't matter which language it is, the error is the same.

    SARG: Loading User table from "ldap"
    SARG: Sorting file "/tmp/sarg/d_muratov.user_unsort"
    SARG: iconv failed on string "d.muratov":
    SARG: Error: Bad file descriptor.
    
     
  • Frederic Marchal

    That error has nothing to do with LDAP. It's iconv complaining that it cannot convert the string because the iconv library was not initialized properly.

    Your /etc/sarg/sarg.conf lacks a LDAPNativeCharset option specifying the encoding to use to decode strings returned by the LDAP server.

    Sarg could be more helpful in that case. I'll look into that.

     
  • Bunin Vladimir

    Bunin Vladimir - 2017-03-28

    This option LDAPNativeChars solved the problem. Now all my reports are in Russian and with names from AD.

    LDAPNativeCharset UTF-8

     

    Last edit: Bunin Vladimir 2017-03-28
    • Sérgio Neves

      Sérgio Neves - 2021-03-01

      TKS!!!

       

Log in to post a comment.

MongoDB Logo MongoDB