Ad Widget

Collapse

Log File Trigger With Latest Beta

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matt_voss
    Junior Member
    • Dec 2005
    • 4

    #1

    Log File Trigger With Latest Beta

    Although the item log[XXX] is working fine and storing info in the history_log database table - I am wondering how to setup a trigger for the log file.

    I tried using the str(XXX) but that did not appear to work - can anyone give me an example of a valid trigger on a log file?

    FYI I've tried syntax such as this:

    {hostnameX:log[/var/log/rsync.log].str(writefd)}=1
    {hostnameX:log[/var/log/rsync.log].str(writefd)}=0

    Thanks!
    Last edited by matt_voss; 28-12-2005, 19:53.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    No trigger functions are supported for log files yet. It will be introduced in 1.1beta5.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • matt_voss
      Junior Member
      • Dec 2005
      • 4

      #3
      Any additional docs to get log files working now in beta5?

      BETA5 accepts the trigger but it appears to take forever reading the log file [I.E. I don't know how long it will take (days?) to read the long log file and go to the end where I care about].

      It would be more ideal to do a tail -f type of thing then read in the entire log file - is that part of the feature set but I'm not just aware of how to use it yet?

      Thanks!

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        When you start monitoring a log file, ZABBIX agent sends the whole file to the server and then basically does tail -f.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • Wolfgang
          Senior Member
          Zabbix Certified Trainer
          Zabbix Certified Specialist
          • Apr 2005
          • 116

          #5
          Originally posted by Alexei
          When you start monitoring a log file, ZABBIX agent sends the whole file to the server and then basically does tail -f.

          Given a log filesize of about 500kByte and an intervall of 60sec per host.
          Would that mean that each client sends every 60sec 500kByte logfile to the sever?

          If this is the case:
          - I suspect (without having tried this), that it will break for example low-bandwith vpn/wan connections.
          - An idea to solve this would be to store the filepointer of the last read on the client. This way only the diffs to the prevoius check would be transmitted.
          However, one would have to manage logrotation. For example i use amavis-stats which works this way. If the filesize of the logfile is smaller than on the previous check, amavis-stats looks for the archived rotated file instead.
          http://www.intellitrend.de
          Specialised in monitoring large environments and Zabbix API programming.

          Comment

          • Alexei
            Founder, CEO
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Sep 2004
            • 5654

            #6
            In fact the interval does not affect anything for log file's items. Not that:

            1. ZABBIX agent does not send more than 5 lines of log file per second. This is kind of protection from overloading.
            2. Last check (file size) is stored on the server
            3. Log rotation is supported
            Alexei Vladishev
            Creator of Zabbix, Product manager
            New York | Tokyo | Riga
            My Twitter

            Comment

            • Wolfgang
              Senior Member
              Zabbix Certified Trainer
              Zabbix Certified Specialist
              • Apr 2005
              • 116

              #7
              Thank you. New question came up

              1. ZABBIX agent does not send more than 5 lines of log file per second. This is kind of protection from overloading.
              I just did a grep -c 1 /var/log/mail.info.0 on my linux mailserver. It returned
              13939 lines.
              Would that mean it would take 13939 / 5 = 2787 seconds to get it transfered to the zabbix-server?

              And how would it scale if i would monitor also the auth.log or any other logfile like xferreport.log, even on more hosts?

              Thanks Wolfgang
              http://www.intellitrend.de
              Specialised in monitoring large environments and Zabbix API programming.

              Comment

              • Alexei
                Founder, CEO
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Sep 2004
                • 5654

                #8
                Originally posted by Wolfgang
                I just did a grep -c 1 /var/log/mail.info.0 on my linux mailserver. It returned
                13939 lines.
                Would that mean it would take 13939 / 5 = 2787 seconds to get it transfered to the zabbix-server?

                And how would it scale if i would monitor also the auth.log or any other logfile like xferreport.log, even on more hosts?
                Actually ZABBIX transfers no more than 10 lines per second, not 5. It doesn't change much though.

                Yes, it would take 2787/2 seconds to get it transferred. The limit is a result of currently used approach: send one line per each TCP connection. As soon as we completely move to a new XML-based communication protocol the limit will be eliminated, i.e. raised to tens of KB per second.
                Alexei Vladishev
                Creator of Zabbix, Product manager
                New York | Tokyo | Riga
                My Twitter

                Comment

                • Wolfgang
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified Specialist
                  • Apr 2005
                  • 116

                  #9
                  Originally posted by Alexei
                  ...As soon as we completely move to a new XML-based communication protocol the limit will be eliminated, i.e. raised to tens of KB per second.
                  I see. However even then, it would require the bandwith and might run in congestions like in the example given for a WAN or VPN connect.

                  How do you think about the approach to do the "sort of tail" on the client side.
                  This way, the traffic over the net would be certainly less.

                  However, to store the last filepos on the client would allow to cheat the NMS system. Not so good.

                  A way around this would be to store the filepos of the last check on the server and pass it back to the client on the next request. This in turn might require an entire different logic though...

                  What do you think?
                  http://www.intellitrend.de
                  Specialised in monitoring large environments and Zabbix API programming.

                  Comment

                  • Alexei
                    Founder, CEO
                    Zabbix Certified Trainer
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Sep 2004
                    • 5654

                    #10
                    Originally posted by Wolfgang
                    How do you think about the approach to do the "sort of tail" on the client side.
                    This way, the traffic over the net would be certainly less.
                    It is already implemented as the "sort of tail" on the client side. The agent connects to the ZABBIX server on startup, gets the latest positions and then works in standalone mode. There are no overhead in communication protocol.
                    Alexei Vladishev
                    Creator of Zabbix, Product manager
                    New York | Tokyo | Riga
                    My Twitter

                    Comment

                    • Wolfgang
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified Specialist
                      • Apr 2005
                      • 116

                      #11
                      My appologise

                      I think i really got you wrong when i read this.
                      Originally posted by Alexei
                      When you start monitoring a log file, ZABBIX agent sends the whole file to the server and then basically does tail -f.
                      I understood that the the client would pass the entire log _every_ time to the server and then the server would perform a sort of tail on the received data.

                      Originally posted by Alexei
                      It is already implemented as the "sort of tail" on the client side. The agent connects to the ZABBIX server on startup, gets the latest positions and then works in standalone mode. There are no overhead in communication protocol.
                      Now it seems to me, that the client passes the entire only once to the server. After that, only updates of the logfile are passed from the client to the server.

                      So the initial transfer might take it time - but only one first time.
                      Is this correct?
                      http://www.intellitrend.de
                      Specialised in monitoring large environments and Zabbix API programming.

                      Comment

                      • Alexei
                        Founder, CEO
                        Zabbix Certified Trainer
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Sep 2004
                        • 5654

                        #12
                        Originally posted by Wolfgang
                        So the initial transfer might take it time - but only one first time.
                        Is this correct?
                        Absolutely!
                        Alexei Vladishev
                        Creator of Zabbix, Product manager
                        New York | Tokyo | Riga
                        My Twitter

                        Comment

                        Working...