Page 2 of 2

Re: Command line vs gui commands

Posted: Wed Mar 06, 2019 1:01 pm
by emartine
I applied the configuration for the check and the output it gave me in the web was as follows


(No output on stdout) stderr: Traceback (most recent call last):
File "/usr/local/nagios/libexec/cisco_ucs_nagios", line 25, in <module>
from UcsSdk import *
ImportError: No module named UcsSdk


But as the nagios user it works fine on the command line.

Re: Command line vs gui commands

Posted: Wed Mar 06, 2019 1:30 pm
by scottwilkerson
I wonder if this package isn't in a path that allows python to find it when running without the full environment

Can you run

Code: Select all

locate UcsSdk

Re: Command line vs gui commands

Posted: Wed Mar 06, 2019 2:31 pm
by emartine
How can I fix it?

Re: Command line vs gui commands

Posted: Wed Mar 06, 2019 3:28 pm
by scottwilkerson
scottwilkerson wrote: Can you run

Code: Select all

locate UcsSdk
what is the output?

Re: Command line vs gui commands

Posted: Fri Mar 08, 2019 11:59 am
by emartine
I was able to resolve this by adding scl enable python27 to the command.

scl enable python27 "$USER1$/cisco_ucs_nagios -H

Re: Command line vs gui commands

Posted: Fri Mar 08, 2019 1:47 pm
by scottwilkerson
emartine wrote:I was able to resolve this by adding scl enable python27 to the command.

scl enable python27 "$USER1$/cisco_ucs_nagios -H
Great! Glad it is resolved1

Locking thread