I don't honestly blame them but I wanted a project to force me to learn Ruby better and I had a specific need. I could have this written already in Perl or even straight Bash but, again, I wanted to learn Ruby better.
As I said in my other post, here are the design goals starting out:
- Import existing configs (objects only. Not concerned about the operational parameters)
- Parse existing objects (apart from reading the configurations)
- Create objects (hosts,services,contacts, *groups, etc...)
- Write new configs
- Enforce/Support Templating
At my new company, they are BIG on automation. I mean EVERYTHING is automated from an SA perspective. The only exception comes with NEW environments. This is still a mishmash of manual processes and checklists with a slathering of the above automation. One of my first things I was tasked with when I walked through the door was to modernize the existing Nagios configuration. This project is part of that. I need to integrate anything I do seamlessly into the existing automation for it to be accepted as process.
So consider this a "declaration of intent to proceed" or somesuch politispeek. Feel free to comment on my lack of Ruby skill and where you think I can change things.
Here's the code I have so far: