Page 1 of 2
Command line vs gui commands
Posted: Tue Mar 05, 2019 3:50 pm
by emartine
/usr/local/nagios/libexec/cisco_ucs_nagios -H <IP> -u <user> -p <password> -t dn -q 'sys/chassis-1/blade-1'
When I run this on the command line it works fine even as the nagios user but in the web interface, and when applied, I get the result as:
(No output on stdout) stderr: Traceback (most recent call last):
is it the dashes or the / causing an issue?
Re: Command line vs gui commands
Posted: Tue Mar 05, 2019 4:22 pm
by scottwilkerson
My guess would be maybe a special char in the username/password like \/ $ or !
Re: Command line vs gui commands
Posted: Tue Mar 05, 2019 4:30 pm
by emartine
I gave it a simple password for testing so it doesn't have special characters in the password nor username field at this time.
Re: Command line vs gui commands
Posted: Tue Mar 05, 2019 4:41 pm
by scottwilkerson
Can you run this as the nagios user?
Code: Select all
su nagios -c "/usr/local/nagios/libexec/cisco_ucs_nagios -H <IP> -u <user> -p <password> -t dn -q 'sys/chassis-1/blade-1'"
Re: Command line vs gui commands
Posted: Tue Mar 05, 2019 5:00 pm
by emartine
yes I can.
Re: Command line vs gui commands
Posted: Tue Mar 05, 2019 5:06 pm
by scottwilkerson
Do you get text on the first line when running the plugin? This is required for Nagios plugins
when you run the plugin does it skip a line or more?
Like
Code: Select all
# /usr/local/nagios/libexec/cisco_ucs_nagios -H <IP> -u <user> -p <password> -t dn -q 'sys/chassis-1/blade-1'
Plugin output
instead of
Code: Select all
# /usr/local/nagios/libexec/cisco_ucs_nagios -H <IP> -u <user> -p <password> -t dn -q 'sys/chassis-1/blade-1'
Plugin output
Re: Command line vs gui commands
Posted: Wed Mar 06, 2019 10:18 am
by emartine
Sent you a PM
Re: Command line vs gui commands
Posted: Wed Mar 06, 2019 10:39 am
by scottwilkerson
emartine wrote:Sent you a PM
responded
When you are testing the command from the CLI you have
but in the CCM you have it without quotes
Re: Command line vs gui commands
Posted: Wed Mar 06, 2019 12:03 pm
by emartine
I've tried with single, double and without quotes over the GUI. I've also tried escaping the /
Re: Command line vs gui commands
Posted: Wed Mar 06, 2019 12:38 pm
by scottwilkerson
Curious, does it just fail when testing from the CCM or does it also fail if you setup the service?
I ask because there is some escaping that the CCM must to to prevent security vulnerabilities, but the check may run when actually setup.
Additionally, do you get any output when you look at the service detail page?