Ad Widget

Collapse

vfs.file.regexp, log or logrt item with UCS-2 Little Endian Encoding not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hardwijj
    Junior Member
    • Jun 2014
    • 2

    #1

    vfs.file.regexp, log or logrt item with UCS-2 Little Endian Encoding not working

    Hi,
    I have an ERRORLOG file from Microsoft SQL Server that I'm trying to monitor it for a specific regex without success. If I open the file in notepad++ it tells me it is 'UCS-2 Little endian' encoded. That maps to Code Page Identifier of 1200 (according to a few Google searches).

    I've tried to describe my problem as simply as I can as follows:
    1. Create a 'UCS-2 Little endian' encoded file (with Notepad++) with a few lines (from the ERRORLOG file):
    Code:
    2014-09-11 19:55:40.03 Server      Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) 
    	Feb  9 2007 22:47:07 
    	Copyright (c) 1988-2005 Microsoft Corporation
    2. On the client Windows machine save as C:\test.txt

    3. From the server run:

    Code:
    $ zabbix_get -s <hostname> -k "vfs.file.regexp[C:\test.txt,Server,1200]"
    2014-09-11 19:55:40.03 Server      Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
    $
    ...the first line of the file prefixed with some 'junk'.

    4. From server now run :
    Code:
    $ zabbix_get -s <hostname> -k "vfs.file.regexp[C:\test.txt,Feb,1200]"
    
    $
    ...it doesn't find anything.

    5. Change the encoding (using Notepad++ convert ) to ANSI encoding; the above commands work as expected.

    I have the same problem if I use the 'log' or 'logrt' item (which is actually what I really want to use).

    I'm using: zabbix_get v2.2.1 running on Linux and the zabbix_agentd is 2.4.0 running on Windows.

    Any help or pointers to how I can make this work would be gratefully received.
    Many thanks Jim
  • hardwijj
    Junior Member
    • Jun 2014
    • 2

    #2
    Use Windows-specific item key eventlog

    I've got past my problem - the errors were appearing in the Application event log too and then found the Windows specific item: 'eventlog'
    That worked.

    I don't understand why using the encoding parameter did not work.

    Comment

    • simoon
      Junior Member
      • May 2014
      • 8

      #3
      Something like this should work for "log" item:

      log["C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG",Error,"UTF-16"]

      Comment

      • ozzabix
        Junior Member
        • Apr 2017
        • 9

        #4
        Originally posted by simoon
        Something like this should work for "log" item:

        log["C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG",Error,"UTF-16"]
        What is zabbix server version?

        Zabbix 3.0.8 version log monitoring UCS2-LE working normaly.But on zabbix 3.2.x not working
        Last edited by ozzabix; 07-04-2017, 22:40.

        Comment

        Working...