Nagios Check_Command Argument

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pradeepanan
Posts: 41
Joined: Wed Sep 30, 2015 1:58 pm

Nagios Check_Command Argument

Post by pradeepanan »

Folks,

I have small roadblock in monitoring host in NMs. I am adding a host where the script from NMS logs into the host using username and password and do its check.

Issue is the password for the host is "xyz!". Therefore when i give the the password as "$ARG1$: xyz! " its not taking "!" as an argument instead keyword to separate parameters.

Code: Select all

define service {
        use Check_ESXi
        service_description ESXi_Hardware
        check_command check_esxi_hardware!xyz!
        host_name test
        servicegroups All_Services
        contact_groups Users
}

Anyone knows how to define "!" as part of argument?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Check_Command Argument

Post by mcapra »

The most common solution is to define xyz! in a macro and use the macro in your check_command definition. This document is for Nagios XI, but the same concepts apply:
https://assets.nagios.com/downloads/nag ... Macros.pdf
Former Nagios employee
https://www.mcapra.com/
pradeepanan
Posts: 41
Joined: Wed Sep 30, 2015 1:58 pm

Re: Nagios Check_Command Argument

Post by pradeepanan »

Wow that worked. Thanks a lot for the useful information.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Check_Command Argument

Post by mcapra »

Sure thing! Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
pradeepanan
Posts: 41
Joined: Wed Sep 30, 2015 1:58 pm

Re: Nagios Check_Command Argument

Post by pradeepanan »

Sure Thanks
Locked