Add argument using bulk modification tool

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Add argument using bulk modification tool

Post by jsharris »

Is it possible to add an argument to a service check using the bulk modification tool without changing any of the current arguments? We have a large number of checks using the check_esx3 command and would like to add the timeout option to $ARG3. However, $ARG1 and $ARG2 do not have the same value across all of the checks. When I attempt to use the tool to add $ARG3 but leave 1 and 2 blank it adds 3 but erases 1 and 2.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Add argument using bulk modification tool

Post by avandemore »

I don't know of a way to do this directly through the bulk modification tool. You can create separate services for the command with different args, and apply to hosts via templates as appropriate. I can submit a Feature Request for the functionality in the Bulk Modification Tool, but the template method is the intended use.
Previous Nagios employee
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: Add argument using bulk modification tool

Post by jsharris »

I am not sure that templates would work in this instance. We are checking the status of our VM hosts with each check having 2 arguments. So say we have 5 hosts and each of those has 5 checks where $ARG1 for each host is the same but $ARG2 is different. We couldn't create a template for each host as $ARG2 and we couldn't create a template for the specific check (CPU, VMFS, etc.) because for each $ARG1 would be different.

Or should I create a template which only specifies $ARG3 and apply that to each of the existing service checks? We have not done much with templates, unfortunately.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Add argument using bulk modification tool

Post by avandemore »

Perhaps you can share a couple of specific examples so I can better understand. Macros and user macros can handle at least part of what you are referring too.

https://assets.nagios.com/downloads/nag ... acros.html
https://assets.nagios.com/downloads/nag ... olist.html

Also here is a soon to be published link:

https://assets.nagios.com/downloads/nag ... ponent.pdf
Previous Nagios employee
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: Add argument using bulk modification tool

Post by jsharris »

We use the check_esx3 plugin to monitor our VM hosts with each service currently configured to have two arguments. $ARG1 is the path to the credentials used to connect to the host (this is different for each host but the same for each check per host). $ARG2 is the resource being checked (we have seven resources being checked on each host: CPU, VMFS, IO, MEM, NET, SERVICE, and RUNTIME). So we would have (I hope this is what you are asking for):

Host: Host1
$ARG1: path to credentials 1
$ARG2: CPU

Host: Host1
$ARG1: path to credentials 1
$ARG2: MEM

Host: Host1
$ARG1: path to credentials 1
$ARG2: IO

etc., and:

Host: Host2
$ARG1: path to credentials 2
$ARG2: CPU

Host: Host2
$ARG1: path to credentials 2
$ARG2: MEM

Host: Host2
$ARG1: path to credentials 2
$ARG2: IO

etc.

All told we have 35 hosts with 7 services each for a total of 245 service checks. We can add the argument manually to each of them but if there is a more efficient way I'd prefer that.

Currently the only template assigned to these services is the xiwizard_generic_service template. I am not familiar with how templates are applied, particularly as regards multiple templates (do they stack? what is the order they are applied in? and so on). If I created a new template which configured only $ARG3 and applied it to the above checks, would it leave everything configured at the service itself alone and just add the value in the $ARG3 field?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Add argument using bulk modification tool

Post by tgriep »

Yes, the templates do stack so creating a template and adding the settings in the $ARG3$ field should work for you.
If all you need to do is to add the timeout setting for that command, just edit the command and add it there. That is the simplest way to do it.
Go to the Core Config Manager > Commands menu and edit the following command

Code: Select all

check_esx3_host
Change the command line from

Code: Select all

$USER1$/check_esx3.pl -H "$HOSTADDRESS$" -f "$ARG1$" -l "$ARG2$" $ARG3$
to

Code: Select all

$USER1$/check_esx3.pl -H "$HOSTADDRESS$" -t 59 -f "$ARG1$" -l "$ARG2$" $ARG3$
Save it and apply the config. That will change the timeout to 59 seconds for all of the checks that use that command.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: Add argument using bulk modification tool

Post by jsharris »

I hadn't even considered just rolling the argument directly into the command like that. That is perfect. Thanks!

With regard to the stacking of templates, how is priority decided? If two or more templates have different values for the same item which is used?
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Add argument using bulk modification tool

Post by avandemore »

This is the most definitive answer to that question aside for real time testing:

https://assets.nagios.com/downloads/nag ... tance.html
Previous Nagios employee
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: Add argument using bulk modification tool

Post by jsharris »

Thank you! I'll take a look through that and I think we can call this one solved.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Add argument using bulk modification tool

Post by avandemore »

Great, if you have further issues or questions please open a new thread.
Previous Nagios employee
Locked