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.
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:
warn = *
to something else, as*
will match anything and you will get alwayswarn
status.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.