Options to automate plugin addition and service
Posted: Sat Nov 30, 2019 12:05 pm
I have a plugin that I need to deploy across all monitoring environments. I would like to automate the following:
Add the check_snmp_cisco_bgp.pl plugin to nagios. Since the API does not have a way to add plugins, would it be as simple as uploading the check_snmp_cisco_bgp.pl file to /usr/local/nagios/libexec/ or is some additional configuration required to register that plugin? If so, can the registration be handled automatically as well with running a command or modifying a file?
I believe the API will allow me to build a new command using that plugin so I think that part is OK.
Finally, I would need to create a new service check using that new command/plugin for existing devices. Today we have to copy one of the existing services and modify it with the new command. While I know that you can use the API for a service, how would I be able to match the existing hostname for that service to add an additional check in automation? Is there a way to do a lookup of the hostname configured via Ansible so that the new service gets added to the correct host? Here is an example.
Config Name BM-QUARRY-H1A-ASE has 9 services being checked. I want to add an addition BGP check to that Config Name. I can send API calls via Ansible to create the service and I can have Ansible pull information from the device as well. How can I get Ansible to pull the Config Name (and loop through all Config Names) to add this new BGP check to all devices?
Thanks!
Add the check_snmp_cisco_bgp.pl plugin to nagios. Since the API does not have a way to add plugins, would it be as simple as uploading the check_snmp_cisco_bgp.pl file to /usr/local/nagios/libexec/ or is some additional configuration required to register that plugin? If so, can the registration be handled automatically as well with running a command or modifying a file?
I believe the API will allow me to build a new command using that plugin so I think that part is OK.
Finally, I would need to create a new service check using that new command/plugin for existing devices. Today we have to copy one of the existing services and modify it with the new command. While I know that you can use the API for a service, how would I be able to match the existing hostname for that service to add an additional check in automation? Is there a way to do a lookup of the hostname configured via Ansible so that the new service gets added to the correct host? Here is an example.
Config Name BM-QUARRY-H1A-ASE has 9 services being checked. I want to add an addition BGP check to that Config Name. I can send API calls via Ansible to create the service and I can have Ansible pull information from the device as well. How can I get Ansible to pull the Config Name (and loop through all Config Names) to add this new BGP check to all devices?
Thanks!