> Has anyone created an object file parser for Nagios in perl yet? I'm working
> on an alternative interface for Nagios configuration, and I'll need to write
> one. I am just trying not to reinvent the wheel.
It wouldn't be too hard to generalize the object-parsing code I wrote in
my batch_by_ssh script:
http://www.midwinter.com/~koreth/nagios/batch_by_ssh
In particular look at the slurpObjectConfig and slurpObject functions.
They have code to handle templates (which I use extensively in my
installation). Right now the code throws away objects that aren't of
interest to the rest of the script, but it'd be easy to make it cache
them in a hash and pull them out as needed.
Hopefully the code is pretty easy to follow. I tried to err on the
side of clarity rather than compactness.
-Steve
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: koreth-nagios@midwinter.com