Page 1 of 1

Bulk Modification - Modifying Arguments

Posted: Fri Oct 25, 2019 8:08 am
by bosecorp
Hi

I am tried to modify one argument in multiple services checks using the bulk modification tool. When using the tool to modify 1 argument, the tools seem to modify the other arguments even if don't put a value in the arguments in the bulk modification tool. It seems to consistently modify all arguments regardless.

how can I modify just 1 argument?

Re: Bulk Modification - Modifying Arguments

Posted: Fri Oct 25, 2019 9:38 am
by lmiltchev
Unfortunately, you cannot modify only one argument via the bulk mod tool. If you left the rest of the fields empty, nagios would "think" that you wanted to wipe them out (not use any arguments).

You could copy/paste the "original" arguments in the rest of the fields (the ones that you don't want to change), and modify only the one argument you need to.

Note: This won't be useful in all cases. For example, if you had a command, used in several services that you wanted to modify only one argument on, but the rest of the arguments were all different, you couldn't do it. Let's say, you have two dummy services, "dummy1" and "dummy2".

Code: Select all

define service {
    host_name                myhost
    service_description      dummy1    
    check_command            check_dummy!0!"apple"
    ...
}

define service {
    host_name                myhost
    service_description      dummy1    
    check_command            check_dummy!0!"orange"
    ...
}
You could use the bulk mod tool to change the first argument ("0"), to let's say "1", so that the services would return a "WARNING". If you left the second field blank, the bulk mod tool would remove "apple" and "orange". You could enter something in the second field, e.g. "pear", but then this would affect both services...

Code: Select all

define service {
    host_name                myhost
    service_description      dummy1    
    check_command            check_dummy!1!"pear"
    ...
}

define service {
    host_name                myhost
    service_description      dummy1    
    check_command            check_dummy!1!"pear"
    ...
}
Obviously, this is not ideal and cannot be used in all cases. Hope this makes sense. Thanks!

Re: Bulk Modification - Modifying Arguments

Posted: Fri Oct 25, 2019 11:48 am
by bosecorp
Yes, Make sense. Unfortunately in my case I wanted to modify only 1 ARG

thanks you can close the ticket