Ad Widget

Collapse

Trigger help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • asa1985
    Junior Member
    • Sep 2010
    • 16

    #1

    Trigger help

    I have a constant file.
    my file looks like this:

    doX_blob_Dlobs 54 OK
    doX_blob2 85 OK
    KDS 2 ERR
    temp 100 OK
    lietot_paz 13 OK
    dok_blob1 85 OK
    dok_zina_blobs 33 OK
    dok_zina3 9 ERR

    I need a trigger, a report on changes to the file.

    when there are changes to a file, for example, OK -> ERR

    my items look as follows: log ['home / YYY / test', 'ERR']

    Some one can help out with advice?
  • Tractorboy
    Member
    • Oct 2010
    • 98

    #2
    Log watcher

    I am trying the same.

    1) What is the log format for windows I have log["c:\logs\logfile.log","Error"...

    2) How what would a trigger look like.

    I cannot find anything documented.

    Once set up what is the method for testing that everything is correct, or it is permanent trial and error?

    Last edited by Tractorboy; 22-10-2010, 16:05. Reason: typo fix

    Comment

    • asa1985
      Junior Member
      • Sep 2010
      • 16

      #3
      1) my log format for unix is log[path,regexp]

      I also can not find anything in the documentation.

      Comment

      • mbrand5371
        Member
        • May 2009
        • 55

        #4
        Hi!

        I think the problem is, that the file has an fixed number of lines and is not written whis new lines.

        I've solved this with an "UserParameter" in "zabbix_agentd.conf"
        For your example:
        UserParameter=dokzina3.test,/bin/grep -c "dok_zina3 9 ERR" /file

        Then you only need an item which reads the UserParameter and an trigger which check's wether it is "1"

        Regards, Marcus

        Comment

        • asa1985
          Junior Member
          • Sep 2010
          • 16

          #5
          Hi, mbrand5371!

          Yes, that the file has an fixed number of lines and is not written whis new lines.

          UserParameter=dokzina3.test,/bin/grep -c "dok_zina3 9 ERR" /file

          you, can explain this UserParameter, how it works?

          Comment

          • mbrand5371
            Member
            • May 2009
            • 55

            #6
            Ok! A little bit more:

            UserParameter=dokzina3.test

            "dokzina3.test" is the Item-Key which you have to define in your Item.
            The Item-Type must be "zabbix agent"

            If you assing this Item to a Host, you can see a Value != "0" if "grep" found "dok_zina3 9 ERR".

            I've attached an Template example.
            Attached Files

            Comment

            • asa1985
              Junior Member
              • Sep 2010
              • 16

              #7
              Thank you, for help!!!
              I modified a bit and then it worked

              Comment

              Working...