Ad Widget

Collapse

Linux Log file Monitoring + UserParameter issue.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bertrand39100
    Junior Member
    • Feb 2010
    • 27

    #1

    Linux Log file Monitoring + UserParameter issue.

    Hello All,

    I try to monitor linux log files, we 're hosting web applications and I want to be notified
    everytime errors are inside some applications log file.

    First ; I tried zabbix_agentd Log monitoring but with some issues.
    I would use zabbix_agentd UserParameter :

    Here is my config :
    Zabbix server 1.8
    Zabbix Agentd 1.8

    Zabbix_agentd conf :

    Server=172.17.x.x,172.17.x.x
    Hostname=adm1.xxx.xxx
    ServerPort=10051
    ListenPort=10050
    StartAgents=3
    DebugLevel=4
    RefreshActiveChecks=120
    MaxLinesPerSecond=10
    EnableRemoteCommands=1
    LogRemoteCommands=1
    LogFileSize=5
    LogFile=/var/log/zabbix_agentd/zabbix_agentd.log
    LogUnresolvedSymbols=/var/log/zabbix_agentd/zabbix_unresolved_symbols.log
    PidFile=/var/run/zabbix_agentd/zabbix_agentd.pid
    Include=/etc/zabbix_agentd/include/
    Timeout=30
    ## Parameters
    UserParameter=STRING_OPTION1,egrep "option" /test25_logmon/tcsd.conf
    UserParameter=STRING_OPTION2,egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}'
    UserParameter=STRING_OPTION3,egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}' | wc -l
    ## End Parameters


    I created 3 items (First test was with Type = Character end second test was with type = text) :

    Item 1 : OPTION_STRING1 Type : Zabbix Agent (active) Key : OPTION_STRING1 Type : Text Update Interval : 60 History : 7
    Item 2 : OPTION_STRING2 Type : Zabbix Agent (active) Key : OPTION_STRING2 Type : Text Update Interval : 60 History : 7
    Item 3 : OPTION_STRING3 Type : Zabbix Agent (active) Key : OPTION_STRING3 Type : Text Update Interval : 60 History : 7

    Trigger Item 1 : {adm1.xxx.xxx:OPTION_STRING1.str(option)}=1
    No Trigger for Item 2.
    Trigger Item 3 : {adm1.xxx.xxx:OPTION_STRING3.last(0)}#0


    Each time I have in zabbix_agentd log ; the value "ZBX_NOTSUPPORTED" :

    19459:20110117:102207.954 In send_buffer('172.17.x.x','10051')
    19459:20110117:102207.954 Values in the buffer 0 Max 100
    19459:20110117:102207.954 refresh_active_checks('172.17.x.x',10051)
    19459:20110117:102207.957 Sending [{
    "request":"active checks",
    "host":"adm1.xxx.xxx"}]
    19459:20110117:102207.957 Before read
    19459:20110117:102207.958 Got [{
    "response":"success",
    "data":[
    {
    "key":"OPTION_STRING1",
    "delay":"60",
    "lastlogsize":"0",
    "mtime":"0"},
    {
    "key":"OPTION_STRING2",
    "delay":"60",
    "lastlogsize":"0",
    "mtime":"0"},
    {
    "key":"OPTION_STRING3",
    "delay":"60",
    "lastlogsize":"0",
    "mtime":"0"}]}]
    19459:20110117:102207.958 In parse_list_of_checks()
    19459:20110117:102207.959 In disable_all_metrics()
    19459:20110117:102207.959 In add_check('OPTION_STRING1', 60, 0, 0)
    19459:20110117:102207.959 In add_check('OPTION_STRING2', 60, 0, 0)
    19459:20110117:102207.959 In add_check('OPTION_STRING3', 60, 0, 0)
    19459:20110117:102207.959 In process_active_checks('172.17.x.x',10051)
    19459:20110117:102207.959 For key [OPTION_STRING1] received value [ZBX_NOTSUPPORTED]
    19459:20110117:102207.959 In process_value('adm1.xxx.xxx','OPTION_STRING1','ZBX _NOTSUPPORTED')
    19459:20110117:102207.959 In send_buffer('172.17.x.x','10051')
    19459:20110117:102207.959 Values in the buffer 0 Max 100
    19459:20110117:102207.959 Buffer: first allocation for 100 elements
    19459:20110117:102207.960 Buffer: new element 0
    19459:20110117:102207.960 Active check [OPTION_STRING1] is not supported. Disabled.
    19459:20110117:102207.960 For key [OPTION_STRING2] received value [ZBX_NOTSUPPORTED]
    19459:20110117:102207.960 In process_value('adm1.xxx.xxx','OPTION_STRING2','ZBX _NOTSUPPORTED')
    19459:20110117:102207.960 In send_buffer('172.17.x.x','10051')
    19459:20110117:102207.960 Values in the buffer 1 Max 100
    19459:20110117:102207.960 JSON before sending [{
    "request":"agent data",
    "data":[
    {
    "host":"adm1.xxx.xxx",
    "key":"OPTION_STRING1",
    "value":"ZBX_NOTSUPPORTED",
    "clock":1295256127}],
    "clock":1295256127}]
    19455:20110117:102208.172 In collector_diskdevice_get("")
    19455:20110117:102208.172 In collector_diskdevice_get("sda")
    19455:20110117:102208.172 In collector_diskdevice_get("sdb")
    19455:20110117:102208.172 In collector_diskdevice_get("hda")
    19459:20110117:102208.437 JSON back [{
    "response":"success",
    "info":"Processed 1 Failed 0 Total 1 Seconds spent 0.475726"}]
    19459:20110117:102208.437 In check_response({
    "response":"success",
    "info":"Processed 1 Failed 0 Total 1 Seconds spent 0.475726"})
    19459:20110117:102208.437 Info from server: Processed 1 Failed 0 Total 1 Seconds spent 0.475726
    19459:20110117:102208.437 OK
    19459:20110117:102208.437 Buffer: new element 0
    19459:20110117:102208.437 Active check [OPTION_STRING2] is not supported. Disabled.
    19459:20110117:102208.437 For key [OPTION_STRING3] received value [ZBX_NOTSUPPORTED]
    19459:20110117:102208.437 In process_value('adm1.xxx.xxx','OPTION_STRING3','ZBX _NOTSUPPORTED')
    19459:20110117:102208.437 In send_buffer('172.17.x.x','10051')
    19459:20110117:102208.437 Values in the buffer 1 Max 100
    19459:20110117:102208.437 Will not send now. Now 1295256128 lastsent 1295256127 < 5
    19459:20110117:102208.438 Buffer: new element 1
    19459:20110117:102208.438 Active check [OPTION_STRING3] is not supported. Disabled.
    19459:20110117:102208.438 In get_min_nextcheck()
    19459:20110117:102208.438 In send_buffer('172.17.x.x','10051')
    19459:20110117:102208.438 Values in the buffer 2 Max 100
    19459:20110117:102208.438 Will not send now. Now 1295256128 lastsent 1295256127 < 5
    19459:20110117:102208.438 Sleeping for 1 seconds
    19459:20110117:102209.439 In send_buffer('172.17.x.x','10051')
    19459:20110117:102209.439 Values in the buffer 2 Max 100
    19459:20110117:102209.439 Will not send now. Now 1295256129 lastsent 1295256127 < 5
    19459:20110117:102209.440 Sleeping for 1 seconds
    19459:20110117:102210.442 In send_buffer('172.17.x.x','10051')
    19459:20110117:102210.442 Values in the buffer 2 Max 100
    19459:20110117:102210.442 Will not send now. Now 1295256130 lastsent 1295256127 < 5
    19459:20110117:102210.442 Sleeping for 1 seconds
    19459:20110117:102211.445 In send_buffer('172.17.x.x','10051')
    19459:20110117:102211.445 Values in the buffer 2 Max 100
    19459:20110117:102211.445 Will not send now. Now 1295256131 lastsent 1295256127 < 5
    19459:20110117:102211.445 Sleeping for 1 seconds
    19459:20110117:102212.447 In send_buffer('172.17.x.x','10051')
    19459:20110117:102212.447 Values in the buffer 2 Max 100
    19459:20110117:102212.448 JSON before sending [{
    "request":"agent data",
    "data":[
    {
    "host":"adm1.xxx.xxx",
    "key":"OPTION_STRING2",
    "value":"ZBX_NOTSUPPORTED",
    "clock":1295256128},
    {
    "host":"adm1.xxx.xxx",
    "key":"OPTION_STRING3",
    "value":"ZBX_NOTSUPPORTED",
    "clock":1295256128}],
    "clock":1295256132}]
    19459:20110117:102212.484 JSON back [{
    "response":"success",
    "info":"Processed 2 Failed 0 Total 2 Seconds spent 0.035201"}]
    19459:20110117:102212.484 In check_response({
    "response":"success",
    "info":"Processed 2 Failed 0 Total 2 Seconds spent 0.035201"})
    19459:20110117:102212.484 Info from server: Processed 2 Failed 0 Total 2 Seconds spent 0.035201
    19459:20110117:102212.484 OK
    19459:20110117:102212.484 Sleeping for 1 seconds
    19459:20110117:102213.485 In send_buffer('172.17.x.x','10051')
    19459:20110117:102213.485 Values in the buffer 0 Max 100
    19459:20110117:102213.485 Will not send now. Now 1295256133 lastsent 1295256132 < 5
    19459:20110117:102213.486 Sleeping for 1 seconds
    19459:20110117:102214.487 In send_buffer('172.17.x.x','10051')
    19459:20110117:102214.487 Values in the buffer 0 Max 100
    19459:20110117:102214.487 Will not send now. Now 1295256134 lastsent 1295256132 < 5
    19459:20110117:102214.487 Sleeping for 1 seconds
    19459:20110117:102215.489 In send_buffer('172.17.x.x','10051')
    19459:20110117:102215.489 Values in the buffer 0 Max 100
    19459:20110117:102215.489 Will not send now. Now 1295256135 lastsent 1295256132 < 5
    19459:20110117:102215.489 Sleeping for 1 seconds
    19459:20110117:102216.491 In send_buffer('172.17.x.x','10051')
    19459:20110117:102216.491 Values in the buffer 0 Max 100
    19459:20110117:102216.491 Will not send now. Now 1295256136 lastsent 1295256132 < 5
    19459:20110117:102216.491 Sleeping for 1 seconds
    19459:20110117:102217.492 In send_buffer('172.17.x.x','10051')
    19459:20110117:102217.492 Values in the buffer 0 Max 100
    19459:20110117:102217.492 Sleeping for 1 seconds
    19459:20110117:102218.493 In send_buffer('172.17.x.x','10051')
    19459:20110117:102218.493 Values in the buffer 0 Max 100
    19459:20110117:102218.493 Sleeping for 1 seconds
    19459:20110117:102219.495 In send_buffer('172.17.x.x','10051')
    19459:20110117:102219.495 Values in the buffer 0 Max 100
    19459:20110117:102219.496 Sleeping for 1 seconds


    No items are available on zabbix GUI

    Any idea will be appreciate.

    Have a good day.

    Many Thanks.

    Bertrand.
  • Bertrand39100
    Junior Member
    • Feb 2010
    • 27

    #2
    All,

    Even If I use Zabbix Agent (active) or Zabbix Agent ; I always get "ZBX_NOTSUPPORTED"

    Many Thanks.

    Bertrand.

    Comment

    • dima_dm
      Senior Member
      • Dec 2009
      • 2697

      #3
      UserParameter script always must send data as one string and data always must exist!!!

      Comment

      • Bertrand39100
        Junior Member
        • Feb 2010
        • 27

        #4
        Good Afternoon Dima_dm,

        Thanks for your usefull information.

        I would tell you what I have for the items :

        ## Parameters
        UserParameter=STRING_OPTION1,egrep "option" /test25_logmon/tcsd.conf
        UserParameter=STRING_OPTION2,egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}'
        UserParameter=STRING_OPTION3,egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}' | wc -l
        ## End Parameters

        in linux box I have :

        STRING_OPTION1 : "egrep "option" /test25_logmon/tcsd.conf" =
        # of the options available is an "exclusive" session, meaning that the TPM
        # option or not. By default, exclusive sessions are not enforced, since this
        # Description: This option determines the host platform (host the TCS system
        # Description: This option determines all the platform classes supported by the

        STRING_OPTION2 : "egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}'" =
        of
        option
        Description:
        Description:

        STRING_OPTION3 : "egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}' | wc -l" =
        4

        According what you told me I understand the problem for STRING_OPTION1,STRING_OPTION2

        but why I have "ZBX_NOTSUPPORTED" for STRING_OPTION3 ?

        What is the better way to analyse log file with linux script over system command, to search string inside and sending to zabbix GUI ?

        maybe I don't use the good command or my script is not good ?
        Does anyone have some examples to help me solving my issue, please ?

        Many Thanks.

        Comment

        • Colttt
          Senior Member
          Zabbix Certified Specialist
          • Mar 2009
          • 878

          #5
          maybe I don't use the good command or my script is not good ?
          what do you search?

          can you give me an example or the log-file!?
          Debian-User

          Sorry for my bad english

          Comment

          • Bertrand39100
            Junior Member
            • Feb 2010
            • 27

            #6
            Hello all,

            Please find attached a log file for an application.


            Just to tell you, we are hosting many web applications coded in java for hospitals written by an outside supplier.
            those web apps are running under either jboss or tomcat.

            for example I would cath the following pattern text :

            "OutOfMemoryError: GC overhead limit exceeded" and be notified each time this kind of string or others are present in apps logs.

            inside the log extraction you have 5 times the upper pattern text I would catch. log size per day are aroud 10 or 20 Mo sometime more.

            the aim for me is to catch some special text because inside those log files there are many java exceptions
            and many other informations but only special pattern text is usefull for me because in some case it could be nice
            to catch the string because we need to restart sometime tomcat of jboss or do manual work.

            If there is another way to do that in zabbix, tell me maybe I'm wrong.

            Many thanks in advance.
            Attached Files

            Comment

            • dima_dm
              Senior Member
              • Dec 2009
              • 2697

              #7
              You can write script and code all error as value map (Administration-> General-> VALUE MAPPING).
              Example
              0 OK
              1 error_1
              2 error_2
              3 error_3
              etc
              Or to use binary masks if some errors can be simultaneously.
              0 Ok
              1 error_1
              2 error_2
              4 error_3
              8 error_4
              16 error_5
              And to give result as the sum of codes
              Last edited by dima_dm; 18-01-2011, 13:06.

              Comment

              • Bertrand39100
                Junior Member
                • Feb 2010
                • 27

                #8
                Good Afternoon all,

                Thanks for your information, you know I'm not so good at building creating shell scripts
                I don't known how to do and integrate with VALUE MAPPING, i will try.


                could you please give your lights on that problem ?

                because in a first time If I manage to solve my problem of "ZBX_NOTSUPPORTED"
                is it a problem of item type, item format ?


                on my tests I have defined the following :

                in zabbix_agentd.conf :
                Server=172.17.x.x,172.17.x.x
                Hostname=adm1.xxx.priv
                ServerPort=10051
                ListenPort=10050
                StartAgents=3
                DebugLevel=4
                RefreshActiveChecks=120
                MaxLinesPerSecond=10
                EnableRemoteCommands=1
                LogRemoteCommands=1
                LogFileSize=5
                LogFile=/var/log/zabbix_agentd/zabbix_agentd.log
                LogUnresolvedSymbols=/var/log/zabbix_agentd/zabbix_unresolved_symbols.log
                PidFile=/var/run/zabbix_agentd/zabbix_agentd.pid
                Include=/etc/zabbix_agentd/include/
                Timeout=30
                ## Parameters
                UserParameter=STRING_OPTION1,egrep "option" /test30_logmon/tcsd.conf
                UserParameter=STRING_OPTION2,egrep "option" /test30_logmon/tcsd.conf | awk '{print $2}'
                UserParameter=STRING_OPTION3,egrep "option" /test30_logmon/tcsd.conf | awk '{print $1 $2}'
                UserParameter=STRING_OPTION4[*],egrep -i "option" /test30_logmon/tcsd.conf|sed 's/.*\t//'
                UserParameter=STRING_OPTION5,egrep "option" /test30_logmon/tcsd.conf | awk '{print $2}' | wc -l
                ## End Parameters

                Item 1 : OPTION_STRING1 Type : Zabbix Agent (active) Key : OPTION_STRING1 Type : Text Update Interval : 60 History : 7
                Item 2 : OPTION_STRING2 Type : Zabbix Agent (active) Key : OPTION_STRING2 Type : Text Update Interval : 60 History : 7
                Item 3 : OPTION_STRING3 Type : Zabbix Agent (active) Key : OPTION_STRING3 Type : Character Update Interval : 60 History : 7
                Item 4 : OPTION_STRING4 Type : Zabbix Agent (active) Key : OPTION_STRING4 Type : Text Update Interval : 60 History : 7
                Item 5 : OPTION_STRING5 Type : Zabbix Agent (active) Key : OPTION_STRING5 Type : Numeric (unsigned) / data type : decimal Units :
                Update Interval : 60 History : 7

                Trigger Item 1 : {adm1.xxx.priv:OPTION_STRING1.str(option)}=1
                No Trigger for Item 2.
                Trigger Item 3 : {adm1.xxx.priv:OPTION_STRING3.last(0)}#0
                No Trigger for Item 4.
                Trigger Item 3 : {adm1.xxx.priv:OPTION_STRING5.abschange(0)}#0

                When I test in linux command prompt, I have :

                STRING_OPTION1 :
                # of the options available is an "exclusive" session, meaning that the TPM
                # option or not. By default, exclusive sessions are not enforced, since this
                # Description: This option determines the host platform (host the TCS system
                # Description: This option determines all the platform classes supported by the

                STRING_OPTION2 :
                of
                option
                Description:
                Description:

                STRING_OPTION3 :
                #of
                #option
                #Description:
                #Description:

                STRING_OPTION4 :
                # Option: port
                # Option: num_threads
                # Option: system_ps_file
                # Option: firmware_log_file
                # Option: kernel_log_file
                # Option: firmware_pcrs
                # Option: kernel_pcrs
                # Option: platform_cred
                # Option: conformance_cred
                # Option: endorsement_cred
                # Option: remote_ops
                # Option: enforce_exclusive_transport
                # of the options available is an "exclusive" session, meaning that the TPM
                # option or not. By default, exclusive sessions are not enforced, since this
                # Option: host_platform_class
                # Description: This option determines the host platform (host the TCS system
                # Option: all_platform_classes
                # Description: This option determines all the platform classes supported by the

                STRING_OPTION5 :
                4

                on zabbix server command prompt :

                [root@zabbix bin]# ./zabbix_get -s172.17.x.x -p10050 -k"vfs.fs.size[/,pused]"
                23.952258
                [root@zabbix bin]# ./zabbix_get -s172.17.x.x -p10050 -k"STRING_OPTION1"
                # of the options available is an "exclusive" session, meaning that the TPM
                # option or not. By default, exclusive sessions are not enforced, since this
                # Description: This option determines the host platform (host the TCS system
                # Description: This option determines all the platform classes supported by the
                [root@zabbix bin]# ./zabbix_get -s172.17.4.1 -p10050 -k"STRING_OPTION2"
                of
                option
                Description:
                Description:
                [root@zabbix bin]# ./zabbix_get -s172.17.x.x -p10050 -k"STRING_OPTION3"
                #of
                #option
                #Description:
                #Description:
                [root@zabbix bin]# ./zabbix_get -s172.17.x.x -p10050 -k"STRING_OPTION4"
                # Option: port
                # Option: num_threads
                # Option: system_ps_file
                # Option: firmware_log_file
                # Option: kernel_log_file
                # Option: firmware_pcrs
                # Option: kernel_pcrs
                # Option: platform_cred
                # Option: conformance_cred
                # Option: endorsement_cred
                # Option: remote_ops
                # Option: enforce_exclusive_transport
                # of the options available is an "exclusive" session, meaning that the TPM
                # option or not. By default, exclusive sessions are not enforced, since this
                # Option: host_platform_class
                # Description: This option determines the host platform (host the TCS system
                # Option: all_platform_classes
                # Description: This option determines all the platform classes supported by the
                [root@zabbix bin]# ./zabbix_get -s172.17.x.x -p10050 -k"STRING_OPTION5"
                4


                On Zabbix server GUI, I have nothing, all items were active and after zabbix_agentd checks items are in state "NOT SUPPORTED" no value at all.

                Why with the zabbix_get tool it's working good ; all data are successfully retreived and on the GUI not

                Is it a question of items type that is not correctly defined ? What's wrong ?

                Many Thanks.

                Comment

                • dima_dm
                  Senior Member
                  • Dec 2009
                  • 2697

                  #9
                  My be problem with firewall? You can change type of Item in Zabbix Agent.
                  Util zabbix_get can check Zabbix Agent Item, but can't check Zabbix Agent (active) Item.
                  See
                  http://www.zabbix.com/wiki/doc/tech/...xagentprotocol

                  The arrow specifies a direction of opening TCP session
                  Zabbix Agent
                  server:TCP 10050 <- Zabbix_Server

                  Zabbix Agent (active)
                  server -> Zabbix_Server:TCP 10051
                  Last edited by dima_dm; 19-01-2011, 09:09.

                  Comment

                  • Bertrand39100
                    Junior Member
                    • Feb 2010
                    • 27

                    #10
                    Her ShaDow and all,

                    Sorry, I really don't speak German (except only very little words and you, do you speak French ? cause I'm a french guy.

                    According your last mail, between zabbix_agentd client (172.17.x1.x1) and zabbix server (172.17.x1.x2) there are no firewall ;
                    client and server are on the same network.

                    I have done 2 tests with zabbix_agent active (first) et zabbix_agent (second) but the result is the same.

                    To summarize my issue : I don't manage to "catch" text (monitor) inside application log file.
                    My problem is all tests I do with the "UserParameter" option don't work.

                    The latest information I provided to you was to show you it's working with the zabbix_get tool in command-line
                    but inside zabbix GUI I have problem, no information are available.

                    yes each time I tested I stop/restart zabbix_agentd.

                    Here below is my latest configuration of zabbix_agentd file :

                    Server=172.17.x.x,172.17.x.x
                    Hostname=adm1.xxx.priv
                    ServerPort=10051
                    ListenPort=10050
                    StartAgents=3
                    DebugLevel=4
                    RefreshActiveChecks=120
                    MaxLinesPerSecond=10
                    EnableRemoteCommands=1
                    LogRemoteCommands=1
                    LogFileSize=5
                    LogFile=/var/log/zabbix_agentd/zabbix_agentd.log
                    LogUnresolvedSymbols=/var/log/zabbix_agentd/zabbix_unresolved_symbols.log
                    PidFile=/var/run/zabbix_agentd/zabbix_agentd.pid
                    Include=/etc/zabbix_agentd/include/
                    Timeout=30
                    ## Parameters
                    UserParameter=STRING_OPTION1,egrep "option" /test31_logmon/tcsd.conf
                    UserParameter=STRING_OPTION2,egrep "option" /test31_logmon/tcsd.conf | awk '{print $2}'
                    UserParameter=STRING_OPTION3,egrep "option" /test31_logmon/tcsd.conf | awk '{print $1 $2}'
                    UserParameter=STRING_OPTION4[*],egrep -i "option" /test31_logmon/tcsd.conf|sed 's/.*\t//'
                    UserParameter=STRING_OPTION5,egrep "option" /test31_logmon/tcsd.conf | awk '{print $2}' | wc -l
                    ## End Parameters

                    Here below is UserParameter config :
                    (USERPARAMETER_ITEM_01.jpg)

                    Item 1 : OPTION_STRING1 Type : Zabbix Agent (active) Key : OPTION_STRING1 Type : Text Update Interval : 60 History : 7
                    Item 2 : OPTION_STRING2 Type : Zabbix Agent (active) Key : OPTION_STRING2 Type : Text Update Interval : 60 History : 7
                    Item 3 : OPTION_STRING3 Type : Zabbix Agent (active) Key : OPTION_STRING3 Type : Character Update Interval : 60 History : 7
                    Item 4 : OPTION_STRING4 Type : Zabbix Agent (active) Key : OPTION_STRING4 Type : Text Update Interval : 60 History : 7
                    Item 5 : OPTION_STRING5 Type : Zabbix Agent (active) Key : OPTION_STRING5 Type : Numeric (unsigned) / Data type : decimal
                    Units : "empty" Units Multiplier : "Do not use" Update Interval : 60 History : 7 Trends : 0 Store Value : "As is" Show value : "As is"

                    Trigger Item 1 : {adm1.xxx.priv:OPTION_STRING1.str(option)}=1 / High
                    No Trigger for Item 2.
                    Trigger Item 3 : {adm1.xxx.priv:OPTION_STRING3.last(0)}#0 / Warning
                    No Trigger for Item 4.
                    Trigger Item 3 : {adm1.xxx.priv:OPTION_STRING5.abschange(0)}#0 / High

                    Permission on the file is :

                    If I don't make any mistake zabbix user should have read access to the file we want to monitor.

                    here is the permission on the file :

                    -rw----r-- 1 root root 6411 Jan 19 12:01 tcsd.conf


                    Under Linux command, you can see the results for all egrep command (check information in past threads)

                    With Zabbix_get tool, all command is OK you can see the result in the latest thread.

                    please find 2 zabbix_agentd.log (one done with zabbix agent active, second zabbix agent)
                    with all OPTION_STRING1-5 with "ZBX_UNSUPPORTED"

                    On Zabbix server before the zabbix_agentd client get the item list I have :
                    (USERPARAMETER_ITEM_02.jpg) and after

                    No way to see the result except items are changed to unsupported state for UserParameter items
                    (USERPARAMETER_ITEM_03.jpg)

                    How could I have thoses items with no "ZBX_UNSUPPORTED" state ?

                    Inside zabbix GUI, I have problem :

                    I'm stuck I don't know how solving the problem I don't know if it's in items parameters
                    there is something wrong because it's working fine with zabbix_get tool in command line
                    and in zabbix_agentd.log (Zabbix_Agentd_Log_UserParameter_Resultwith_Zabbix _Agent_Active.txt) :
                    we can see that shell script extract text correctly but on server side ... issue
                    or maybe in shell script I should have only one text line instead of several line retreived
                    but why its 'not working for OPTION_STRING5 that show one number, i don't know
                    or may something is wrong in my item parameter ?

                    Hope it was easy to understand sorry for some english mistake


                    I hope a solution exist for this because I need to monitor many applications log file.

                    Many Thanks again.

                    Have a nice day.

                    Bertrand39100.
                    Attached Files

                    Comment

                    • dima_dm
                      Senior Member
                      • Dec 2009
                      • 2697

                      #11
                      You can check simple UserParameter
                      UserParameter=STRING_OPTION6,echo 1
                      It is work?
                      Try to specify a full path for egrep util.
                      Last edited by dima_dm; 20-01-2011, 09:17.

                      Comment

                      • Bertrand39100
                        Junior Member
                        • Feb 2010
                        • 27

                        #12
                        Hi Dima DM,

                        Sorry for the late answer, I was busy with new storage system installation.

                        According you told me, I defined because I'm not sure If I should use item with Zabbix agent or Zabbix agent (active) :

                        ## Parameters
                        #UserParameter=STRING_OPTION1,egrep "option" /test31_logmon/tcsd.conf
                        #UserParameter=STRING_OPTION2,egrep "option" /test31_logmon/tcsd.conf | awk '{print $2}'
                        #UserParameter=STRING_OPTION3,egrep "option" /test31_logmon/tcsd.conf | awk '{print $1 $2}'
                        #UserParameter=STRING_OPTION4[*],egrep -i "option" /test31_logmon/tcsd.conf|sed 's/.*\t//'
                        #UserParameter=STRING_OPTION5,egrep "option" /test31_logmon/tcsd.conf | awk '{print $2}' | wc -l

                        UserParameter=TEST6_USERPARAM,echo 6
                        UserParameter=TEST6_USERPARAM_ACTIVE,echo 6A
                        UserParameter=TEST7_USERPARAM,echo 7
                        UserParameter=TEST7_USERPARAM_ACTIVE,echo 7A
                        UserParameter=TEST8_USERPARAM,echo 8
                        UserParameter=TEST8_USERPARAM_ACTIVE,echo 8A

                        UserParameter=TEST9_USERPARAM,/bin/egrep "option" /test33_logmon/tcsd.conf
                        UserParameter=TEST9_USERPARAM_ACTIVE,/bin/egrep "option" /test33_logmon/tcsd.conf
                        UserParameter=TEST10_USERPARAM,/bin/egrep "option" /test33_logmon/tcsd.conf | awk '{print $2}' | wc -l
                        UserParameter=TEST10_USERPARAM_ACTIVE,/bin/egrep "option" /test33_logmon/tcsd.conf | awk '{print $2}' | wc -l
                        ## End Parameters

                        Item 6 : TEST6_USERPARAM Type : Zabbix Agent Key : TEST6_USERPARAM Type : Text Update Interval : 60 History : 7
                        Item 7 : TEST6_USERPARAM_ACTIVE Type : Zabbix Agent (active) Key : TEST6_USERPARAM_ACTIVE Type : Text Update Interval : 60 History : 7
                        Item 8 : TEST7_USERPARAM Type : Zabbix Agent Key : TEST7_USERPARAM Type : Character Update Interval : 60 History : 7
                        Item 9 : TEST7_USERPARAM_ACTIVE Type : Zabbix Agent (active) Key : TEST7_USERPARAM_ACTIVE Type : Character Update Interval : 60 History : 7
                        Item 10 : TEST8_USERPARAM Type : Zabbix Agent Key : TEST8_USERPARAM Type : Numeric (unsigned) / Data type : decimal
                        Item 11 : TEST8_USERPARAM_ACTIVE Type : Zabbix Agent (active) Key : TEST8_USERPARAM_ACTIVE Type : Numeric (unsigned) / Data type : decimal
                        Units : "empty" Units Multiplier : "Do not use" Update Interval : 60 History : 7 Trends : 0 Store Value : "As is" Show value : "As is"

                        Item 12 : TEST9_USERPARAM Type : Zabbix Agent Key : TEST9_USERPARAM Type : Character Update Interval : 60 History : 7
                        Item 13 : TEST9_USERPARAM_ACTIVE Type : Zabbix Agent (active) Key : TEST9_USERPARAM_ACTIVE Type : Character Update Interval : 60 History : 7
                        Item 14 : TEST10_USERPARAM Type : Zabbix Agent Key : TEST10_USERPARAM Type : Character Update Interval : 60 History : 7
                        Item 15 : TEST10_USERPARAM_ACTIVE Type : Zabbix Agent (active) Key : TEST10_USERPARAM_ACTIVE Type : Character Update Interval : 60 History : 7

                        Trigers :

                        TRIG_TEST6_USERPARAM : {adm1.fc-sante.priv:TEST6_USERPARAM.last(0)}#0 / warning
                        TRIG_TEST6_USERPARAM_ACTIVE : {adm1.fc-sante.priv:TEST6_USERPARAM_ACTIVE.last(0)}#0 / high
                        TRIG_TEST7_USERPARAM : {adm1.fc-sante.priv:TEST7_USERPARAM.last(0)}#0 / warning
                        TRIG_TEST7_USERPARAM_ACTIVE : {adm1.fc-sante.priv:TEST7_USERPARAM_ACTIVE.last(0)}#0 / high
                        TRIG_TEST8_USERPARAM : {adm1.fc-sante.priv:TEST8_USERPARAM.last(0)}#0 / warning
                        TRIG_TEST8_USERPARAM_ACTIVE : {adm1.fc-sante.priv:TEST8_USERPARAM_ACTIVE.last(0)}#0 / high
                        TRIG_TEST9_USERPARAM : {adm1.fc-sante.priv:TEST9_USERPARAM.str(option)}=1 / warning
                        TRIG_TEST9_USERPARAM_ACTIVE : {adm1.fc-sante.priv:TEST9_USERPARAM_ACTIVE.str(option)}=1 / high
                        TRIG_TEST10_USERPARAM : {adm1.fc-sante.priv:TEST10_USERPARAM.last(0)}>1 / warning
                        TRIG_TEST10_USERPARAM_ACTIVE : {adm1.fc-sante.priv:TEST10_USERPARAM_ACTIVE.last(0)}>1 / high


                        Please find below the result in two attached Log files.

                        I ran two tests ; first has been made with all items with zabbix_agent on the second one with zabbbix_agent (active).

                        MANY THANKS.

                        I don't know how to say "Thanks you very much and Many thanks for all" in Russian but

                        Have a nice day.

                        Bertrand39100.
                        Attached Files

                        Comment

                        Working...