Ad Widget

Collapse

Item log[]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinny
    Senior Member
    • Jan 2008
    • 145

    #1

    Item log[]

    I searched around the posts and did not find a lot of answers.

    server 1.6
    item Active
    type Log
    key log[/data/toto.log,^.*titi.*$]

    Latest data : "Accessible only as active check"
    agent : 1.4.5

    there are a lot of active checks working with this agent.

    Does someone has an idea ?

    vinny
    -------
    Zabbix 1.8.3, 1200+ Hosts, 40 000+ Items...zabbix's everywhere
  • chyaroslav
    Junior Member
    • Jun 2008
    • 8

    #2
    The same problem

    I have the same problem when tryed to monitor logfile. When i have verifyed zabbix_agentd.log i found some strings:
    16729:20090115:165359 Requested [log[/var/adm/messages,error]]
    16729:20090115:165359 Sending back [Accessible only as active check!]
    Active check are enabled in zabbix_agentd.conf and Hostname filled correctly, But it didn`t work...

    Comment

    • chyaroslav
      Junior Member
      • Jun 2008
      • 8

      #3
      problem not solved

      Has anybody successfully configured logfile monitoring?
      May be Alexey comment situation with "Accessible only as active check!" when trying to monitor logfile?

      Comment

      • albertxiao
        Junior Member
        • Dec 2008
        • 16

        #4
        I can get the log file monitor.
        For the Item, you need to configure like this
        Type: ZABBIX agent (active)
        Key: log[/var/adm/messages,error]
        Type of Information: Log

        Make sure the file can be access by all.

        Comment

        • ashuji
          Member
          • Dec 2008
          • 35

          #5
          Log Monitor: not working

          Hi

          I am also facing somewhat similar problem, I configured zabbix ITEM as below:

          ITEM NAME: MYSQL_ERRORs
          TYPE: Zabbix agent (Active)
          KEY: log[/tmp/mysql.err,ERROR]
          Type of Information: Log
          Interval: 1 sec.

          This item captures nothing even if we append line with work ERROR in the log file.

          As per my understanding, this item should return the lines containing work 'ERROR'.

          Please help if somebody has configured such log monitoring.

          Thanks & regards

          Ashwani Jain

          Comment

          • Calimero
            Senior Member
            • Nov 2006
            • 481

            #6
            In zabbix_agentd.conf, you must set the hostname (same case as the hostname given to zabbix_server/DB).

            If you have multiple zabbix servers, the first IP listed in the Server= configuration value in zabbix_agentd.conf is the server for active checks.

            Make sure user 'zabbix' (or whatever user zabbix_agentd is running as) has read access to the log file.
            Try restarting zabbix_agentd. Make sure the item is not disabled or not supported on the server. Try disabling/enabling the item.

            Comment

            • ashuji
              Member
              • Dec 2008
              • 35

              #7
              Tried everything

              I have only one Zabbix server and several hosts to be monitored. IP of Zabbix server is 192.168.90.98 so in the zabbix_agent.conf has following configuration:

              Server=192.168.90.98

              Disabled/Enabled that ITEM, created new ITEM with similar key but still that ITEM is not able to trap the ERROR in the log file.

              There seems to be some bug in zabbix.

              Please suggest if you have some solutions.

              Thanks & regards

              Ashwani jain

              Comment

              • Calimero
                Senior Member
                • Nov 2006
                • 481

                #8
                What version of the agent are you using ? and the server ?

                What if you remove the regexp/filter ("ERROR") ?
                Are you sure the hostname configured in zabbix_agentd.conf stricly matches the hostname configured in zabbix_server/DB (this is case-sensitive). Same goes with the key name, hence the path to the file.

                Comment

                • ashuji
                  Member
                  • Dec 2008
                  • 35

                  #9
                  Yes

                  Here below is the info:

                  Zabbix Server:


                  Zabbix Server:
                  # zabbix_server -V
                  ZABBIX Server (daemon) v1.6.2 (16 January 2009)
                  Compilation time: Feb 11 2009 02:00:57

                  Hosntame:

                  # hostname
                  zabbix1


                  # ifconfig | grep 192
                  inet addr:192.168.90.98 Bcast:192.168.90.255 Mask:255.255.255.0
                  inet addr:192.168.91.99 Bcast:192.168.91.255 Mask:255.255.255.0

                  (Primary IP is 192.168.90.98, other client are communicating with zabbix server on this IP only)


                  ZABBIX AGENT (monitored host)


                  Zabbix Agent:
                  # /usr/local/zabbix/sbin/zabbix_agent -V
                  ZABBIX Agent v1.4.6 (23 July 2008)
                  Compilation time: Sep 4 2008 13:20:42

                  # hostname
                  web1

                  # ifconfig | grep 192
                  inet addr:192.168.90.12 Bcast:192.168.90.255 Mask:255.255.255.0


                  zabbix_server.conf and zabbix_agent.conf are attached herewith for your kind perusal.

                  Regards

                  Ashwani jain
                  Attached Files

                  Comment

                  • Calimero
                    Senior Member
                    • Nov 2006
                    • 481

                    #10
                    You must set the hostname in zabbix_agentd.conf. I'm not talking about the system hostname.

                    Hostname=myhost

                    The value you set must strictly match (case-sensitivity !) the value given on zabbix_server when you created the host. The restart the agent and it should be OK (or you may disable the item, enable it again and then restart the agent).

                    Comment

                    • ashuji
                      Member
                      • Dec 2008
                      • 35

                      #11
                      Tried

                      Thanks for the quick reply, i tried this also but its not solving problem:

                      added below line in zabbix_agent.conf of monitored host:

                      Hostname=web1


                      restarted service xinetd.

                      Disabled/Enabled ITEM.

                      restarted service xinetd.

                      appended few lines in log files with word ERROR.

                      Than checked History of ITEM, it did not return any value in that.

                      Again restarted xinetd, appended few more lines in log file with word ERROR

                      Again if I check history of ITEM, nothing appears in it.

                      Comment

                      • Calimero
                        Senior Member
                        • Nov 2006
                        • 481

                        #12
                        I don't think zabbix_agent supports active checks as it is run "on demand" by inetd.

                        zabbix_agentd on the other hand runs as a daemon and can collect and send data to zabbix_server without being "polled" in the first place.

                        I didn't notice you were using zabbix_agent which is quite unusual for me.

                        Comment

                        • ashuji
                          Member
                          • Dec 2008
                          • 35

                          #13
                          Zabbix Agentd also not working...

                          Hi

                          Thanks for your quick replies, I removed config of zabbix_agent from xinetd and installed zabbix_agentd (config file attached). I started this daemon and then disabled/enabled the ITEM, but still nothing being captured by this zabbix ITEM. I also removed key word ERROR and used following key:

                          log[/tmp/test.log]

                          Still nothing being captured in ITEM while this log file is being appened with a line bearing word ERROR every 5 seconds.

                          Kindly suggest.

                          Regards

                          Ashwani Jain
                          Attached Files

                          Comment

                          • Calimero
                            Senior Member
                            • Nov 2006
                            • 481

                            #14
                            What if you turn debuging on, on both zabbix_agentd and zabbix_server ?

                            Hostname "SANDBOX2" is the right case ?

                            Does zabbix have read access to the log file ?

                            On the server, item time is declared as "Agent (Active)"?
                            Type of information = Log ? Update interval: 1 sec ?

                            Comment

                            • ashuji
                              Member
                              • Dec 2008
                              • 35

                              #15
                              Replies to queries:

                              What if you turn debuging on, on both zabbix_agentd and zabbix_server ?
                              I turned on debugging but nothing explicit appears in log file, following are the contents of log file:


                              zabbix_agentd [2493]: zabbix_agentd started. ZABBIX 1.4.4.
                              zabbix_agentd [2494]: zabbix_agentd collector started
                              zabbix_agentd [2495]: zabbix_agentd listener started
                              zabbix_agentd [2496]: zabbix_agentd listener started
                              zabbix_agentd [2497]: zabbix_agentd listener started
                              zabbix_agentd [2498]: zabbix_agentd active check started [192.168.90.98:10051]
                              zabbix_agentd [2493]: ZABBIX Agent stopped
                              zabbix_agentd [3011]: zabbix_agentd started. ZABBIX 1.4.4.
                              zabbix_agentd [3012]: zabbix_agentd collector started
                              zabbix_agentd [3013]: zabbix_agentd listener started
                              zabbix_agentd [3014]: zabbix_agentd listener started
                              zabbix_agentd [3015]: zabbix_agentd listener started
                              zabbix_agentd [3016]: zabbix_agentd active check started [192.168.90.98:10051]



                              Hostname "SANDBOX2" is the right case ?

                              YES, this is correct hostname, I have started trying on another host, please check below command:

                              # hostname
                              SANDBOX2



                              Does zabbix have read access to the log file ?

                              yes, zabbix user can read the log file:


                              [zabbix@SANDBOX2 ~]$ tail /tmp/zabbix_agentd.log
                              zabbix_agentd [2496]: zabbix_agentd listener started
                              zabbix_agentd [2497]: zabbix_agentd listener started
                              zabbix_agentd [2498]: zabbix_agentd active check started [192.168.90.98:10051]
                              zabbix_agentd [2493]: ZABBIX Agent stopped
                              zabbix_agentd [3011]: zabbix_agentd started. ZABBIX 1.4.4.
                              zabbix_agentd [3012]: zabbix_agentd collector started
                              zabbix_agentd [3013]: zabbix_agentd listener started
                              zabbix_agentd [3014]: zabbix_agentd listener started
                              zabbix_agentd [3015]: zabbix_agentd listener started
                              zabbix_agentd [3016]: zabbix_agentd active check started [192.168.90.98:10051]




                              On the server, item time is declared as "Agent (Active)"?
                              Type of information = Log ? Update interval: 1 sec ?


                              YES, please check the attached image file.

                              Thanks & regards

                              Ashwani Jain
                              Attached Files

                              Comment

                              Working...