Custom check works in CLI, as nagios user, but not in XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
brudnick
Posts: 37
Joined: Mon Feb 17, 2014 3:17 pm

Custom check works in CLI, as nagios user, but not in XI

Post 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?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Custom check works in CLI, as nagios user, but not in XI

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
brudnick
Posts: 37
Joined: Mon Feb 17, 2014 3:17 pm

Re: Custom check works in CLI, as nagios user, but not in XI

Post by brudnick »

Lock the post. I figured it out. It had to do with the folder Nagios XI was reading/writing the file to.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Custom check works in CLI, as nagios user, but not in XI

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked