As our monitoring environments become increasingly more dynamic, automation strategies have gone from “nice to have” to “must have.” With hybrid environments comprising both cloud and on-premise deployments, responsive environments that need to scale rapidly both up and down, or even specialized off-line environments, automation tools and techniques can make the difference between keeping up with the changes and falling behind.
Tip #1 – Launch new instances with agents pre-installed
Whether you are scaling up with AWS, VMWare, or some other infrastructure rationale, the best time to configure your new hosts for monitoring is before they even launch. Get NCPA (Nagios Cross-Platform Agent) onto your AMI, OVA, or VHD pre-configured for both the services to be monitored and the IP address or FQDN of your Nagios monitoring server. Don’t forget to pre-configure syslog or eventlog to send to your Nagios Log Server cluster.
Tip #2 – Use the Nagios XI API to programmatically add hosts
For sure, the Nagios XI GUI makes configuration fast and simple, but there’s no faster way to add hosts on your Nagios server than with the API. Anything you can configure in Nagios about a host or service – whether that is host group, parent/child relationship, contents, action URL – can be specified in your API call. Need documentation? It’s already in the Nagios XI interface in the Help pages!
Tip #3 – Put Ansible (or Puppet or Chef or Salt or ….) to work for you
When it comes to deploying servers or software or configurations, nothing beats automation software. Especially for those people implementing Nagios in a mid- to large-scale environment, Ansible or similar software can make the initial deployment of agents and configurations a snap. Need to run the Nagios Log Server set-up script on 200 hosts? With automation software, you can be done in minutes instead of hours. How about deploying NCPA to 200 different servers with different operating systems or versions? Automation software can account for different operating systems and make sure the right packages get installed.
What tips do you have?