Page 2 of 2

Re: Autodiscovery Issue

Posted: Fri May 06, 2016 1:12 pm
by tgriep
Nagios XI is running as the nagios user and uses sudo to run nmap and from the error, it looks like PAM is blocking it from running.
Can you run the following and post the output.

Code: Select all

grep  COMPONENT_VERSION  /usr/local/nagiosxi/html/includes/components/autodiscovery/autodiscovery.inc.php
Next, run the following tail command, then startup an autodiscovery and then post the output of the tail command.

Code: Select all

tail -f  /var/log/secure /var/log/messages

Re: Autodiscovery Issue

Posted: Fri May 06, 2016 2:31 pm
by vy3734
root@**** ~]# grep COMPONENT_VERSION /usr/local/nagiosxi/html/includes/components/autodiscovery/autodiscovery.inc.php
COMPONENT_VERSION => '2.2.1',


==> /var/log/secure <==
May 6 12:33:02 crond[28999]: pam_unix(crond:session): session opened for user nagios by (uid=0)
May 6 12:33:02 crond[28993]: pam_unix(crond:session): session opened for user nagios by (uid=0)
May 6 12:33:02 crond[28998]: pam_unix(crond:session): session opened for user nagios by (uid=0)

==> /var/log/messages <==
May 6 12:34:39 nagios: wproc: early_timeout=1; exited_ok=0; wait_status=0; error_code=62;
May 6 12:34:39 nagios: Warning: Check of service 'Garbage Collection Timing' on host '10.72' timed out after 60.009s!
May 6 12:34:39 nagios: wproc: Co

Re: Autodiscovery Issue

Posted: Mon May 09, 2016 8:52 am
by lmiltchev
In Nagios XI 5.2.7, you should be using the "Auto-Discovery" component version 2.2.3, and "Auto-Discovery" wizard version 1.4.0. Try updating the component (and wizard if needed) to the latest versions, remove the old discovery jobs, and try rerunning the wizard again. Let us know if this fixed your issue.

Admin->System Extensions->Manage Components->Check for Updates->Install Updates
Admin->System Extensions->Manage Config Wizards->Check for Updates->Install Updates

Re: Autodiscovery Issue

Posted: Mon May 09, 2016 10:40 am
by vy3734
upgraded Auto-discovery wizard to 1.4.0, upgrade Auto-Discovery" component didn't work when clicked install updates, still at version 2.2.1.

run discovery job again still same issue.

seeing this in /var/log/secure

May 9 11:22:06 esu4v187 sudo[19484]: pam_unix(sudo:auth): auth could not identify password for [apache]

Re: Autodiscovery Issue

Posted: Mon May 09, 2016 2:29 pm
by tgriep
It looks like the issue is with the Apache account, can you login as root, run the following and post the output?

Code: Select all

chage -l apache
grep apache /etc/passwd
grep apache /etc/group

Lets manually update the autodiscovery script by following this procedure

Code: Select all

cd /tmp
wget http://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz
tar xzf xi-latest.tar.gz
cd /tmp/nagiosxi
cp /usr/local/nagiosxi/html/includes/components/autodiscovery/autodiscovery.inc.php /tmp
cp /tmp/nagiosxi/nagiosxi/basedir/html/includes/components/autodiscovery/autodiscovery.inc.php /usr/local/nagiosxi/html/includes/components/autodiscovery/autodiscovery.inc.php
chown apache.nagios /usr/local/nagiosxi/html/includes/components/autodiscovery/autodiscovery.inc.php
chmod 640 /usr/local/nagiosxi/html/includes/components/autodiscovery/autodiscovery.inc.php

Re: Autodiscovery Issue

Posted: Mon May 09, 2016 4:31 pm
by vy3734
upgraded autodiscovery component to 2.2.3, still see same issue.

[root@****** ~]# chage -l apache
Last password change : Jul 09, 2015
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : -1
Maximum number of days between password change : -1
Number of days of warning before password expires : -1
[root@****** ~]# grep apache /etc/passwd
apache:x:48:48:Apache:/var/www:/sbin/nologin
[root@****** ~]# grep apache /etc/group
apache:x:48:
nagios:x:41091:nagios,apache,b0,1622029203,snmptt
nagcmd:x:59996:nagios,apache,snmptt

Re: Autodiscovery Issue

Posted: Mon May 09, 2016 4:56 pm
by tgriep
Can you post the following files so we can review them?

Code: Select all

/etc/sudoers
/etc/pam.d/sudo
/etc/pam.d/su
Thanks

Re: Autodiscovery Issue

Posted: Tue May 10, 2016 8:34 am
by vy3734
/etc/sudoers

Defaults !visiblepw
Defaults always_set_home
Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS"
Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
root ALL=(ALL) ALL
root ALL=(ALL) ALL
nagios ALL=(ALL) ALL

b0\$sscop ALL=(ALL) NOPASSWD:/usr/local/nagiosxi/scripts/reconfigure_nagios.sh

Defaults:nagios !requiretty
Defaults:apache !requiretty
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_init_service
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_linux_stats.pl
rsyncuser ALL= NOPASSWD:/usr/bin/rsync
User_Alias NAGIOSXI=nagios
User_Alias NAGIOSXIWEB=apache
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios checkconfig
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd status
NAGIOSXI ALL = NOPASSWD:/usr/bin/nmap *
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/change_timezone.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/reset_config_perms.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/messages
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/httpd/error_log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/mysqld.log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/nmap *
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXIWEB ALL = NOPASSWD:/etc/init.d/snmptt restart
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/repair_databases.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *


User_Alias NAGIOSREACTORWEB=apache
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/supervisord start
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/supervisord stop
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/supervisord restart
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/supervisord reload
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/supervisord status
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/gearmand start
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/gearmand stop
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/gearmand restart
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/gearmand reload
NAGIOSREACTORWEB ALL = NOPASSWD:/etc/init.d/gearmand status
apache ALL=(ALL) NOPASSWD: /usr/local/interfacetable_v3t/sbin/InterfaceTableReset_v3t.cgi

#################/etc/pam.d/sudo#####
#%PAM-1.0
auth include system-auth
account include system-auth
password include system-auth
session optional pam_keyinit.so revoke
session required pam_limits.so


###/etc/pam.d/su##
#%PAM-1.0
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required pam_wheel.so use_uid
auth include system-auth
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session optional pam_xauth.so

Re: Autodiscovery Issue

Posted: Tue May 10, 2016 1:00 pm
by lmiltchev
Let's try running the auto-discovery wizard one more time (after you upgraded the auto-discovery component to 2.2.3). Remove the old discovery jobs, and run the Auto-Discovery wizard. When it hangs (starts spinning), run the following command in the command line, and show the output in code wraps:

Code: Select all

tail -100 /var/log/httpd/error_log
Also, show the output of:

Code: Select all

chage nagios -l
tail -50 /var/log/cron
Is opening a new support ticket in our email ticketing system an option for you? We may need to schedule a remote session to further troubleshoot your problem. Thank you!