Taking Metrics from Log files

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
disrael
Posts: 116
Joined: Tue Jun 19, 2012 3:16 pm

Taking Metrics from Log files

Post by disrael »

Is there a way to obtain custom metrics from a log file and out put it into a graph in Nagios?

-Doron
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Taking Metrics from Log files

Post 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)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
disrael
Posts: 116
Joined: Tue Jun 19, 2012 3:16 pm

Re: Taking Metrics from Log files

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Taking Metrics from Log files

Post 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)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
disrael
Posts: 116
Joined: Tue Jun 19, 2012 3:16 pm

Re: Taking Metrics from Log files

Post by disrael »

Is there a script or plugin that you could recommend that I could use a reference?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Taking Metrics from Log files

Post 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
Locked