Hello,
I'm standing up monitoring on a site with a few thousand hosts. I'd love to use NCPA so I can pull in the disk info automatically; Obviously I'm not going to run the wizard 4000+ times. Short of changing the NCPA Wizard code to accept an input & loop through that do you have any suggestions about implementing this?
I thought about using hostgroups-to-services & mass import tool. Both run into the problem of the i + 1 server could have more or less disk mounts/drives than the ith server. If making changes to the wizard is our best shot, can you point me in the right direction as to where it loops through & grabs the Disk Metrics?
Thanks,
Max Ramirez
NCPA Loop
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: NCPA Loop
@Maxwellb99, There is an API command to get a json list of mounted disks.
So what you could do is:
1) auto-deploy NCPA agents to all devices(using Ansible or other automation software)
2) run through a list of deployed devices and do a disk check using the API call above
3) write out config files or use the API to add hosts/services for each of the deployed devices
You'd have to have some scripting knowledge in order to implement this project.
PS: We also provide a custom dev projects for our clients. You may contact [email protected] for a quote.
Code: Select all
https://<ipaddr>:5693/api/api/disk/logical?token=<token>1) auto-deploy NCPA agents to all devices(using Ansible or other automation software)
2) run through a list of deployed devices and do a disk check using the API call above
3) write out config files or use the API to add hosts/services for each of the deployed devices
You'd have to have some scripting knowledge in order to implement this project.
PS: We also provide a custom dev projects for our clients. You may contact [email protected] for a quote.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
Maxwellb99
- Posts: 97
- Joined: Tue Jan 26, 2016 5:29 pm
Re: NCPA Loop
Hey,
sorry, every time I'd check it, it said "0 new messages". Thanks for the response.
I'm tracking what you're saying up until step (3). You've given me the getter method what's the accompanying setter method? I.e. ok I know Server foo has drives A:F & I can redirect foo.JSON to a file. How do I tell my Nagios instance to add drives A:F to host foo? Am I missing an obvious solution like "Upload JSON files here"? (I know I can import configs but those aren't configs are they?).
Or is this a:
Parse the files for the drives, create template, & loop through using api to add drive 1, ..., N to service(s) on hosts 1, ..., N?
If that's the case I might take another look at changing the wizard; see teaching myself PHP
. I think in the long run it'll be a cleaner, easier to maintain solution than maintaining a bunch of scripts. It also automatically adds the services to each host, which is nice.
Have a happy, holiday weekend.
Cheers,
Maxwell Ramirez
sorry, every time I'd check it, it said "0 new messages". Thanks for the response.
I'm tracking what you're saying up until step (3). You've given me the getter method what's the accompanying setter method? I.e. ok I know Server foo has drives A:F & I can redirect foo.JSON to a file. How do I tell my Nagios instance to add drives A:F to host foo? Am I missing an obvious solution like "Upload JSON files here"? (I know I can import configs but those aren't configs are they?).
Or is this a:
Parse the files for the drives, create template, & loop through using api to add drive 1, ..., N to service(s) on hosts 1, ..., N?
If that's the case I might take another look at changing the wizard; see teaching myself PHP
Have a happy, holiday weekend.
Cheers,
Maxwell Ramirez
Re: NCPA Loop
That's the solution I would use. JSON is really easy to loop over, and the API calls would basically just sub in a different service name and arguments.Maxwellb99 wrote:Or is this a:
Parse the files for the drives, create template, & loop through using api to add drive 1, ..., N to service(s) on hosts 1, ..., N?
Former Nagios employee