Ad Widget

Collapse

log file monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tristan
    Senior Member
    • Feb 2008
    • 110

    #1

    log file monitoring

    I've got a problem with log file monitoring. I'm trying to monitor the content of a .txt file.

    The first time it works and it gives me a good result. When I change the content of the .txt file it won't update properly.

    For example, when I look at my monitoring this is what is says:
    Code:
    2008.Feb.26 14:55:58	8
    2008.Feb.26 14:54:58	2452525
    But when I look into my file it says 96786678.
    So it just shows the last number. It works when I restart the service each and every time. But thats not what I want.

    It has to check 8 txt files and they all come with the same problems. Its the same with numbers and letters.

    Could this be a problem with me manually editing these txt files? They normally get there input from a script which monitors our databases. But as I'm trying to test it I thought it might be smart to manually adjust them.

    Let me know, if there are any obscurities and I'll try to explain them.

    I'm running ZABBIX 1.4.4
    Last edited by Tristan; 26-02-2008, 16:23.
  • Tristan
    Senior Member
    • Feb 2008
    • 110

    #2
    Don't bother. We found another solution.
    In our case the smartest thing to do was UserParameters.

    Thanks for anyone who was thinking for me.

    Comment

    • jlares
      Zabbix Certified Specialist
      Zabbix Certified Specialist
      • Jun 2008
      • 3

      #3
      Hi, I need to read a txt file and find the word ERRROR

      Hi, How did you do to read the content of a file and put it into the zabbix_agentd.conf file UserParameters.

      For Example, My SQL Server creates a log file every day each time I backup it up a Database, so I need to read the log and find the word ERROR, how can I do that?

      Best Regards.

      Comment

      • Tristan
        Senior Member
        • Feb 2008
        • 110

        #4
        Hi,

        it's simple: create a userparameter:
        UserParameter=myuserparameter, grep -i /var/log/pathtomysqllog error

        in my case i use the following:

        UserParameter=recordupdates[*], grep -i "$2" $1
        with the following key:
        recordupdates[/opt/zabbix/test/promon.txt,Record Updates]

        were: $1 is the first argument and $2 the second.
        the big advantage is that you can push the filename and search item from the zabbix host. in the fist example you need to set them in your zabbix_agent.conf wich is a disadvantage if you have serveral different hosts.

        Comment

        Working...