AutoDiscovery fails to complete

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
rseiwert
Posts: 196
Joined: Wed Jun 22, 2011 10:33 pm
Location: Somewhere between Here and Now

AutoDiscovery fails to complete

Post by rseiwert »

When running Autodiscovery the jobs never reach completion.
Nagios XI 5.6.7
Config Wiz ver. 1.4.2 up to date
Core Component 2.2.6
nmap.x86_64 6.47

When I look at the out file in /usr/local/nagiosxi/html/includes/components/autodiscovery/jobs/ I see
sudo: no tty present and no askpass program specified

Attempting to discover one host. Running nmap manually for the host works.
Grumpy Olde IT Guy
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: AutoDiscovery fails to complete

Post by jbrunkow »

Have you elevated the user doing the autodiscovery jobs to sudoer? It sounds like this could likely be a permissions issue.

It looks like other people have found that this error is resolved for them by commenting out the requiretty line in the /etc/sudoers file. You may want to try that as well. I believe you could also change the permissions with visudo, depending on which operating system you are using.
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!
User avatar
rseiwert
Posts: 196
Joined: Wed Jun 22, 2011 10:33 pm
Location: Somewhere between Here and Now

Re: AutoDiscovery fails to complete

Post by rseiwert »

It looks like the user running the sudo job is apache. I'm wondering if it's a good idea to allow apache to sudo.

Apr 22 17:53:34 nagios sudo: pam_unix(sudo:auth): auth could not identify password for [apache]
Apr 22 17:53:34 nagios sudo: apache : command not allowed ; TTY=unknown ; PWD=/usr/local/nagiosxi/html/includes/components/autodi
scovery ; USER=root ; COMMAND=/usr/bin/php /usr/local/nagiosxi/scripts/components/autodiscover_new.php --addresses=132.157.1.0/24 -
-exclude= --output=/usr/local/nagiosxi/html/includes/components/autodiscovery/jobs/GX7bH8.xml --watch=/usr/local/nagiosxi/html/incl
udes/components/autodiscovery/jobs/GX7bH8.watch --onlynew=0 --debug=1 --detectos=1 --detecttopo=1 on
Grumpy Olde IT Guy
User avatar
rseiwert
Posts: 196
Joined: Wed Jun 22, 2011 10:33 pm
Location: Somewhere between Here and Now

Re: AutoDiscovery fails to complete

Post by rseiwert »

FYI, I did have requiretty commented out already.

using visudo I see

User_Alias NAGIOSXIWEB=apache
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *

Looks OK but it Took me a min to realize that is was executing something different.

/usr/bin/php /usr/local/nagiosxi/scripts/components/autodiscover_new.php
Added that to sudoers and it seems to work now
Grumpy Olde IT Guy
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: AutoDiscovery fails to complete

Post by jbrunkow »

Excellent! I'm glad to hear that it is working for you now.

Is it okay if we close this topic now?
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