Command line vs gui commands

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Command line vs gui commands

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Command line vs gui commands

Post by scottwilkerson »

My guess would be maybe a special char in the username/password like \/ $ or !
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Command line vs gui commands

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Command line vs gui commands

Post 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'"
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Command line vs gui commands

Post by emartine »

yes I can.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Command line vs gui commands

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Command line vs gui commands

Post by emartine »

Sent you a PM
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Command line vs gui commands

Post by scottwilkerson »

emartine wrote:Sent you a PM
responded

When you are testing the command from the CLI you have

Code: Select all

'sys/chassis-1/blade-1'
but in the CCM you have it without quotes

Code: Select all

sys/chassis-1/blade-1
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Command line vs gui commands

Post by emartine »

I've tried with single, double and without quotes over the GUI. I've also tried escaping the /
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Command line vs gui commands

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked