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.
AutoDiscovery fails to complete
AutoDiscovery fails to complete
Grumpy Olde IT Guy
Re: AutoDiscovery fails to complete
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.
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: AutoDiscovery fails to complete
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
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
Re: AutoDiscovery fails to complete
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
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
Re: AutoDiscovery fails to complete
Excellent! I'm glad to hear that it is working for you now.
Is it okay if we close this topic 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!