Update a lot of services check command.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bennyboy
Posts: 157
Joined: Thu Oct 29, 2015 9:42 am

Update a lot of services check command.

Post by bennyboy »

Hi,

I have 448 Service Check to update the check_command. I forgot to specify the unit.

I have change -u to -u M in the check_command. What is the best way to do that.

Thank you!!!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Update a lot of services check command.

Post by rkennedy »

Can you show us the full command definition, along with a sample service definition so that we can see where the variables are placed? You should be able to use the bulk modifications tool, but could vary depending on how things are setup.
Former Nagios Employee
bennyboy
Posts: 157
Joined: Thu Oct 29, 2015 9:42 am

Re: Update a lot of services check command.

Post by bennyboy »

We plan to buy the enterprise edition to use bulk tool but for the moment I don't have that option.
I have to modify a lot of $ARG1$ and append the letter M to see the Unit in Bytes.

Before
-t 'token' -P 5693 -M memory/swap -u -w 50 -c 80
After
-t 'token' -P 5693 -M memory/swap -u M -w 50 -c 80

Full example of the service. All the other 448 are exactly the same.

Before

Code: Select all

define service {
        host_name                       hostname
        service_description             Swap Usage
        use                             xi_nonprod_ncpa_service
        check_command                   check_xi_ncpa!-t 'token' -P 5693 -M memory/swap -u -w 50 -c 80
        register                        1
        }
After

Code: Select all

define service {
        host_name                       hostname
        service_description             Swap Usage
        use                             xi_nonprod_ncpa_service
        check_command                   check_xi_ncpa!-t 'token' -P 5693 -M memory/swap -u M -w 50 -c 80
        register                        1
        }
Thank you!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Update a lot of services check command.

Post by rkennedy »

Have you used the enterprise trial that came with your license? For changing a lot of services at once, the bulk mod tool is really the only way to go, without adding / removing services in bulk.

In the future, it might be worth using templates / groups in order to standardize things across the board.
You do not have the required permissions to view the files attached to this post.
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Update a lot of services check command.

Post by tmcdonald »

Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up?
Former Nagios employee
Locked