nagios_parser icon indicating copy to clipboard operation
nagios_parser copied to clipboard

Issues with large status files

Open cpuguy83 opened this issue 13 years ago • 2 comments

Parsing takes a huge amount of time (and by huge I mean a few seconds) with even a medium size status file.

One thing I'm wanting to use this for is pulling in the nagios status to a custom monitoring interface. Right now I'm using Merlin to write host/service/status info to a database and reading from there using ActiveRecord, however have had issues moving this (Merlin) to a new system.

Would be nice if I could pass in an argument to for host statuses, or status for a certain host, or for a service on a host, grep the file, then parse. I think this might make it a bit better for quick fetching for a web view... just a thought, not sure if it would work.

cpuguy83 avatar Oct 19 '11 15:10 cpuguy83

Yes, it's pretty slow. :( It's even slower on jruby and rubinius. (I guess because of racc issues)

You are probably better off with using regex to parse the status file. I might look into alternative parser generators in the future to see if they are faster. (like parslet)

bernd avatar Oct 22 '11 11:10 bernd

I did start doing this, actually. Works pretty quickly except for when I try to actually initialize each status entry as a ruby object it slows it down to almost the same speed, unfortunately.

cpuguy83 avatar Oct 24 '11 14:10 cpuguy83