1

Simple example: I have a logfile in C:\users\user\test.log, containing a line of text:

crit

I have check_mk_agent.exe installed in Program Files (x86)\check_mk, with check_mk.ini installed in the same folder, containing this text:

[logfiles]
    # # Define textfiles to be monitored, separated by |
    # textfile = C:\tmp logfiles\message_*.log|D:\log\sample.txt
    # # Set patterns for defined textfiles
    # ok = Successfully logged in*
    # crit = Error in*
    # warn = Unable to contact*
    # ignore = Backup * saved

    textfile = C:\users\user\test.log
    warn = *
    crit = crit
    ok = ok

This is supposed to return OK if the line reads "ok", or CRIT if the line reads "crit", or WARN otherwise.

However, it doesn't report any status at all. If I run check_mk_agent.exe test (similarly for debug), I get these lines, suggesting it has found the textfile OK, but is not reporting a status for it:

( ... )
<<<logwatch>>>
[[[C:\users\user\test.log]]]
<<<>>>

<<<>>>
<<<local>>>
( ... )

Can anyone help me get it working? I am not an expert with Check MK, and this is pushing the limits of my knowledge.

mwfearnley
  • 816
  • 1
  • 11
  • 22
  • The agent test doesn't show staus. Do an inventory at the server and see if it works. – Diamond Jan 05 '16 at 22:57
  • Is there an easy way to get the status from the agent? OMD finds the service, but reports "no error messages" for it. – mwfearnley Jan 06 '16 at 09:08
  • Well, there are two things: first, your need to change `warn = *` to something else, as * will match any text and you will get always warn status. Second, add some more lines at the test file so that it gets updated and see. The check_mk agent read the files everytime new entry is addedd. From web frontend if you click on the `Open Log` (typewriter button) for the host, you can see what log data is read by the agent. – Diamond Jan 06 '16 at 09:43

1 Answers1

1

The check_mk agent test run doesn't show services status (ok,crit etc.), so what you are seeing is correct. It actually shows that the new configuration is loaded successfully. To see it in action, run a new inventory at the check_mk server to get the new service listed.

Now there are two things:

  • First, you need to change the warn = * to something else, as * will match anything and you will get always warn status.
  • Second, add some more lines at the test log files and see if the status changes. The check_mk agent reads the file and get the updated info when new entries are addedd. From web frontend if you click on the Open Log (typewriter button next to the service name) for the service, you can see what log data is read by the agent. There you will also be able to see if it is getting updated or not.
Diamond
  • 9,001
  • 3
  • 24
  • 38