Page 1 of 1

Nagios Check_Command Argument

Posted: Mon Aug 22, 2016 2:45 pm
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?

Re: Nagios Check_Command Argument

Posted: Mon Aug 22, 2016 2:50 pm
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

Re: Nagios Check_Command Argument

Posted: Tue Aug 23, 2016 11:35 am
by pradeepanan
Wow that worked. Thanks a lot for the useful information.

Re: Nagios Check_Command Argument

Posted: Tue Aug 23, 2016 11:36 am
by mcapra
Sure thing! Is it alright if we lock this thread and mark the issue as resolved?

Re: Nagios Check_Command Argument

Posted: Thu Aug 25, 2016 6:51 am
by pradeepanan
Sure Thanks