nagios_parser
nagios_parser copied to clipboard
Issues with large status files
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.
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)
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.