More automation help needed
Posted: Fri Apr 01, 2016 12:46 pm
Posted a previous thread a while back about using the REST API (it's here if you're curious: https://support.nagios.com/forum/viewto ... 16&t=37510 )
Still trying to figure out a workaround to this - Here's my situation:
We currently have an AWS account where we spin up and burn down tens of VMs every day. Most of the new hosts need to be added to Nagios and most of the VMs burned down need to be removed from Nagios. Currently, the way we've been adding the hosts is to bulk host clone and import and removing them is a pain in the a$$ (delete the services, then delete the hosts).
So my thought was to generate a config file for every host that is spun up and send that config file to the Nagios server in the /usr/local/nagios/etc/import directory and then when we do an Apply Config, it would pick up the hosts (along with the services assigned to the host group). I've got the script and transfer the file to Nagios part working.
Where I'm struggling is trying to figure out how to add these hosts to a host group that inherit the pre-determined services for that particular VM type where each host has a predefined group based on function (some use apache, some use java, some use MySQL, etc, etc, etc and that's how we group them). Most of the hosts share the same types of checks, but each have specific checks added based on what they do.
For whatever reason, I'm truly not understanding the OO piece of setting up a host group with services... Maybe I'm just making it way harder than I need to?
Is there a step-by-step tutorial on setting this up? Or can someone walk me through this?
Still trying to figure out a workaround to this - Here's my situation:
We currently have an AWS account where we spin up and burn down tens of VMs every day. Most of the new hosts need to be added to Nagios and most of the VMs burned down need to be removed from Nagios. Currently, the way we've been adding the hosts is to bulk host clone and import and removing them is a pain in the a$$ (delete the services, then delete the hosts).
So my thought was to generate a config file for every host that is spun up and send that config file to the Nagios server in the /usr/local/nagios/etc/import directory and then when we do an Apply Config, it would pick up the hosts (along with the services assigned to the host group). I've got the script and transfer the file to Nagios part working.
Where I'm struggling is trying to figure out how to add these hosts to a host group that inherit the pre-determined services for that particular VM type where each host has a predefined group based on function (some use apache, some use java, some use MySQL, etc, etc, etc and that's how we group them). Most of the hosts share the same types of checks, but each have specific checks added based on what they do.
For whatever reason, I'm truly not understanding the OO piece of setting up a host group with services... Maybe I'm just making it way harder than I need to?
Is there a step-by-step tutorial on setting this up? Or can someone walk me through this?