Page 1 of 1

Taking Metrics from Log files

Posted: Wed Aug 14, 2013 11:07 am
by disrael
Is there a way to obtain custom metrics from a log file and out put it into a graph in Nagios?

-Doron

Re: Taking Metrics from Log files

Posted: Wed Aug 14, 2013 11:23 am
by abrist
This would probably require a custom plugin script as most of the check_log type of plugins just check for a string match. What type of metrics are you looking for? (number of times a line appears, a specific value on a recurring line, etc)

Re: Taking Metrics from Log files

Posted: Wed Aug 14, 2013 12:32 pm
by disrael
I am taking in data from every line and putting the number that is in each line into a Nagios graph. I am trying to see if we can use Nagios to replace one of our applications that has a sub par interface.

-Doron

Re: Taking Metrics from Log files

Posted: Wed Aug 14, 2013 12:38 pm
by abrist
Nagios can definitely do this, though it would have to be a custom script. Do you want to re-parse the whole log everytime (create an aggregate or average) for your value, or just the newest line? Can you afford to miss some lines here and there? (in between scheduled checks)

Re: Taking Metrics from Log files

Posted: Wed Aug 14, 2013 2:27 pm
by disrael
Is there a script or plugin that you could recommend that I could use a reference?

Re: Taking Metrics from Log files

Posted: Wed Aug 14, 2013 2:35 pm
by slansing
There are quite a large number of log file checking and parsing plugins located here:

http://exchange.nagios.org/index.php?op ... log%20file