Automated Host Management for MRTG services?
Automated Host Management for MRTG services?
I have been building towards using the processes in the Automated Host Management document in the Nagios XI Administrator Guide, but it looks like services for network routers and switches that use MRTG checks require some other process. How can I automate that MRTG process in a similar manner?
You do not have the required permissions to view the files attached to this post.
-
kyang
Re: Automated Host Management for MRTG services?
There's really no way to do this with routers/switches easily.
If they are almost similar then you could probably script the mrtg files and then it maybe would work.
Otherwise, the easiest and quickest way is to just run the wizard each time.
If they are almost similar then you could probably script the mrtg files and then it maybe would work.
Otherwise, the easiest and quickest way is to just run the wizard each time.
Re: Automated Host Management for MRTG services?
Running the wizard each time is not an automated solution. Also I noticed that when a host and its related services are deleted, either using automation or with CCM, that the MRTG files are not also deleted. In my view that is a product bug that should be fixed.
Re: Automated Host Management for MRTG services?
True, but in lieu of a proper solution stuff like PhantomJS and Selenium exists to tackle automating "the running of the wizards". Hardly ideal, but if it were my problem to solve that's how I'd do it. You'd need some sort of queuing/chunking mechanism to prevent thrashing the CCM and command subsystem though.DFaught wrote:Running the wizard each time is not an automated solution.
Part of this is a general disconnect between Configuration Wizards and the Core Config Manager. Step 1 is introducing functionality by which the CCM could identify objects installed via configuration wizards. Step 2 would be having "roll/unroll" or "install/uninstall" style steps included for each config object created by a config wizard (a sort of "uninstall/remove object" function in the wizard itself?). This would be better than a bolt-on "just MRTG stuff" fix because I know there's other wizards with such obstacles (WebInject comes to mind).DFaught wrote:Also I noticed that when a host and its related services are deleted, either using automation or with CCM, that the MRTG files are not also deleted. In my view that is a product bug that should be fixed.
Though a non-trivial problem to solve for sure, I think this would be good functionality and isn't terribly far-fetched in the age of "infrastructure as code".
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Automated Host Management for MRTG services?
Thank you for your reply. I have already built a Selenium-like solution (using Katalon Studio) but it does not solve the 2nd issue of the MRTG bits left lying around. Now I am looking at the long-term effects and maintainability of the web driver solution versus the "automation" approach. Neither is ideal.
-
kyang
Re: Automated Host Management for MRTG services?
Thanks @mcapra,
DFaught, There is currently a feature request in the works for "deleting a Host will delete the /etc/mrtg/conf.d/ cfg file".
DFaught, There is currently a feature request in the works for "deleting a Host will delete the /etc/mrtg/conf.d/ cfg file".
Re: Automated Host Management for MRTG services?
The more I look at this, the less I like it. Defining new hosts and related services for network switches/routers using the wizard does not allow for the possibility of using CCM templates for those hosts and services because this process fills in everything in the host or service configuration, overriding anything that might be specified in a related CCM template.
On the other hand, defining new hosts and related services using CCM and/or the process described in the Automated Host Management document does not allow building a network switch/router configuration that uses the MRTG data collection method.
I am trying to build an enterprise-class monitoring solution including hundreds of network devices and thousands of related services that is maintainable by others in a relatively vanilla fashion. What is the best way to accomplish that?
Thanks for any reasonable suggestions.
On the other hand, defining new hosts and related services using CCM and/or the process described in the Automated Host Management document does not allow building a network switch/router configuration that uses the MRTG data collection method.
I am trying to build an enterprise-class monitoring solution including hundreds of network devices and thousands of related services that is maintainable by others in a relatively vanilla fashion. What is the best way to accomplish that?
Thanks for any reasonable suggestions.
-
kyang
Re: Automated Host Management for MRTG services?
As of now, there is no way to do so with our wizard for MRTG services since it uses check_rrdtraf.
You could take a look at other plugins to accomplish this. (Creates MRTG services in a tmp directory or you can specify one in the plugin.) In line 143-ish in the plugin. my $TRAFFIC_FILE is the variable, if not it creates a tmp file to store MTRG data if it doesn't exist.
https://exchange.nagios.org/directory/P ... 64/details
You could take a look at other plugins to accomplish this. (Creates MRTG services in a tmp directory or you can specify one in the plugin.) In line 143-ish in the plugin. my $TRAFFIC_FILE is the variable, if not it creates a tmp file to store MTRG data if it doesn't exist.
https://exchange.nagios.org/directory/P ... 64/details