Page 1 of 1
Custom check works in CLI, as nagios user, but not in XI
Posted: Thu Oct 17, 2019 2:31 pm
by brudnick
I have created a check that checks if a file can be uploaded and downloaded from sftp server. We use an ssh key to connect. It works perfectly fine when I run it as the nagios user in CLI. When I run the check in XI in either the ccm or applied to the configuration, it fails on each check. Is there something in need to do with the ssh key for it to work within Nagios like it does on the CLI?
Re: Custom check works in CLI, as nagios user, but not in XI
Posted: Thu Oct 17, 2019 2:44 pm
by benjaminsmith
Hello
@brudnick,
When you run the check command from the Nagios XI server, are you logged in as root or the nagios user?
If you are executing the plugin over ssh, you'll need to setup passwordless login for the nagios user account. See the guide below for step-by-step instructions.
Monitoring Hosts Using SSH
Re: Custom check works in CLI, as nagios user, but not in XI
Posted: Thu Oct 17, 2019 2:48 pm
by brudnick
Lock the post. I figured it out. It had to do with the folder Nagios XI was reading/writing the file to.
Re: Custom check works in CLI, as nagios user, but not in XI
Posted: Thu Oct 17, 2019 2:50 pm
by benjaminsmith
Hello
@brudnick,
Lock the post. I figured it out. It had to do with the folder Nagios XI was reading/writing the file to.
Good to hear. We'll close this one up.
Thank you for using the Nagios Support Forum.