Dear all,
Zabbix version : 2.4 (yes, I know, upgrading soon - honest)
Server OS version : CentOS 6, 64-bit (CentOS 7 with the Zabbix upgrade)
I've got a large log file that I would like to read by an external process. It's basically the same as reading the item value on a web-page. I have tried to create an item for
vfs.file.contents[/path/to/log]
but it fails because the log is too large. I know that there are log item types and vfs.file.regex where I can specify the start & end lines, but being a log file I won't know the line count to set the start line value. I'm going round in circles with documentation, probably because I'm misunderstanding what it is telling me.
It is likely that a key of
log[/path/to/log,something,or,other]
may help. I don't want to keep a lot, just the last line every now and then. I've tried with
log[/path/to/log,,,,skip]
and other variations without success. My process to pick it up just comes back with unknown item. Trying to set the start line to $
of -1
doesn't seem to help me.
Can anyone send me in the right direction to get the last line of a simple text file recorded as a Zabbix item. I don't want to graph it because it will be text such as a timestamp and message. I just want to be able to use Zabbix to collect it. The item would be in a template and I can write something to read the items in rather than have to set up SSH keys all over the place and collect them by shell script. I'd rather not have to set up all sorts of extra spaghetti each time we create a new server, just give it the Zabbix template and extend the list of servers in my script that knows which servers should have the log file. We need to keep track that processing is running normally and last run timestamp, status, messages etc. The process that creates the log file is not available to us, else I would get it to "append log" all messages as it does now and overwrite log each messages to a separate file so that there would be just a single record in the second file.
Pass the dunce's hat. :o
Thanks, in advance,
Robin